11.7 Modelling Tools
In aquaponics, flow charts or stock and flow diagrams (SFD) and causal loop diagrams (CLDs) are commonly used to illustrate the functionality of the aquaponic system. In the following, flow chart and CLDs will be described.
11.7.1 Flow Charts
To get a systemic understanding of the aquaponics, flow charts with the most important components of the aquaponics are a good tool to show how material flows in the system. This can help, for example, in finding missing components and unbalanced flows and mainly influencing determinants of the subprocesses. Figure 11.18 shows a simple flow chart in aquaponics. In the flow chart, fish food and water are added to the fish tank, where the feed is taken by the fish for growth, the water is enriched with the fish waste and the nutrient-enriched water is added to the hydroponics system to produce plant biomass. From the flow chart, a CLD shown in Fig. 11.19 can be easily constructed.
Fig. 11.18 Example of a flow chart in aquaponics (only RAS and HP exchange)
Fig. 11.19 Causal loop diagram (CLD) illustrating examples of a reinforcing and a balanced loop within aquaponic systems. The reinforcing loop (R) is one in which an action produces a result which influences more of the same action and consequently resulting in growth or decline, where as a balancing loop (B) attempts to bring things to a desired state and keep them there (e.g. temperature regulation in the house)
11.7.2 Causal Loop Diagrams
Causal loop diagrams (CLDs) are a tool to show the feedback structure of a system (Sterman 2000). These diagrams can create a foundation for understanding complex systems by visualizing the interconnection of different variables within a system. When drawing a CLD, variables are pictured as nodes. These nodes are connected by edges, which form a connection between two variables accordingly. Figure 11.19 shows that such edges can be marked as either positive or negative. This depends on the relation of the variables to one another. When both variables change into the same direction, then one can speak of a positive causal link. A negative causal link thus causes a change in opposite directions. When connecting two nodes from both sides, one creates a closed cycle that can have two characteristics: (1) a reinforcing loop that describes a causal relationship, creating exponential growth or collapse within the loop or (2) a balancing loop in which the causal influences keep the system in an equilibrium. Figure 11.19 shows an example of both types of loops.
Let us illustrate this (Fig. 11.20) for the flow chart of Fig. 11.18.
It is obvious that CLD and SFD are very useful for system understanding, when the model does not require numerical accuracy. If numerical accuracy is required, the process should be studied further with a system dynamic tool diagram (SDTD) and modelled in dynamic system simulation software. For example, the CLD in Fig. 11.20 can be augmented with differential equations to a SDTD (Fig. 11.21).
Fig. 11.20 Example CLD for RAS and HP exchange
From the SDTD, we can now see how the differential equations for the nutrients balance in the tank look like. We know that the nutrient flow out of the fish tank (Msubxfout/sub) must be the water flow (Qsubfout/sub) times the concentration in the out stream (Csubxf/sub):
$M_{xfout} == C_{xf} Q_{fout}$
Assuming a stirred tank gives the nutrient concentration of the fink tank to:
$C_{xf} = M_{xf}/V_f$
The differential equations of the RAS part can be derived to:
$xV_f/dt=Q_{fin}-Q_{fout}$
$dM_{xf}/dt=M_{xfin}-M_{xfout}$,
Fig. 11.21 Example SDTD for RAS and HP exchange
and for the concentration
$dc/dt=(Q_{fin}C_{xfin}-Q_{fout}C_{xf}/V_f)$
11.7.3 Software
In addition to basic computer languages, such as Fortran, C++ and Python, for fast computation and fully user-specific implementation, all kinds of advanced software tools are available. These advanced software tools offer a variety of environments, concepts and options. We can model state variables, differential equations, connections and loops. In addition, we can use the model for simulations, stability analysis, optimization and control.
The main reasons for modelling of a system are to understand and control it. Therefore, the model helps to predict the system dynamics or behaviour. The software applications could allow us to do three consequent tasks: (a) the modelling itself, (b) the simulations of the model(s) and (c) optimization of the model and/or simulation.
Mathematica software is for functional analysis of mathematically described problems (Wolfram 1991). The concept is based on the LISP approach (McCarthy and Levin 1965.), a very effective functional programming language. The syntax is reasonably simple, and this software is popular in mathematics, physics and systems biology. Especially, the Ndsolve module helps to solve ordinary differential equations, plot the solution and find specific values.
Very similar tools for solving ODEs are offered by the Maple. This software is very powerful; between its features belong boundary problems solution, exact solutions and mathematical approximations. Copasi (complex pathway simulator) is a software tool for simulation and analysis of biochemical networks via ordinary differential equations.
SageMath is a free open-source mathematics software system. The software is Python-based and facilitates the simulation of ODE models. Data2Dynamics software is a collection of numerical methods for quantitative dynamic modelling and is a comprehensive model and data description language. The software allows the analysis of noise, calibration and uncertainty predictions and has libraries of biological models.
Probably the best simulation language is Simula (probably not in use anymore) and Simula 67, considered at the beginning as a package for Algol 60. These were the first fully object-oriented languages, introducing classes, inheritance, subclasses, garbage collector and others. In the beginning of the twenty-first century, the creators Ole-Johan Dahl and Kristen Nygaard were awarded the IEEE John von Neumann Medal and the A. M. Turing Award (Dahl and Nygaard 1966).
The idea behind Simula was that objects have life; they start to exist, do their being and cease. The objects are defined as general classes (template code), and each instance of such object has a ’life’ in the simulation. The language was quite difficult to learn. However, it offered the possibility to model processes object by object and run simulation of their lives. The simulation runs on the basis of discrete events, and it is possible to simulate objects in co-routine. More tasks can start, run, detach, resume and complete in overlapping time periods in quasiparallel processes. Today’s hardware allows us modelling and simulation in fully parallel threads. However, many of the Simula concepts were already used for development of other languages, namely, Java, C/C++/C# and persistent objects libraries like DOL (Soukup and Machacek 2014). Current successor of Simula is BETA, extending and featuring the possibilities of inheritance in concepts of nested (sub)classes (with nested local time) and patterns (Madsen et al. 1993).
It is always an option to use any of the object-oriented languages and specific libraries and program all the necessary code for a specific model. On the other hand, already existing graphical programming environments allow to design and link the structure of the modelled system from libraries of objects (signal generator, sum, integrator, etc.), parametrize them and run the simulation in virtual time.
Another popular software for simulation is MathWorks Simulink, describing itself as a model-based design tool. The environment allows to combine and parametrize predefined blocks (from wide range of libraries) and diagrams into subsystems. The programming is done using graphical blocks and their connections into functional parts with feedback loops. The environment is widely used for control, automation and signal processing. Another possibility is to integrate own code from MathWorks Matlab language or use various toolboxes (Jablonsky et al. 2016). One of them, SensSB, is focused on the sensitivity analysis and allows to import other models using the Systems Biology Markup Language. For just the visualization of existing models in Simulink, it is also possible to use the very quick models viewer DiffPlug. PottersWheel supports the modelling of time-dependent dynamic systems, parameter calibration, analysis and prediction. Interesting tool is the experimental design for model verification.
For the modelling and analysis of system dynamics, similar strategy is used by the Stella Architect isee software application, where the model is composed of blocks, which are connected by relations. Stella allows modelling and simulation of very different types of applications, ranging from medical needs through building construction to the airplanes. Stella is sometimes marketed as iThink software. Powersim software was designed originally for economic purposes. However, it developed into more sophisticated tool, including electronic, solar power or drug treatment simulations. The former developer of Powersim is currently producing a similar software for more complex tasks Dynaplan Smia. Vensim is a system for modelling big data relationships of real systems. The power of Vensim is that it allows causal tracking, sensitivity analysis, calibration and intensive simulation. However, the software is also capable of dealing with wide range of simple and complex real systems (Hassan et al. 2016). True-World system dynamics software facilitates complex multibody dynamic simulations in discrete and continuous time. The modelling basically starts from balances.
Completely different approaches to modelling and simulation are cellular automata or agent-based modelling approaches, popularized by Stephen Wolfram (Wolfram 1991) as a new kind of science. The approach is sometimes also called the game of life. The modelling is implemented via interactions of autonomous individuals (Macal and North 2005). The simulations show emergent behaviour and therefore are very popular in systems biology for population dynamics. A simple tool for basic (and advanced, as well) agent-based modelling and simulation is the NetLogo software, where simple descriptions and parametrization create powerful models. The software allows visualization of the time development and noise induction (Stys et al. 2015). The application is written in Java, which sometimes limits the available memory. Probably the biggest effort in the multi-agent modelling was done by development of Wolfram software, which is the continuation of popular Mathematica, with extended tools for modelling and simulation. It has put Simulink-like modelling in a more attractive suit and also creates possibilities of agent-based modelling and much more tools for other mathematical disciplines (multivariate statistics, data mining, global optimization).
AnyLogic is very interesting software for problems of flow — information, money, traffic, logistic and mining. The simulation solves the problem of optimal flow in the designed system with minimal effort and maximal efficiency. The used concepts are system dynamics and agent-based and discrete-event modelling. It also offers hybrids between different modelling concepts. The software is useful, for example, in the epidemic spread simulations (Emrich et al. 2007).
Another agent-based modelling tool is Insight Maker, for simulation of population interacting in geographic or network space. The software supports graphical model construction, usage of multiple paradigms, embedded scripting and optimization toolset (Fortmann-Roe 2014).
For the modelling itself, description of the state variables, solution of the ODEs, parametrization and time dependency analysis, the first group of software, from Mathematica to Matlab, could be used without hesitation. They represent powerful tools for the modelling purposes. In case of more complex analysis, such as related to big data, simulation, noise induction, optimization, sensitivity and stochastics, more advanced tools are required, with object-oriented approach, involving also higher induction in the programming languages syntax.