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

Implementing 1d Klein-Gordon Equation: Evolution operator

gotencoder opened this issue · comments

Hi there,

I am looking to implement the 1D Klein-Gordon equation $u_{tt} - u_{xx} + V = 0$ using the py-pde package but I am having some issues, specifically as the evolution operator is a second order derivative in time. I have looked at the tutorials and examples but they all seem to have an LHS as a first order derivative in time. Is there a method to do this in py-pde?
Thanks

Yes, the package only supports first-order derivatives in time, but you can easily introduce an auxiliary field, $f=\partial_t c$, to turn your equations into a coupled system with first-order time derivatives.