Clear Filters
Clear Filters

Does pdepe accept 'Vectorized', 'on' as an option? If so, what does it do?

3 views (last 30 days)
I am writing a code that uses pdepe. It would be easy to write the pdefun in vectorized form. That is, if there are N variables and M position points, if the position x is input as a vector, then c, f, and s would be output as NxM arrays. It seems like this would be more efficient than only allowing x to be a scalar. However, odeset does have a "Vectorized" option. Does this option apply to pdepe? If so, what does it do? Does it allow the input variable x to be a vector rather than a scalar?
Thanks for your help!

Accepted Answer

Torsten
Torsten on 25 Jun 2024
Edited: Torsten on 25 Jun 2024
If you look into the documentation for "pdepe", you will find that the "Vectorized" option cannot be chosen:
Cited from the documentation of "pdepe":
options — Option structure
structure array
Option structure, specified as a structure array. Use the odeset function to create or modify the option structure. pdepe supports these options:
In most cases, default values for these options provide satisfactory solutions.
If I remember correctly, this variant of "pdepe" has the choice to vectorize the calls to the function where you provide c, s and f:
  1 Comment
Bill Greene
Bill Greene on 26 Jun 2024
Yes, pde1dm provides a "Vectorized=on" option that can substantially improve performance for refined meshes. I don't know why pdepe does not also support this. (There are several other ode15s options that could also be supported by pdepe but, unfortunately, are not.)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!