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

Scilab

From the Scilab web page: "Scilab is a scientific software package for numerical computations providing a powerful open computing environment for engineering and scientific applications."

The VFGEN Scilab Command

A set of Scilab files are created by the command

$ vfgen scilab vector_field_file.vf

This command creates the file [name].sci, where [name] is the name given in the vector field file. The following table shows the Scilab functions created by VFGEN when used in the Scilab command. N is the dimension of the system specified in the vector field file, t is time (a scalar), x is the N dimensional state vector, and p is the parameter vector.

Scilab Function Description
vf = [name]_vf(t,x,p) The vector field function. This returns an Nx1 column vector.
jac = [name]_jac(t,x,p) The Jacobian function. This returns an NxN matrix.
r = [name]_[userfunc](t,x,p) Each user function specified in the vector field file results in its own Scilab function. The return value is a scalar.
These functions are only created if the option func=yes is given in the command line.

Options

parstyle The method by which parameters are passed to the Scilab functions generated by VFGEN is controlled by the parstyle option. The default is parstyle=vector, and the alternative parameter style is specifed with the option parstyle=list. When parstyle=list is given as
$ vfgen scilab:parstyle=list vector_field_file.vf
each parameter is listed explicitly as an argument of Scilab functions. That is, instead of [name]_vf(t,x,p), the vector field function will be [name]_vf(t,x,param1,param2,...,paramM).
Default: parstyle=vector
func If the option func=yes is given, a Scilab function will be created for each user-defined function.
Default: func=no
demo If the option demo=yes is given, a second file is created called [name]_demo.sce. This is a script that when run provides a simple GUI interface to the initial conditions, system parameters, and the ODE solver parameters. It will call the odeint function and plot the solution. Run the script in Scilab with the command
-->exec [name]_demo.sce;

Default: demo=no

Example

Here is a sample vector field file: pendulum.vf.
The files created by
$ vfgen scilab:func=yes,demo=yes pendulum.vf

are
  • pendulum.sci
  • pendulum_demo.sce
To run the demonstration program, enter the command
-->exec pendulum_demo.sce;
in Scilab. For example, this plot was created by pendulum_demo.sce:
Here is a screenshot of pendulum_demo.sce in action.
Copyright © 2005-2007 Warren Weckesser