Ask Your Question

Solving PDEs

asked 2015-02-02 17:36:18 +0200

Marios Papachristou gravatar image

updated 2015-02-02 17:36:41 +0200

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 23:52:28 +0200 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-02-03 20:20:02 +0200

Marios Papachristou gravatar image

updated 2015-02-03 21:08:35 +0200

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

answered 2015-02-04 03:21:55 +0200

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

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 17:36:18 +0200

Seen: 4,365 times

Last updated: Feb 04 '15