zwicker-group / py-pde

Python package for solving partial differential equations using finite differences.

Home Page:https://py-pde.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to apply a forcing term ?

ReHoss opened this issue · comments

Hi, I would like to apply control on PDEs using your library.

To do so, I would like to apply a forcing term to the pde for a small dt.

A workaround I just found is to redefine at each control time step the evolution_rate method with the new computed forcing term in the RHS and then integrate again for a small dt ?

Thank you for your consideration,

EDIT: Sorry it might be better to move this issue into the discussion section...

I'm not sure what you're trying to achieve. If you use the python/numpy interface, your evolution_rate method can of course depend on additional parameters. If you also want to use the numba interface things are more tricky since we currently do not support external parameters.

I'd like to use the python interface to implement d_x(t)/dt = F(x(t)) + u(t), with F = KPZ for instance. Where u(t) is recomputed every dt by a neural network for instance (feedback control).

What prevents you from simply implementing $u(t)$ in evolution_rate?