generateSolver example application
This example application takes a CellML model and generates a FORTRAN program which, when compiled, will integrate the ordinary differential equations given in the model. The generated code is designed for use with the RADAU integrator, but could be modified to work with other integrators.
The RADAU integrator code is freely available. For more information about the integrator see Hairer and Wanner (1996): Solving Ordinary Differential Equations. Stiff and Differential-Algebraic Problems. 2nd edition. Springer Series in Comput. Math., vol. 14.
Currently this example is only available from the SourceForge CVS, and you will also need to have checked out and built the CellML C++ API code. If you build the API library in the default place, then the Makefile in the samples/generateSolver should work with a make for the debug version or make OPT= for the optimised version.
Once you have built the application, you can run it with: generateSolver <CellML file> <FORTRAN file>. The generated FORTRAN file then needs to be compiled and linked against the RADAU code and its supporting routines (radau.f, decsol.f, and dc_decsol.f). This will give you an executable which will integrate the ODEs for the time interval you have specified.
The generated code includes the setting of some of the integrator parameters that I have found necessary for the solution of the models I have tried it with, and you will be prompted for the most common ones that might change between models and simulations. You might find, however, that you need to tweak the parameters a bit for your specific models. The RADAU code has useful information about the parameters and gives their default values.
This example application is fairly specific for the cellular electrophysiology models that I use, hence the prompting for electrical stimulii, but it could be used for any set of ODEs specified in CellML.