Institut für Lebensmittel- und Ressourcenökonomik

Landwirtschaftliche Fakultät

Universität Bonn

You are here: ILRCourse overviewResearch FARMDYN - A dynamic mixed-integer single farm bio-economic model

FARMDYN - a dynamic mixed integer bio-economic farm scale model


FARMDYN provides a flexible, modular template to simulate farms with different branches (dairy, mother cows, beef fattening, pig fattening, piglet production, arable farming, biogas plants). Main characteristics of the model are:

  • Fully dynamic, simulations typically cover several decades, alternatively comparative-static or short run version
  • Integer variables capture Returns-to-scale in investments (machinery, buildings; based on convex combinations over a concave set) and indivisibilities in labour use
  • Selected farm management decisions (e.g. feeding, manure management, labour use) depicted with a sub-annual temporal resolution, partially bi-weekly
  • Deterministic or stochastic programming version. The latter treats all variables as state dependent, allows for sceneario tree reduction and covers different risk measures (value at risk, MOTAD ...)
  • Farm labour, machinery and stable use are modelled in rich detail
  • Arable cropping can be differentiated by system (conventional or organic), tillage type and intensity
  • For dairy farming, the model distinguishes several herds by number of lactations and lactation phase
  • Beef fattening can be depicted in several phases, linked to different grazing options, considering cross-breeding and sexing
  • The machinery park is available in different mechanization levels
  • Detail in grassland management (number of cuts, bales/silo/hay etc.)
  • Highly differentiated modules for nitrogen fate, while covering German legislation on fertilizer use
  • A range of economic, social and environmental indicators, including LCA derived ones


The model is currently parameterized for German conditions using highly detailed farm planning data provided by KTBL in combination with farm structural statistics. It offers a complementary approach to other farm scale models used in the institute such as the farm group models integrated in CAPRI or FADN based farm-scale progamming models which both are comparative-static, calibrated against observed farm programs with Positive Mathematical Programming while being far less detailed with regard to technology, and not comprising explicit investement decisions. FarmDyn can be calibrated against given farm programs using a bi-level programming approach, treating price, crop yields, labour and other inputs demands as uncertain.

The model is realized in GAMS, solved with the industry MIP solver CPLEX, linked to a Graphical User Interface realized in GGIG and hosted on a Software Versioning System. Design of experiments, building on R routines directly called from GAMS, can be used in combination with farm structural statistics to systematic sensitivity analysis by simulating different farm realizations (assets, farm branches) and boundary conditions such as input and output prices or emisisons ceilings using a computing server to solve several instances in parallel. That approach has e.g. been used to estimate a statistical meta model for Marginal Abatement Costs of Green House Gases from dairy farms. Code development and testing follows agreed upon guidelines.

Projects and development:

The application and extension of FARMDYN is part of several ongoing research activities at ILR, in cooperation with international and national partners.

The original model version was developed in the project "The relation between indicators for the crediting of emission rights and abatement costs - a systematic modeling approach for dairy farms", financed by the German Science Foundation and carried out by Karin Holm-Müller, Wolfgang Britz, Bernd Lengers and David Schäfer. In the context of the pdh-thesis of Johanna Budde, a first version of the pig module was developed (2012-2013).

Model documentation:

The detailed model documentation is available as a Website and as printable PDF:

The online Documentation Website

The documentation refers to a stable release of FARMDYN which represents a properly tested and documented version of the model (launched in September 2016, model revision 500):

Britz W., Lengers, B,.Kuhn, T. and Schäfer, D. (2014): A highly detailed template model for dynamic optimization of farms - FARMDYN, University of Bonn, Institute for Food and Resource Economics, Version September 2016, 147 pages.

FARMDYN contains several features that are currently developed (flagged in documentation as prototype) or not used anymore (flagged as deprecated). These features have not been subject to the intensive testing for the stable release. They are only visible in the developer mode of FARMDYN and listed here.

Staff at ILR working on the model:

  • Till Kuhn, work on fertilization, related environmental indicators and regulations such as the German Fertilizer Directive, link to crop growth models
  • David Schäfer, biogas module, improved pig module, link to ABM
  • Christoph Pahmeyer, grassland management, beef fattening
  • Lennart Kokemohr, economic, social and environmental indicators
  • Julia Heinreichs, production systems comparisons such as organic against conventional farming
  • Wolfgang Britz, overall model design, solution algorithm, interface, stochastic programming extension, bi-level programming based calibration
  • Bernd Lengers (2011-2014), main contributor of original model version, GHG indicators
  • Johanna Budde (2012-2013), first version of pig module

Training videos