VFGEN
  • Home
  • Download
  • Support & FAQ
  • User's Guide
  • §   Vector Field File
  • §   ADOL-C
  • §   AUTO
  • §   Check
  • §   CVODE
  • §   DDE23
  • §   DDE-BIFTOOL
  • §   DDE_SOLVER
  • §   Delay2ODE
  • §   DSTool
  • §   EVF
  • §   GSL
  • §   Help
  • §   LaTeX
  • §   MATCONT
  • §   MATLAB
  • §   Octave
  • §   PyDSTool
  • §   PyGSL
  • §   RADAU5
  • §   Scilab
  • §   SciPy
  • §   Taylor
  • §   XPP

PyGSL

PyGSL is a Python interface to the GNU Scientific Library.

The VFGEN PyGSL Command

Python files that can be used with the PyGSL ODEIV suite are created by the command

$ vfgen pygsl vector_field_file.vf

The files created are [name].py and, if the option demo=yes option is given, [name]_demo.py, where [name] is the name of the vector field given in the vector field file. The Python file [name].py will contain the function [name]_vf, name_jac, and, if the func=yes option is given, a function called [name]_[function] for each user-defined function.

Options

func If the option func=yes is given, VFGEN also converts any user-defined functions in the vector field file into functions in the Python file. The names of the functions will be the same as those given in the vector field file, with the name of the vector field prepended.
Default: func=no
demo If the option demo=yes is given, the file [name]_demo.py will contain a Python script for a command-line ODE solver for the vector field. The initial conditions and parameters can be specified on the command line. The program will print the solution data to the console. This output can be redirected to a file, and plotted with a program such as Gnuplot.
Default: demo=no
num The num option determines which numerical library is used, either Numeric or numpy. Use num=numeric to use the Numeric library.
Default: num=numpy

Example

Here is a sample vector field file: pendulum.vf.
The files created by

$ vfgen pygsl:func=yes,demo=yes,num=numeric pendulum.vf

are pendulum.py and pendulum_demo.py.

The command

$ python pendulum_demo.py b=0.5 abserr=1e-10 relerr=1e-8 > pend.dat
creates the data file pend.dat. Here is a plot of this data:

Copyright © 2005-2007 Warren Weckesser