Building environmentally friendly models

This is a guest post by Clemens Dempers, CEO Polar Analytics Oy, and Jan Hendrik Roodt, of Otago Polytechnic and Director at Polar Analytics Oy.

Note: No animals have been harmed during these simulations.


Even though environmental modeling might be considered a niche application and your business may not involve anything remotely related to farming or agriculture, we believe our modeling approach is useful in demonstrating how an interactive simulation model can be used to improve collaboration and decision making.

A good place to start is with the question: “Why build a dynamic simulation model?” There could be any number of reasons, including:

  • To create an accurate operational model of a business process (a so-called digital twin)
  • For strategic decision support – where should we build a warehouse? What safety stock do we need, etc.
  • To build understanding and encourage dialog between subject experts
  • To change behaviour - engage stakeholders with an interactive and easy to understand model

In our opinion, the value of modeling, and particularly of dynamic simulation, is to improve decision-making. It should give decision-makers a virtual environment to explore solutions and options.

A common objection to modeling we often encounter is: “We do not have all the data”, or “It will take a long time to gather the data”. As such, we advocate an Agile model-building approach. This approach uncovers the quantity and specifics of the data during the modeling process, and we often find that the data we could readily access for a project was sufficient for us to proceed.

Let’s examine one such model, where we used high-level aggregate data and focused on the interactions between different processes.

The Farm Model

The Farm Model

We originally developed this diversified farm model as an interactive aid for agricultural exposition events to attract visitors and to stimulate discussion around sustainability in the milk production farming segment.

Model Description

We simulate a dairy farm that has between 150 and 450 animals housed in a shed. They need water and food. The water is sourced from the farm through rainfall and storage in a reservoir. The reservoir can range from a small dam to a river - providing an unlimited water supply. The farm produces crops for the cows and, if needed, the farmer can supplement with extra feed. The milk is sold into the market at a fixed price for a year.

The model is used to explore the diversification benefits made possible by a biodigester. The biodigester takes the animal digestive waste and dairy milk shed effluent and processes these into nutrient-rich water that can be used for crop fertilization and for starting an aquaculture project on the farm. The natural heat from the bioreactor can be used to provide the ideal temperature for the fish. There are 2 species, one that has a high commercial value and can be sold to generate cash, and one that can be used as animal feed.

Methane captured during the process is used as an energy source to generate electricity. The electricity is used for powering farming operations and any excess electricity can be sold back to the grid.

Farm model screenshot.

Farm model screenshot

Exploring the model

We can start running the model with default settings to get a base income for a year for a ‘standard’ dairy farm. The model will run for 365 days and then pause. The next step is to explore what happens if there is a biodigester on the farm, now run the model for another year by clicking the bottom left run-icon.

Each time the model is re-run you can see a summary and graph of the previous run and the parameter settings, allowing you to easily compare configuration scenarios.

Farm model run history.

Farm model run history
Carbon footprint

The interesting thing to notice is that the net income on the farm nearly doubled after introducing the bioreactor, while the greenhouse gas emissions decreased drastically (reflecting both CO2 and NO2 emissions).

It should also be noted that the model does not (yet) take the construction and operating costs of the reactor into account, mainly because of the diverse range of reactor designs available these days. It is possible to add a ‘calculation sheet’ interface for a scalable general design and this may be incorporated in future versions of the model.

The water and feed availability are displayed on the main model screen as the model runs.

Farm model water and feed availability.

Farm model water and feed availability

Any period during which the water or feed is insufficient is highlighted with red. Using this visual guide, you can decide how many animals can be supported with the available food and water resources.

Are you ready to try your hand at farming? We encourage you to explore the model that is hosted on the AnyLogic Cloud here.

Change the options and explore:

  • How does the water supply affect the number of cows you can keep?
  • What happens if you magically switch the bioreactor on (or off!) while the model is running?
  • What happens when you increase the quality of the crops used for feed?
  • What is the contribution of sales of electricity to the grid to your income?

How we built the model

We wanted to capture the feedback mechanisms on a typical milk farm and then let the user explore the impact on their annual profit by varying different parameters.

Our aim was to model the process as simply as possible while incorporating feedback between the different farm activities. It was crucial to use parameters that the farmers could recognise and that the settings delivered outcomes that farmers could believe.

Since we are looking at aggregate values, Systems Dynamics was the obvious choice for this model. We have however also used Agent-Based Modelling (ABM) for other models examining overgrazing and nutrient loading. It is for this exact reason we chose AnyLogic as the modeling tool – its flexibility supports the modeling paradigm-mix and level of abstraction needed for our models.

In our opinion, the ability of System Dynamics to build realistic models with only a hand-waving data specification makes it very useful. Though we did use national and international databases to ensure our system has believable behaviour.

Milk production action chart

We used one of the now hidden features of AnyLogic, an action chart, to visually define milk production. This simply states that if a cow has enough water and food, it will, on average, produce 1.47 kilogram of milk solids per day. Every animal also eats and drinks a certain quantity per day, and therefore the number of cows you can support on a paddock is limited.

We make the unrealistic assumption that the cows will stop producing milk when food and water are constrained below a certain level and that once available again, milk production resumes as if nothing happened. While it does not quite play out like this in real life it is good enough as a first approximation. The farmer will sell some animals if their resources are insufficient, but our model does also allow food supplementation.

System Dynamics diagram
(Click to enlarge)

The diagram to the right shows our System Dynamics engine that drives the model. The stocks and flows are visually divided into components for Milk production, the Biodigester, Energy Production, Crops, Aquaculture, Profit, and Greenhouse gas production (GHG). The purple lines indicate a dependency on the number of cattle, and the green lines indicate the model elements affected by activating the bioreactor.

Just in case you were wondering: Models in the AnyLogic cloud can be set up to run parameter variation or Monte Carlo experiments. If you have a desktop version of AnyLogic, you can run optimization experiments via the built-in OptQuest Engine, so you can find the number of cows needed to maximize your profit within given resource constraints. For a client, we would utilise these experiments and optimizers. In this case, we designed our model to be more interactive, allowing you to run multiple years within the same simulation execution and to allow the manual tweaking of parameters. In this way, you can interact with the model and develop an intuitive understanding of the processes on the farm. Consequently, you will make more informed and better decisions regarding the running of the farm business. Lastly, a further benefit of the model working interactively is that it becomes easy to communicate problems and solutions.

As you can see, simulation is a key tool for understanding a system and communicating how they work.



Our Other Environmental Models

Circular Economy Model

Circular Economy Model cloud simulation model

The Circular Economy concept model was developed to form the focal point of a discussion between stakeholders in a regional development project. A rural area depends on local industries that can cause water pollution and attracts tourists who are keen to enjoy recreational water activities. They contribute revenue to the town but also produce waste that ends up in landfill. The dynamics of a bio hub are visually explored. Also, read the paper


Reverse Supply Chain with Bioreactor

Reverse Supply Chain with Bioreactor cloud simulation model

This model is based on a project we did with Häme University of Applied Sciences (HAMK). Waste is collected from different types of farms and industries and transported to a central location where a Bioreactor extracts and converts commercially valuable material. The locations and type of waste source can be changed via an input file and used to determine how many waste sources are needed to operate a commercially viable plant. Also, read the paper.


Land use and Grazing management

Land use and Grazing management cloud simulation model

As animals graze in a paddock, they deplete the grass and deposit waste on the land. Depending on the topography, this waste can diffuse into a nearby river and increase pollution levels. The animals are modeled as agents going through different behaviours throughout the day. This model uses pedestrian dynamics for the movement of animals to and from the paddock and agent behaviour once they enter the paddock.

At Polar Analytics we develop models that help understand complex phenomena. Our models promote constructive dialogue around issues with many stakeholders and help our customers explore new concepts when solution-finding.

AnyLogic allows us to work with the three main modeling approaches in a way that lets us freely mix and match as required so that we can best suit a model to the problem space. Most importantly, with this modeling flexibility, we can create models that reflect the experiences and expectations of the client while maintaining scientific transparency and robust research approaches.


Verwandte Posts