Ask Your Question

Solving PDEs

asked 2015-02-02 10:36:18 -0500

Marios Papachristou gravatar image

updated 2015-02-02 10:36:41 -0500

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 flag offensive close merge delete



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!


fbarbuto gravatar imagefbarbuto ( 2015-02-02 16:52:28 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2015-02-03 20:21:55 -0500

tmonteil gravatar image

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.

edit flag offensive delete link more

answered 2015-02-03 13:20:02 -0500

Marios Papachristou gravatar image

updated 2015-02-03 14:08:35 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-02-02 10:36:18 -0500

Seen: 739 times

Last updated: Feb 03 '15