<CRANTaskView>

  <name>DifferentialEquations</name>
  <topic>Differential Equations</topic>
  <maintainer email="karline.soetaert@nioz.nl">Karline Soetaert and Thomas Petzoldt</maintainer>
  <version>2015-07-03</version>
  
  <info>
    <p> Differential equations (DE) are mathematical equations that describe how a 
     quantity changes as a function of one or several (independent) variables, often 
     time or space.   
     Differential equations play an important role in biology, chemistry, physics,
     engineering, economy and other disciplines.
    </p>
    <p> Differential equations can be separated into stochastic versus deterministic
     DEs. Problems can be split into initial value problems versus boundary value problems.
     One also distinguishes ordinary differential equations from 
     partial differential equations, differential algebraic equations and delay differential equations.
     All these types of DEs can be solved in R. 
     DE problems can be classified to be either stiff or nonstiff; the former type of problems are 
     much more difficult to solve.
    </p>
    <p>The 
    <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models">dynamic models SIG</a>    
     is a suitable mailing list for discussing the use of R for solving differential equation 
     and other dynamic models such as individual-based or agent-based models.
    </p>
    <p> This task view was created to provide an overview on the topic.
     If we forgot something, or if a new package should be mentioned here, please let
     <a href="mailto:karline.soetaert@nioz.nl,thomas.petzoldt@tu-dresden.de?subject=DifferentialEquations%20Task%20View">us</a> know.
    </p>
    
    <p><strong>Stochastic Differential Equations (SDEs)</strong></p> 
     In a stochastic differential equation, the unknown quantity is a 
     stochastic process. 
     <ul>
       <li> The package <pkg>sde</pkg> provides functions for simulation and inference for 
        stochastic differential equations. It is the accompanying package to 
        the book by Iacus (2008).
       </li>
       <li> The package <pkg>pomp</pkg> contains functions for statistical inference for
        partially observed Markov processes. 
       </li>
       <li> Packages <pkg>adaptivetau</pkg> and <pkg>GillespieSSA</pkg> implement 
        Gillespie's "exact" stochastic simulation algorithm (direct method) 
        and several approximate methods.
       </li> 
     </ul>  
      
    <p><strong>Ordinary Differential Equations (ODEs)</strong></p> 
     In an ODE, the unknown quantity is a function of a single independent variable.
     Several packages offer to solve ODEs.
     <ul>
       <li> The "odesolve" package was the first to solve ordinary differential equations in R.
        It contains two integration methods. It is not actively maintained and has been replaced by the package <pkg>deSolve</pkg>.
       </li>
       <li> The package <pkg>deSolve</pkg> contains several solvers for solving ODEs. 
        It can deal with stiff and nonstiff problems.
       </li>
       <li> The package <pkg>deTestSet</pkg> contains solvers designed for solving 
        very stiff equations.
       </li>
       <li> The package <pkg>odeintr</pkg> generates and compiles C++ ODE solvers on the fly using Rcpp
            and <a href="http://www.boost.org/">Boost</a> <a href="http://www.odeint.com/">odeint</a>.
       </li>
     </ul>        
    <p><strong>Delay Differential Equations (DDEs)</strong></p> 
     In a DDE, the derivative at a certain time is a function of the variable value at a previous time.
     <ul>
       <li> The package <pkg>PBSddesolve</pkg> (originally published as "ddesolve") 
        includes a solver for non-stiff DDE problems.
       </li>
       <li> Functions in the package <pkg>deSolve</pkg> can solve both stiff and non-stiff DDE problems.
       </li> 
     </ul>
    <p><strong>Partial Differential Equations (PDEs)</strong></p> 
      PDEs are differential equations in which the unknown quantity is a 
      function of multiple independent variables. A common classification is 
      into elliptic (time-independent), hyperbolic (time-dependent and wavelike), 
      and parabolic (time-dependent and diffusive) equations. 
      One way to solve them is to rewrite the PDEs as a set of coupled 
      ODEs, and then use an efficient solver. 
      <ul>
       <li> The R-package <pkg>ReacTran</pkg> provides functions for converting the PDEs
        into a set of ODEs. Its main target is in the field of ''reactive transport'' 
        modelling, but it can be used to solve PDEs of the three main types. 
        It provides functions for discretising PDEs on cartesian, polar, 
        cylindrical and spherical grids.
       </li>
       <li> The package <pkg>deSolve</pkg> contains dedicated solvers for 1-D, 2-D and 
        3-D time-varying ODE problems as generated from PDEs (e.g. by <pkg>ReacTran</pkg>).
       </li>
       <li> Solvers for 1-D time varying problems can also be found in the package 
        <pkg>deTestSet</pkg>.
       </li> 
       <li> The package <pkg>rootSolve</pkg> contains optimized solvers for 1-D, 2-D and 
        3-D algebraic problems generated from (time-invariant) PDEs. 
        It can thus be used for solving elliptic equations.
       </li>
      </ul>
      Note that, to date, PDEs in R can only be solved using finite differences. 
      At some point, we hope that finite element and spectral methods will become available.
    <p><strong>Differential Algebraic Equations (DAEs)</strong></p>
      Differential algebraic equations comprise both differential and algebraic terms.
      An important feature of a DAE is its differentiation index; the higher this index, 
      the more difficult to solve the DAE.
      <ul>
       <li> The package <pkg>deSolve</pkg> provides two solvers, that can handle DAEs up to index 3.
       </li>
       <li> Three more DAE solvers are in the package <pkg>deTestSet</pkg>.
       </li>
      </ul>       
    <p><strong>Boundary Value Problems (BVPs)</strong></p> 
      BVPs have solutions and/or derivative conditions specified 
      at the boundaries of the independent variable.
      <ul>
       <li> Package <pkg>bvpSolve</pkg> deals only with this type of equations.
       </li>
       <li> The package <pkg>ReacTran</pkg> can solve BVPs that belong to the 
       class of reactive transport equations.
       </li>
     </ul>
    <p><strong>Other</strong></p>
      <ul>
       <li> The  <pkg>simecol</pkg> package provides an interactive environment to 
        implement and simulate dynamic models. 
        Next to DE models, it also provides functions for grid-oriented, 
        individual-based, and particle diffusion models. 
      </li>
      <li> Package <pkg>scaRabee</pkg>
       offers frameworks for simulation and optimization of Pharmacokinetic-Pharmacodynamic Models.
      </li>
      <li>In the package <pkg>FME</pkg> are functions for inverse modelling (fitting to data), 
       sensitivity analysis, identifiability and Monte Carlo Analysis of DE models.
      </li>
      <li>The packages <pkg>nlmeODE</pkg> and <pkg>PSM</pkg> have functions for 
       mixed-effects modelling using differential equations.
      </li>
      <li> <pkg>mkin</pkg> provides routines for fitting kinetic models with one 
       or more state variables to chemical degradation data.
      </li>
      <li>The package <pkg>CollocInfer</pkg> implements collocation-inference 
       for continuous-time and discrete-time stochastic processes.
      </li>
      <li>Root finding, equilibrium and steady-state analysis of ODEs can be 
       done with the package <pkg>rootSolve</pkg>.
      </li>
      <li> The <pkg>deTestSet</pkg> package contains many test problems for differential equations.
      </li> 
      <li>Package <pkg>pracma</pkg> implements several adaptive Runge-Kutta
        solvers such as ode23, ode23s, ode45, or the Burlisch-Stoer algorithm to obtain
        numerical solutions to ODEs with higher accuracy.</li>
      <li> The <pkg>PBSmodelling</pkg> package adds GUI functions to models. 
      </li>
      <li>Package <pkg>ecolMod</pkg> contains the figures, data sets and examples from a book 
       on ecological modelling (Soetaert and Herman, 2009).
      </li>
      <li><pkg>primer</pkg> is a support package for the book of Stevens (2009).
      </li>
    </ul>
    
  </info>

  <packagelist>
    <pkg priority="core">bvpSolve</pkg>
    <pkg>CollocInfer</pkg>
    <pkg priority="core">deSolve</pkg>
    <pkg>deTestSet</pkg>
    <pkg>ecolMod</pkg>
    <pkg>FME</pkg>
    <pkg>adaptivetau</pkg>
    <pkg>GillespieSSA</pkg>
    <pkg>mkin</pkg>    
    <pkg>nlmeODE</pkg>
    <pkg>odeintr</pkg>
    <pkg>PBSddesolve</pkg>
    <pkg>PBSmodelling</pkg>
    <pkg>pomp</pkg>
    <pkg>pracma</pkg>
    <pkg>primer</pkg>
    <pkg>PSM</pkg>
    <pkg>ReacTran</pkg>
    <pkg priority="core">rootSolve</pkg>
    <pkg>scaRabee</pkg>
    <pkg priority="core">sde</pkg>
    <pkg>simecol</pkg>
  </packagelist>

  <links>
    <view>ChemPhys</view>
    <view>Econometrics</view>
    <view>Environmetrics</view>
    <view>Optimization</view>
    <view>Pharmacokinetics</view>
    <a href="http://en.wikipedia.org/wiki/Differential_equation">Wikipedia: Differential equation</a>
    <a href="http://pomp.r-forge.r-project.org">R-Forge website for package pomp</a>
    <a href="http://deSolve.r-forge.r-project.org">R-Forge website for package deSolve</a>
    <a href="http://www.springer.com/978-0-387-75838-1">Book: Iacus, SM. 2008. Simulation and Inference for Stochastic Differential Equations: with R examples, Springer</a>
    <a href = "http://www.springer.com/life+sciences/ecology/book/978-1-4020-8623-6">
        Book: Soetaert, K. and P.M.J. Herman, 2009. A Practical Guide to Ecological Modelling, using R as a simulation Platform, Springer.</a>
    <a href="http://www.springer.com/life+sci/ecology/book/978-0-387-89881-0">Book: Stevens, H, 2009. A Primer of Ecology with R, Springer.</a> 
    <a href="http://www.springer.com/statistics/computanional+statistics/book/978-3-642-28069-6">Book: Soetaert, K., Cash, J. and Mazzia, F. 2012. Solving Differential Equations in R, Springer.</a>
  </links>
</CRANTaskView>
