Azzera filtri
Azzera filtri

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

17 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

Torsten
Torsten il 25 Giu 2024 alle 23:09
Modificato: Torsten il 25 Giu 2024 alle 23:12
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 Commento
Bill Greene
Bill Greene il 26 Giu 2024 alle 10:06
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.)

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by