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

PyGSL

PyGSL is a Python interface to the GNU Scientific Library.

PyGSL version 0.9.5 was used for the development of the pygsl command in VFGEN 2.5.0.

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 vectorfield, jacobian, and, if the func=yes option is given, a function for each Function defined in the vector field file, with the same name as the 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.
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

Example

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

$ vfgen pygsl:func=yes,demo=yes 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-2014 Warren Weckesser