Open bgctw opened 10 months ago
You can try scalarizing yourself before solving, we try to do this internally to make systems compatible. please be aware that ODEFunction is intended to be internal for MOL, you should try getting this with prob.f
instead.
Non equidistant grid is supported, see: https://docs.sciml.ai/MethodOfLines/stable/nonuniform/. you can also write[x => xpoints]
where xpoints
is a vector of grid points.
you can use
grid = get_discrete(pdesys, discretization)
discrete_x = grid[x]
to get the grid points, nb it is recommended to use remake
to update system parameters to avoid re-discretizing each time
I will look at this bug in more detail soon
Describe the bug 🐞
When using symbolic arrays as state variables, the name of the corresponding discretized state currently use several stacked
var""
. When trying to relate the discretized variables back to the original pde variables, this name is hard to reconstruct. This leads to special cases and bugs, e.g. when trying to extract grid locations for a pde-variable as in the example below.Expected behavior
Either avoid generating the names with several "var" or modify function
_get_gridloc
to deal with this case.SciMLBase.ODEFunction(pdesys)
should not throw an error.Minimal Reproducible Example 👇
Error & Stacktrace ⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
We use symbolic arrays as state variables, so that we can concisely generate similar equations for several states. We also want to use non-equidistant spacial 1-d grid. For modifying the problem state (reapplying the boundary condition function with different parameters that are optimized) I need to get the grid locations from the system or problem. This works for scalar symbolic states, but fails for the symbolic arrays.
This is not urgent. I just want to support development and testing with this MWE.