Model calibration demo

Lake Phytoplankton Model Definition

Driving forces initial values

\[Q_{in}(t) = 5.0 + \sin\left(\frac{2\pi t}{100}\right)\]
\[C_{HPO4,in}(t) = 0.04\]

Rights hand side of the ODE model

\[growth_{ALG} = k_{gro,ALG} \cdot \frac{C_{HPO4}}{K_{HPO4} + C_{HPO4}} \cdot C_{ALG}\]
\[\frac{dC_{HPO4}}{dt} = \frac{Q_{in} \cdot 86400}{h_{epi} \cdot A} \cdot (C_{HPO4,in} - C_{HPO4}) - \alpha_{P,ALG} \cdot growth_{ALG}\]
\[\frac{dC_{ALG}}{dt} = -\frac{Q_{in} \cdot 86400}{h_{epi} \cdot A} \cdot C_{ALG} + growth_{ALG} - k_{death,ALG} \cdot C_{ALG}\]

Manual Calibration

Set parameters:

How far away are we from the data?

Automatic calibration

We try to find the best fitting parameters automatically. The calibration minimizes a weighted sum of the two squared-error terms:

\[L_{HPO4}(p) = \sum_i (C_{HPO4,model}(t_i, p) - C_{HPO4,data}(t_i))^2\]
\[L_{ALG}(p) = \sum_i (C_{ALG,model}(t_i, p) - C_{ALG,data}(t_i))^2\]
\[L_{total}(p) = w_{HPO4} \cdot L_{HPO4}(p) + w_{ALG} \cdot L_{ALG}(p)\]

First we need to set some initial values:

\[p_{init} = (k_{gro,ALG}=0.3,\ k_{death,ALG}=0.1,\ K_{HPO4}=0.002,\ \alpha_{P,ALG}=0.003,\ A=5\cdot10^6,\ h_{epi}=5)\]

Calibration has not run yet.