Rob J. de Boer 

Home  Research  Publications  Books  Software  CV  
grind.R
Phase plane analysis is a powerful approach for analyzing mathematical models comprised of a few ordinary differential equations (ODEs). Grind.R is an Rscript allowing one to easily study such models by numerical integration, phase plane analysis, finding and following steady states, and fitting to data. Grind.R is a wrapper around Rlibraries developed by Karline Soetaert and colleagues. Grind.R is easy to use because it defines just a few basic functions:
 run() integrates a model numerically and provides a time plot or a trajectory in the phase plane,
 plane() draws nullclines and can provide a vector field or phase portrait,
 newton() finds steady states (using the NewtonRaphson method) and can provide the Jacobian with its eigenvalues and eigenvectors.
 continue() continues a steady state along a parameter, thus providing a bifurcation diagram.
 fit() fits an ODE model to data by estimating its parameters, and depicts the result in a timeplot.
The run() function calls ode() from the deSolve Rpackage, the fit() function calls modFit from FME, and newton() and continue() call steady() from the rootSolve package (these 3 packages have to be installed). The grind.R functions have several options with wellchosen defaults (also for the state (s) and parameters (p) of the system), such that they are typically wellbehaved when no options are provided. Using Shiny in R one can easily create webpages for analyzing particular models using sliders for changing parameters (see a LotkaVolterra example).
We use grind.R in our courses for biology students at Utrecht University because it allows them to easily analyze mathematical models, see their dynamical behavior on the screen, and export high quality graphics for reports. Researchers may also like grind.R because it allows them to easily define and study simple ODE models, add ifthenelse statements, noise and events, and perform nonlinear parameter estimation while fitting several data sets simultaneously having unique and shared parameters (using the state of the art environment FME).
A tutorial, the grind.R script, and a number of examples can be downloaded from this directory.
Grind.R is basically an Rversion of an earlier Cprogram called GRIND. The installation instructions of GRIND are still available on this web page for diehards. See this page for a translation of GRIND commands into grind.R.