How to get positional index from pdepe into pde

1 view (last 30 days)
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.

Answers (0)

Categories

Find more on Partial Differential Equation Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!