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

17 次查看(过去 30 天)
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!

采纳的回答

Torsten
Torsten 2024-6-25,23:09
编辑:Torsten 2024-6-25,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 个评论
Bill Greene
Bill Greene 2024-6-26,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.)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by