[vox-tech] ODE solvers in C

Aaron King vox-tech@lists.lugod.org
Wed, 10 Jul 2002 13:04:46 -0700


Matt,

I've had a lot of experience solving ODE, and I have come to prefer 
programming in C or its derivatives by far to programming in FORTRAN.  
Nevertheless, the fact remains that the best, freely-available, ODE solvers 
are all written in FORTRAN.  This has never posed a problem for me, however: 
I simply compile with g77 and link to the driver routine (written in C) with 
gcc.  You may want to think about compiler flags and may have to get ahold of 
the f2c library so you can link against that too.

I would not recommend writing your own ODE solver.  Understanding the way 
your code is working, in general, is a good thing.  Knowing the details of 
the implementation of an adaptive step-size, multiorder ODE solver is 
another.  I would recommend getting started with LSODE, which you can 
download, in FORTRAN, from the netlib site: www.netlib.org.  Then you can 
focus on the science.

Aaron


-- 
======================================================================
Aaron King, Ph.D.                        http://two.ucdavis.edu/~aking
Dept. of Environmental Science & Policy       mailto:aking@ucdavis.edu
University of California                             Tel: 530/752 3026
One Shields Avenue, Davis CA 95616 USA               Fax: 530/752 3350
======================================================================