zwicker-group / py-pde

Python package for solving partial differential equations using finite differences.
https://py-pde.readthedocs.io
MIT License
393 stars 50 forks source link

Allow storing instantaneous fields alongside dynamic fields #534

Open david-zwicker opened 5 months ago

david-zwicker commented 5 months ago

Instead of only dealing with dynamic equations in forms of PDEs, it might be nice to also evolve other fields or scalars (if #533 is implemented). This would allow to solve general systems that are given by $\partial_t x = f(x, y)$ and $y = g(x, y)$. The strategy would then be to first determine y in each time step and then calculate f(x, y) to evolve x. This is already possible now with custom PDE classes (and also using user_funcs in the PDE class), but it might help if we expose an easier interface for this case. In particular, we could save the fields y in the output (whereas only the x need to be specified in the initial state).