The Azimuth Project
Sage DE-solvers tutorial (Rev #6, changes)

Showing changes from revision #5 to #6: Added | Removed | Changed

Contents

Idea

Give a first impression on what kind of functions there are in Sage for numerically solving differential equations. There is support for solving differential equations symbolically in Sage as well but that will not be treated here.

Details

We assume you got a new worksheet up and named, so the first you see is the notebook page. If you are like me then you try out all buttons and menues and see what they contain and then I look for the help button, which in the Sage notebook worksheet is up to the right as a blue text link. Press that and you will get a separate browser window with all type of help. Scroll down to the “Key and Mouse Bindings” and leave it open ! Read about how to “Evaluate input” and “Tab completion” at some point.

So let us think about ways to solve the Lotka-Volterra in Sage: A system of two first order differential equations. We could try the reference manual, but we can also use tab completion which is one of many short cuts that makes you focus on research, not reading manuals. So You could perhaps try writing “ode” or just “de” like I did and then press tab:

detab

So that was a lot of interesting functions, some relevant, like the venerable runge-kutta , which I scrolled down to and its shown by a darker blue. But I saw another function called “desolvers”. Select that in the list and it will end up in as text in the input cell and type a “?”. Scroll up in the help window and you will see that you can read about “Help About”

detab

So there is more information on some of the available solvers in Sage for differential equations. I intend to make something more interactive and i know that neither Sage euler or runge-kutta will are do. slow as they are implemented in Python. But I just read onAsk Sage that there is another possibility. possibility, which uses a GNU Scientific Library (GSL) and is much faster.