Difference between revisions of "Lotka Volterra fishing problem (TACO)"
From mintOC
(Lotka model using AMPL and TACO) |
|||
Line 45: | Line 45: | ||
</source> | </source> | ||
+ | |||
+ | == Source Code == | ||
+ | |||
+ | Other model descriptions are available in | ||
+ | |||
+ | * Mathematical notation at [[Lotka Volterra fishing problem]] | ||
+ | * [[:Category:AMPL | AMPL]] (using a fixed discretization) at [[Lotka Volterra fishing problem (AMPL)]] | ||
+ | * [[:Category:C | C code]] at [[Lotka Volterra fishing problem (C)]] | ||
+ | * [[:Category:optimica | optimica]] at [[Lotka Volterra fishing problem (optimica)]] | ||
+ | |||
[[Category:AMPL]] | [[Category:AMPL]] |
Revision as of 23:17, 28 September 2011
This page contains a model of the MIOCP Lotka Volterra fishing problem in AMPL format, making use of the TACO toolkit for AMPL control optimization extensions. Note that you will need to include a generic AMPL/TACO support file, OptimalControl.mod. To solve this model, you require an optimal control or MINLP code that uses the TACO toolkit to support the AMPL optimal control extensions.
AMPL
This is the source file lotka_taco.mod
# ---------------------------------------------------------------- # Lotka Volterra fishing problem using AMPL and TACO # (c) Christian Kirches, Sven Leyffer # ---------------------------------------------------------------- include OptimalControl.mod; var t; var xd0 := 0.5, >= 0, <= 20; var xd1 := 0.7, >= 0, <= 20; var dev := 0.0, >= 0, <= 20; var u := 1, >= 0, <= 1 integer suffix type "u0"; param p0 := 0.4; param p1 := 0.2; param ref0 := 1.0; param ref1 := 1.0; # Minimize accumulated deviation from reference after 12 time units minimize Mayer: eval(dev,12); subject to # ODE system ODE_0: diff(xd0,t) = xd0 - xd0*xd1 - p0*u*xd0; # prey ODE_1: diff(xd1,t) = -xd1 + xd0*xd1 - p1*u*xd1; # predator ODE_2: diff(dev,t) = (xd0-ref0)^2 + (xd1-ref1)^2; # deviation from reference # initial value constraints IVC_0: eval(xd0,0) = 0.5; IVC_1: eval(xd1,0) = 0.7; IVC_2: eval(dev,0) = 0.0; option solver ...; solve;
Source Code
Other model descriptions are available in
- Mathematical notation at Lotka Volterra fishing problem
- AMPL (using a fixed discretization) at Lotka Volterra fishing problem (AMPL)
- C code at Lotka Volterra fishing problem (C)
- optimica at Lotka Volterra fishing problem (optimica)