C files that can be used with CVODE are created by the command
The files created are [name]_cv.c and [name]_cv_proto.h, where [name] is the name of the vector field given in the vector field file. The C file [name]_cv.c will contain the functions [name]_vf and [name]_jac.
If the option func=yes is given,
a function is created (in the file [name]_cv.c) that computes the user-defined functions.
The name of the
function is [name]_func. The function and its arguments
are configured to be used with CVODE's rootfinding capability.
If the option demo=yes is given,
the file [name]_solve.c will contain 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.
Code is generated for several versions of CVODE.
The CVODE version is given with the version option.
The supported version are
version=2.3.0, version=2.4.0, version=2.5.0,
version=2.6.0 or version=2.7.0. The default is 2.7.0.
Note: This is the CVODE version, not the SUNDIALS
version. This table shows how they are related.
In an operating system with the POSIX development tools, and where SUNDIALS is installed in /usr/local, the demonstation program is compiled with the make command:
After using these files to create the executable pendulum_cvdemo, we can define the initial conditions, parameter values, and some solver parameters on the command line. For example,
(Other command line options include the parameters g, L, m, the relative error relerr, and the absolute error, abserr.)
This command generates the file pend.dat. Here is a plot of the data: