# Solving PDEs

Hello can I solve equations of the following form in sage?

E.g. $$A\frac{\partial ^ n f}{\partial x^n} + B \frac{\partial^kf}{\partial y^k} = 0, \quad f=f(x,y)$$

Meaning a PDE that contains the n-th derivative with respect to x and the k-th derivative with respect to y.

edit retag close merge delete

Hello,

I assume you want to have your PDE(s) solved numerically. And I don't think SAGE is the best tool to accomplish that. You can certainly solve your PDE with SAGE, but you will have to put a lot of your own code together.

If you want to solve equations like the above with less effort, may I suggest you to use FiPy, a PDE solver that uses the finite volume method (FVM). It has extensive documentation, several examples and a support list where developers and users will help you with your questions.

Good luck!

Fausto

( 2015-02-02 16:52:28 -0500 )edit

Sort by » oldest newest most voted

There is no PDE in Sage (yet?), however you can install some PDE Python libraries, for example you can easily install fipy by typing from a terminal:

sage -pip install ez_setup fipy


Then, you can import it from within Sage and let it interact with other existing tools.

Other possibilities seem to include sfepy and hpfem, though they might require more skills to get installed within Sage.

more

Thank you very much! I would like to wonder if there is extensive documentation on PDEs with sage (even with hundreds of lines of code). I am particularly interested in solving time dependent Schroedinger Equations that in one dimension (for example) have the form $$\hat H \psi = i\hbar \dot \psi$$ meaning that the wavefunction depends on x (space) and t (time). However in simpler forms (where for example the potential energy is 0) then the solution can be expressed as a product of two functions (like in the heat equation) as $\psi = \psi (x,t) = X(x)T(t)$

UPDATE: This method works pretty for such equations well since the equations reduce to $\hat H X = EX$ and $\dot T = E/(i \hbar ) T$ and the algorithm is very simple.

more