pdepe extract intermediate values
14 views (last 30 days)
I am solving a pdes using the pdepe function, but I have an issue.
Suppose you want to solve for u, and have your c, f, and s. However, s includes some function g(u)
Suppose that g is a sigmoid function that depends on the neighboring node.
For instance, g(i) = u(i) - sig(u(i-1) - threshold)
That way, the value of u at point i depends on neighboring nodes of previous time steps.
To overcome this issue, I would like to extract all my values of u at each time step into a function, calculate g and return back to the regular itteration. Basically calulate g at each time step, feed it into the giv equation, and proceed in solving.
Is there a way for me to extract all the solutions for u at each time step?
Bill Greene on 28 Jun 2022
I have written a PDE solver, pde1dm, that has some similarities to pdepe and accepts the same input syntax as pdepe. Most input that is acceptable to pdepe will also work in pde1dm.
However pde1dm has some additional capabilities. If you pass the option vectorized='on' to pde1dm, your pde function will be passed a vector of x-values spanning your complete spatial domain along with u and DuDx matrices at these x values. This allows your pde function to, for example, evaluate an integral involving the solution over the complete spatial domain. (Note that if you use this vectorized option, your pde function is also expected to return c, f, and s matrices corresponding to all values in the x vector.) You may be able to use this capability for your particular application.
You can find more information and download pde1dm here.