Applying Optimal Control to Fishing
Optimal control theory is a field of control theory that focuses on identifying the best way to control a dynamic system within a given time frame to achieve an optimized objective function while accounting for any constraints or limitations on the system. As we can see from this definition, an optimal control problem has three components:
- Mathematical description of the system to be controlled
- Specification of a performance criterion (cost function)
- Specification of constraints (i.e. initial & boundary conditions)
In this text, we will not examine the existince of admissible controls, we will just assume that admissible controls are exists for problems.
Lotka-Volterra Equations
Lotka-Volterra equations are a pair of first-order nonlinear differential equations, used to describe the dynamics of two biologicals species’ interaction, one as a predator and the other as prey:
\[ \begin{align} \frac{dx}{dt} &= \alpha x - \beta xy \\ \frac{dy}{dt} &= -\gamma y + \delta xy \end{align} \]
where:
- \(x\) is the population density of prey;
- \(y\) is the population density of predator;
- \(t\) is the time;
- \(\alpha\) and \(\beta\) describes prey’s growth rate and effect of the presence of predators on prey’s growth rate, respectively.
- \(\gamma\) and \(\delta\) describes predators’s death rate and effect of the presence of prey on predator’s growth rate, respectively.
In our example, we will let \(\alpha=\beta=\gamma=\delta=1\).
Let’s simulate the system with following parameters:
\(t_0=0, t_f=12\)
\(x(0)=0.5, y(0)=0.7\)
import numpy as np
from scipy.integrate import odeint
= 0
t0 = 12
tf = [0.5, 0.7]
X0
def lotka_volterra(X, t):
= X
x, y = x - x * y
dx = - y + x * y
dy return [dx, dy]
= np.linspace(t0, tf, 100)
t = odeint(lotka_volterra, X0, t)
sol
import matplotlib.pyplot as plt
'classic')
plt.style.use(0], 'b', label='Prey')
plt.plot(t, sol[:, 1], 'g', label='Predator')
plt.plot(t, sol[:, ='best')
plt.legend(loc't')
plt.xlabel(
plt.grid()"prey_predator_uncontrolled.png")
plt.savefig( plt.show()
Result:
As we can see from graph, prey and predator population density values oscillates between 0.45 and 1.88.
Lotka-Volterra Fishing Problem
We can define mixed-integer optimal control problem in Mayer form as follows:
\[ \min x_2(t_f) \]
subject to
\[ \begin{align} \frac{dx_0}{dt} &= x_0 - x_0x_1 - c_0x_0 w \\ \frac{dx_1}{dt} &= -x_1 + x_0x_1 - c_1x_1 w \\ \frac{dx_2}{dt} &= (x_0-1)^2 + (x_1-1)^2 \end{align} \]
where \(x(0)=(0.5,0.7,0)^T\) and \(w(t)\in\{0,1\}\). The third state \(x_2\) is used to transform the objective into the Mayer formulation. The decision, whether the fishing fleet is actually fishing at time \(t\) is denoted by \(w(t)\).
from gekko import GEKKO
= GEKKO(remote=False)
m = ['minlp_gap_tol 0.001',\
m.solver_options 'minlp_max_iter_with_int_sol 100',\
'minlp_branch_method 1',\
'minlp_integer_tol 0.001',\
'minlp_integer_leaves 0',\
'minlp_maximum_iterations 200']
= np.linspace(t0, tf, 100)
m.time = m.Var(value=0.5,lb=0)
x0 = m.Var(value=0.7,lb=0)
x1 = m.Var(value=0.0,lb=0)
x2 = m.MV(value=0,lb=0,ub=1,integer=True)
w = 1
w.STATUS = m.Param(np.zeros(100))
last -1] = 1
last.value[*x2)
m.Minimize(last
== x0 - x0*x1 - 0.4*x0*w,\
m.Equations([x0.dt() == - x1 + x0*x1 - 0.2*x1*w,\
x1.dt() == m.integral((x0-1)**2 + (x1-1)**2)])
x2
= 6
m.options.IMODE = 3
m.options.NODES = 1
m.options.SOLVER = 0
m.options.MV_TYPE
m.solve()
=(6,4))
plt.figure(figsize'r-',label='Control Variable (0/1)')
plt.step(m.time,w.value,'b',label=r'Prey')
plt.plot(m.time,x0.value,'g',label=r'Predator')
plt.plot(m.time,x1.value,'t'); plt.ylabel('Biomass / Control Variable')
plt.xlabel(='best'); plt.grid(); plt.tight_layout()
plt.legend(loc"prey_predator_controlled.png")
plt.savefig( plt.show()
Result:
As we can see from graph, with control variable, oscillation dampens and population density values converges to 1.
References
\(^1\) Solve a Lotka-Volterra based ODE Optimal Control Problem \(^2\) Lotka Volterra fishing problem \(^3\) Lotka Volterra Fishing Optimization \(^4\) Introduction to Optimal Control
Citation
@online{koptur2023,
author = {Koptur, Murat},
title = {Applying {Optimal} {Control} to {Fishing}},
date = {2023-11-04},
url = {https://www.muratkoptur.com/MyDsProjects/LotkaVolterraOptimalControl/Analysis.html},
langid = {en}
}