How to get positional index from pdepe into pde

1 vue (au cours des 30 derniers jours)
Ilario Gelmetti
Ilario Gelmetti le 17 Avr 2020
We're using pdepe to simulate solar cells.
The PDEfun function (which is a user-defined function pdepe calls for obtaining the C,F,S values) receives as arguments: xi(ii) (the position point), tnow (the time point), U (the value), Ux (the derivative of the value).
As in our layered system we use the index to access the layers' properties, for us it would be much more useful to have the position index ii as an argument to PDEfun rather than the position point xi(ii).
Currently we look for xi(ii) in our spatial mesh for obtaining back the ii value, which is one of the most time consuming steps in our simulations (using find).
Is there a way to obtain it directly (without modifying pdepe)?
You can find our current code here.

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by