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

XPP

According to the XPP web page, "XPP is a tool for solving differential equations, difference equations, delay equations, functional equations, boundary value problems, and stochastic equations."

The VFGEN XPP Command

An XPP ODE file is created by the command

$ vfgen xpp vector_field_file.vf

The name of the file created by this command is [name].ode, where [name] is the name of the vector field given in the vector field file.

The following table shows how the vector field file format is translated to the XPP ODE format.

VFGEN ElementXPP ODE FileNotes
Constantnumber=value 
Parameterpar=value Warning: VFGEN does not (yet) check if the exclamation point (!) should be used to indicate that the parameter is a derived parameter.
Expressionname=formula name is the VFGEN Name of the Expression
StateVariable name'=formula
init name=value
name(0)=formula
name is the VFGEN Name of the StateVariable.
The formula for name'=formula is taken from the StateVariable's Formula attribute.
The value for the initial value in init name=value is taken from the StateVariable's DefaultInitialCondition attribute.
The formula in name(0)=formula is taken from the StateVariable's DefaultHistory attribute.
Functionaux=formula 

Options

extra The option extra=text allows the user to customize the ODE file with additional lines. The characters in text will be written to the end of the ODE file. Any semi-colons in text are converted to newlines. For example extra="@ total=100;@ maxstor=10000" will add the lines
@ total=100
@ maxstor=10000
to the ODE file. (A final semi-colon in text is optional.)
Warning: Currently, text must not contain any commas! (This should be fixed in a future version of VFGEN.)

The XPP command (like all the commands) is a work-in-progress. Here are some known problems that may be fixed in future versions of VFGEN:

  • As noted in the table above, VFGEN does not check if a parameter is actually a derived parameter that is defined in terms of other parameters. This requires a different output format.
  • Also noted above, the text in the extra=text option must not contain any commas.

Example 1

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

$ vfgen xpp pendulum.vf

is pendulum.ode. Below is a screenshot of XPPAUT (version 5.96) running with this ODE file. The parameters were g=9.81, b=0.5, L=1.0 and m=1.0.




Example 2

The Mackey-Glass equation is the differential delay equation

x'(t) = -b*x + a*x(t-τ)/(1+x(t-τ)10)

A vector field file for this equation is MackeyGlass.vf.

We create an ODE file for XPP with the command

$ vfgen xpp:extra="@ total=500;@ delay=20;@ maxstor=15000;@ xlo=0;@ xhi=500;@ ylo=0;@ yhi=1.5;" MackeyGlass.vf
(Your web browser may wrap the text, but the above command should be one continuous line when you enter it on the command line.) The file generated is MackeyGlass.ode.

We run XPP with the command

$ xppaut MackeyGlass.ode

Then run the simulation by selecting Initialconds followed by (O)ld. (Press I then O in the main menu.)

The following screenshot shows the result.

Copyright © 2005-2007 Warren Weckesser