C files that can be used with the GNU Scientific Library ODE suite are created by the command
The files created are [name]_gvf.c and [name]_proto.h, where [name] is the name of the vector field given in the vector field file. The C file [name]_gvf.c will contain the functions [name]_vf, [name]_jac, and [name]_jacp with their arguments configured for the GSL ODEIV suite.
func |
If the option func=yes is given,
VFGEN also converts any user-defined functions in the vector field file
into functions in the C 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 files [name]_solve.c
and Makefile-[name]
will be created. The C file
contains the main routine for
a command-line ODE solver for the vector field.
Initial conditions, vector field parameter values, and ODE solver
parameter values can be given as arguments to the demo program.
The output of the program includes the time, the solution, and,
if the func=yes option was also given, the values of the
user-defined functions at each point.
The file Makefile-[name] may be used with the make command to compile the demonstration program. This file may require further editing before it will work successfully. Default: demo=no |
Here is a sample vector field file: pendulum.vf.
The files created by
In an operating system with the POSIX development tools, the demonstration program is compiled with the make command:
We run the resulting solver as follows:
(Other command line options include the parameters g, L, m, and the relative error relerr.)
This command generates the file pendulum.dat. Here is a plot of the data: