[SciPy-user] Usage of PyDSTool

Rob Clewley rob.clewley at gmail.com
Sat Aug 9 17:10:01 EDT 2008


Hi,

On Sat, Aug 9, 2008 at 3:56 PM, Mico Filós <elmico.filos at gmail.com> wrote:
> Thanks Rob,
>
> I think that the tutorial of XPP is a good example to look at. In my
> opinion, what is missing is some documentation oriented to users
> already familiar with dynamical systems (and, perhaps, with XPP) but
> not particularly interested in the implementation details of the
> module.

OK, your comments are helpful, but could you also address the
usefulness of the demonstration scripts provided in the /tests
directory? Of course I don't expect anyone to learn how things work
from the main modules, but there are many simple examples of all the
basic tasks in these scripts. I know it's not a tutorial, but most of
them are well commented and include screen output and graphs.

I had pointed new users on the wiki to look at these scripts on
multiple occasions. Is the problem that the directory is called
'tests' when maybe it should be called 'examples' or 'demos'?

In the spirit of my above comment, here's what you should be looking
at in lieu of a proper tutorial.

> My first stab at a tentative tutorial would include the
> following points:
>
> - How to specify a dynamical system (the equivalent of "Creating and
> running an ODE file" in XPP tutorial)

Most of the scripts in /tests show the different ways that a dynamical
system can be specified.

> - How to compute and plot trajectories. How to acces the data
> (illustrating the concept of Point & Pointsets)

Look at the end of the Points.py module, which is runnable as a
script. The final two functions provide a ton of screen output with
examples for making
and using these classes. The Pointsets page on the wiki explains the
general idea, and then directs users to those examples. If you run
that and have more questions, I'll gladly add more explanation where
necessary.

> - How to change initial conditions ("Changing initial data" in XPP
> tutorial, which basically describes the different options
> inInitialconds menu).

If you have an ODE model 'ode' as an instance of a Generator object or
of a Model object, you'd call

ode.set(ics=new_ics)

where new_ics is a Point or a dictionary representation of the values
for any or all of the variables (partial specifications just update
the existing ICs).

Setting parameters is the same. Just call ode.set(pars=new_pars)

> By the way, does PyDSTool includes a
> functionality similar to Initialconds->Mouse/Mice (which allows to
> specify with the mouse the initial conditions of a planar system)? I
> am just curious.

Sorry, not unless someone writes a graphical interface! Even if I had
time, I have no expertise in doing that. It's command line only.

> - How to find the fixed points of the system and characterize their
> stability. Also for 2D systems, how to get and plot the nullclines.

This is covered in tests/phaseplane_HHtest.py

> - How to plot simple bifurcation diagrams

PyCont definitely needs better documentation, there's no doubt about
that. In the meantime, copy the format of tests/PyCont_PredPrey.py and
PyCont_Brusselator.py, which show simple examples. Any time you want
to continue periodic orbits, AUTO is going to be called. So you'd
better have your external C/Fortran compilation working for that. I am
also willing to answer questions by email once you try to get started
on your own.

These scripts could also definitely do with better commenting and
guidance. Nonetheless, with some effort to look stuff up on the wiki
page PyCont, the meaning of most of the settings are fairly easy to
determine if you have a clue about continuation algorithms.

> etc. I personally prefer a good selection of clear (and commented)
> examples to technical, "reference manual-like" descriptions.

Would it be helpful to literally copy the input and output from some
of the demo scripts (including the testing commands in Points.py, for
instance) onto the wiki so that they can be read there? It would be a
starting point, at least. If I don't get to it first (I'll try, but
don't hold your breath) maybe you would consider compiling a minimal
set of pieces from those scripts that you think would constitute a
good tutorial? I could help you clean it up, add more explanation, and
adapt it for posting on the wiki.

-Rob



More information about the SciPy-User mailing list