Homepage of Technische Universität Dresden

Personal tools
Home » Members » thomas.petzoldt's Home » Tutorials, Tools, Downloads
Sections

Tutorials, Tools, Downloads


Most downloads and examples below use the R software and you may ask why. R is known as a system for statistical data analysis and graphics, but R is more. It is an efficient matrix-based programming language that can be used as a general tool for data analysis, simulation and visualization.

Several years we were working with different systems and languages like Fortran, Basic, Pascal, Delphi, JAVA, C/C++, Spreadsheets, Simulation Dynamics tools and even other matrix oriented environments. Now we do most (but not all) things in R and some time critical parts in C. This has nothing to do with any kind of "fundamentalism", it naturally developed because of R's efficiency: it is fast enough, has packages for "almost everything", can read and write data bases, produces good graphics, has documentation facilities (esp. Sweave) and has a community that agreed to use publications for getting scientific credit. We use, of course, other software tools too, but only with R we reached a level where we felt that it was worth to make our tools publicly available.

Differential Equation Solvers

  • Package deSolve (Soetaert, Petzoldt, Setzer) is the main workhorse for solving initial value problems of differential equations.
  • It contains:
    • state of the art solvers for ODE, DAE, DDE and PDE-Models from ODEPACK (lsoda, lsode, daspk, vode, ...)
    • explicit Runge-Kutta solvers (euler, rk4, ode23, ode45, rk78f, ...) and
    • implicit Runge-Kutta (RADAU II A).
    • Functions ode.1D, ode.2D and ode.3D  for solving 1, 2 and 3 dimensional problems.
    • Most solvers support events and/or delays.
    • The model equations can be writtern in pure R or in compiled languages (C, Fortran) to circumvent speed limitations of R. If a model can be written in matrix notation, R is usually fast enough.
  • deSolve website: http://desolve.r-forge.r-project.org (with a overview over related documents and publications)
  • Main publication: http://www.jstatsoft.org/v33/i09 (Soetaert, Petzoldt, Setzer)
  • Download: http://cran.r-project.org/package=deSolve
  • Books that use deSolve: Soetaert & Hermann (2008), Ellner & Guckenheimer (2006), Stevens (2009)
  • Talks given at the useR!2009 conference in Rennes, France:
    • Karline Soetaert: Mathematical modelling of the environment - are there enough data? [slides]
    • Thomas Petzoldt: Dynamic simulation models - is R powerful enough? [slides]
==> More differential equation solvers (e.g. for boundary value problems) and related R packages (e.g. reactive transport equations) can be found on the homepage of Karline Soetaert.


Packages for Analysis of the Model Output and Confronting Models with Data


Packages for Object Oriented Implementation of Dynamic Models

In contrast to other object oriented (OOP) approaches that implement an object oriented model of the original system, simecol implements an "object model of models". Here the main parts of a model are the equations, parameters, time steps and a solver function. This structure is rather close to a mathematical notation, so it is easy to re-implement existing models from the literature or to share own models with colleagues. This approach is rather general and can be used for differential equations as well as individual-based and other approaches, not only in ecology but also for social sciences, economy or engineering. The advantage is that an object encapsulates everything needed, so that you can easily compare models with different data or equations within the same session.

  • R package proto  (Grothendieck and Petzoldt) 
The package "simecol" uses the standard S4 class system of R, in order to be "mainstream compatible". In contrast to this "proto" implements an own prototype-based (i.e. classless) object orientation. It shows that R is also suitable as playground for exploring (and using) different object oriented systems.


Specific packages for Aquatic Sciences

  • Package marelac (Soetaert, Petzoldt, Meysman) contains: (1) chemical and physical constants and datasets, e.g. atomic weights, gas constants, the earths bathymetry; (2) conversion factors (e.g. gram to mol to liter, barometric units, temperature, salinity); (3) physical functions, e.g. to estimate concentrations of conservative substances, gas transfer and diffusion coefficients, the Coriolis force and gravity; (4) thermophysical properties of the seawater, as from the UNESCO polynomial or from the more recent derivation based on a Gibbs function.
  • R package cardidates (Rolinski, Sachse, Petzoldt) can be used for peak-fitting and determination of "cardinal dates" in phytoplankton time series)
    • Publication (of the methods): Rolinski, S., Horn, H., Petzoldt, T., & Paul, L. (2007): Identification of cardinal dates in phytoplankton time series to enable the analysis of long-term trends. Oecologia 153, 997 - 1008.
    • Project website: http://cardidates.r-forge.r-project.org/ 
    • More information: cardidates tutorial


Other Tutorials and Examples about Modeling and Statistics with R



Last modified: 15.11.2011 10:34
Author: Thomas Petzoldt

Contact

Thomas Petzoldt
Tel.: +49 351 463-34954
Fax: +49 351 463-37108
email iconthomas.petzoldt@
tu-dresden.de


Visiting address:
TU Dresden
Drudebau room 72a
Zellescher Weg 40
01217 Dresden


Mail address:
TU Dresden
01062 Dresden

Parcels:
TU Dresden
Helmholtzstraße 10
01069 Dresden