Filter löschen
Filter löschen

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

17 Ansichten (letzte 30 Tage)
Brian Cluggish
Brian Cluggish am 25 Jun. 2024 um 22:46
Kommentiert: Bill Greene am 26 Jun. 2024 um 10:06
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!

Akzeptierte Antwort

Torsten
Torsten am 25 Jun. 2024 um 23:09
Bearbeitet: Torsten am 25 Jun. 2024 um 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 Kommentar
Bill Greene
Bill Greene am 26 Jun. 2024 um 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.)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by