From the Octave web page: "GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab."
An Octave file is created by the command
This command creates the file [name].m, where [name] is the name given in the vector field file. The following table shows the Octave functions created by VFGEN octave 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.
|vf = [name]_vf(x,t)||The vector field function. This returns an Nx1 column vector.|
|jac = [name]_jac(x,t)||The Jacobian function. This returns an NxN matrix.|
|r = [name]_[userfunc](x,t,p)||Each user function specified in the vector field file
results in its own Octave function.
The return value is a scalar.
(Note that these function take the parameters as the vector
argument p. They do not use the global variable
These functions are only created if the option func=yes is given in the command line.
The lsode function does not provide a method for passing parameters to the vector field and Jacobian functions. To allow for parameters to be available to these functions, the VFGEN code uses a global variable. The name of the variable is [name]_parameters. It is a vector that holds the parameters in the order in which they were defined in the vector field file.
Before using the lsode function, your script must assign the parameter values to this global vector. For example, if the vector field named mysystem has the parameters a, b, and epsilon (defined in that order), your script should have code like this
global mysystem_parameters; mysystem_parameters(1) = a; mysystem_parameters(2) = b; mysystem_parameters(3) = epsilon;before using the functions defined in Octave file created by VFGEN.
If the option func=yes is given, an Octave function will be created
for each user-defined function.
If the option demo=yes is given, a second file is created called
[name]_demo.m. It will call the lsode function and plot the solution.
It uses the default initial conditions and parameters values defined in
the vector field file.
Run the script in Octave with the command