Difference between revisions of "Lotka Volterra fishing problem"
Line 54: | Line 54: | ||
== Source Code == | == Source Code == | ||
+ | The differential equations in C code: | ||
<source lang="cpp"> | <source lang="cpp"> | ||
/* steady state with u == 0 */ | /* steady state with u == 0 */ | ||
Line 64: | Line 65: | ||
/* Deviation from reference trajectory */ | /* Deviation from reference trajectory */ | ||
rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1); | rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1); | ||
+ | </source> | ||
+ | |||
+ | The model in AMPL code with a collocation method. We need a model file lotka_ampl.mod, | ||
+ | <source lang="cpp"> | ||
+ | # ---------------------------------------------------- | ||
+ | # Solve Lotka Volterra fishing problem via collocation | ||
+ | # ---------------------------------------------------- | ||
+ | |||
+ | param T > 0; | ||
+ | param nt > 0; | ||
+ | param c1 > 0; | ||
+ | param c2 > 0; | ||
+ | param ref1 > 0; | ||
+ | param ref2 > 0; | ||
+ | param dt := T / nt; | ||
+ | set I:= 0..nt-1; | ||
+ | |||
+ | var x {I, 1..2} >= 0; | ||
+ | var w {I} binary; | ||
+ | |||
+ | minimize Deviation: | ||
+ | dt * sum {i in I} ( (x[i,1] - ref1)*(x[i,1] - ref1) | ||
+ | + (x[i,2] - ref2)*(x[i,2] - ref2) ) ; | ||
+ | |||
+ | subj to ODE_DISC_1 {i in I diff {0}}: | ||
+ | x[i,1] = x[i-1,1] + dt * ( x[i-1,1] - x[i-1,1]*x[i-1,2] - x[i-1,1]*c1*w[i-1] ); | ||
+ | |||
+ | subj to ODE_DISC_2 {i in I diff {0}}: | ||
+ | x[i,2] = x[i-1,2] + dt * ( - x[i-1,2] + x[i-1,1]*x[i-1,2] - x[i-1,2]*c2*w[i-1] ); | ||
+ | </source> | ||
+ | a data file lotka_ampl.dat, | ||
+ | <source lang="cpp"> | ||
+ | # ------------------------------------ | ||
+ | # Data: Lotka Volterra fishing problem | ||
+ | # ------------------------------------ | ||
+ | |||
+ | # Problem parameters | ||
+ | param T := 12.0; | ||
+ | param nt := 101; | ||
+ | param c1 := 0.4; | ||
+ | param c2 := 0.2; | ||
+ | param ref1 := 1.0; | ||
+ | param ref2 := 1.0; | ||
+ | |||
+ | # Initial values differential states | ||
+ | let x[0,1] := 0.5; | ||
+ | let x[0,2] := 0.7; | ||
+ | fix x[0,1]; | ||
+ | fix x[0,2]; | ||
+ | |||
+ | # Initial values control | ||
+ | let {i in I} w[i] := 0.0; | ||
+ | |||
+ | param mysum; | ||
+ | </source> | ||
+ | and a running script lotka_ampl.run, | ||
+ | <source lang="cpp"> | ||
+ | # ---------------------------------------------------- | ||
+ | # Solve Lotka Volterra fishing problem via collocation | ||
+ | # ---------------------------------------------------- | ||
+ | |||
+ | model ampl_lotka.mod; | ||
+ | data ampl_lotka.dat; | ||
+ | |||
+ | option solver bonmin; | ||
+ | |||
+ | solve; | ||
</source> | </source> | ||
Revision as of 00:44, 7 July 2008
Lotka Volterra fishing problem | |
---|---|
State dimension: | 1 |
Differential states: | 3 |
Algebraic states: | 0 |
Continuous control functions: | 0 |
Discrete control functions: | 1 |
Continuous control values: | 0 |
Discrete control values: | 0 |
Path constraints: | 0 |
Interior point inequalities: | 0 |
Interior point equalities: | 3 |
The Lotka Volterra fishing problem looks for an optimal fishing strategy to be performed on a fixed time horizon to bring the biomasses of both predator as prey fish to a prescribed steady state. The problem was set up as a small-scale benchmark problem. The well known Lotka Volterra equations for a predator-prey system have been augmented by an additional linear term, relating to fishing by man. The control can be regarded both in a relaxed, as in a discrete manner, corresponding to a part of the fleet, or the full fishing fleet.
It is thus an ODE model with a single integer control function. The interior point equality conditions fix the initial values of the differential states.
The optimal solution contains a singular arc, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.
Contents
Mathematical formulation
For almost everywhere the mixed-integer optimal control problem is given by
Initial values and parameters
These fixed values are used within the model.
Reference Solutions
Source Code
The differential equations in C code:
/* steady state with u == 0 */ double ref0 = 1, ref1 = 1; /* Biomass of prey */ rhs[0] = xd[0] - xd[0]*xd[1] - p[0]*u[0]*xd[0]; /* Biomass of predator */ rhs[1] = - xd[1] + xd[0]*xd[1] - p[1]*u[0]*xd[1]; /* Deviation from reference trajectory */ rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1);
The model in AMPL code with a collocation method. We need a model file lotka_ampl.mod,
# ---------------------------------------------------- # Solve Lotka Volterra fishing problem via collocation # ---------------------------------------------------- param T > 0; param nt > 0; param c1 > 0; param c2 > 0; param ref1 > 0; param ref2 > 0; param dt := T / nt; set I:= 0..nt-1; var x {I, 1..2} >= 0; var w {I} binary; minimize Deviation: dt * sum {i in I} ( (x[i,1] - ref1)*(x[i,1] - ref1) + (x[i,2] - ref2)*(x[i,2] - ref2) ) ; subj to ODE_DISC_1 {i in I diff {0}}: x[i,1] = x[i-1,1] + dt * ( x[i-1,1] - x[i-1,1]*x[i-1,2] - x[i-1,1]*c1*w[i-1] ); subj to ODE_DISC_2 {i in I diff {0}}: x[i,2] = x[i-1,2] + dt * ( - x[i-1,2] + x[i-1,1]*x[i-1,2] - x[i-1,2]*c2*w[i-1] );
a data file lotka_ampl.dat,
# ------------------------------------ # Data: Lotka Volterra fishing problem # ------------------------------------ # Problem parameters param T := 12.0; param nt := 101; param c1 := 0.4; param c2 := 0.2; param ref1 := 1.0; param ref2 := 1.0; # Initial values differential states let x[0,1] := 0.5; let x[0,2] := 0.7; fix x[0,1]; fix x[0,2]; # Initial values control let {i in I} w[i] := 0.0; param mysum;
and a running script lotka_ampl.run,
# ---------------------------------------------------- # Solve Lotka Volterra fishing problem via collocation # ---------------------------------------------------- model ampl_lotka.mod; data ampl_lotka.dat; option solver bonmin; solve;
Miscellaneous
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper <bibref>Sager2006</bibref> and revisited in his PhD thesis <bibref>Sager2005</bibref>. These are also the references to look for more details.
References
<bibreferences/>