<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mintoc.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Henry+Chan</id>
	<title>mintOC - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://mintoc.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Henry+Chan"/>
	<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Special:Contributions/Henry_Chan"/>
	<updated>2026-06-09T07:59:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=1853</id>
		<title>User:Henry Chan</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=1853"/>
		<updated>2016-03-01T03:53:16Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Prevent creation of a table of content --&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- User image&lt;br /&gt;
  You have to upload it first. &lt;br /&gt;
  If you do not want an image comment out the following line. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- [[Image:UploadMe.jpg|thumb]]--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
== Personal ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039;: || Henry Kar Ming Chan&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Affiliation&#039;&#039;&#039;: || [http://sites.google.com/site/karminghenry/ KNITRO optimization software]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Background&#039;&#039;&#039;: || High Performance Computing Specialist in Scientific Computation&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
== Contact ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Address&#039;&#039;&#039;: || Queensland, Australia&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Web&#039;&#039;&#039;: || [http://sites.google.com/site/karminghenry/ http://sites.google.com/site/karminghenry]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Email&#039;&#039;&#039;: || karminghenry@gmail.com&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- Categories&lt;br /&gt;
  Here you can list the categories you are interested in.&lt;br /&gt;
  You can find a list of all categories at [[Special:Categories]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Main_Page&amp;diff=536</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Main_Page&amp;diff=536"/>
		<updated>2009-08-27T09:13:55Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: New result for F8-aircraft (AMPL) in reduced model with Knitro by Henry Kar Ming Chan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This wiki contains a &#039;&#039;&#039;benchmark library&#039;&#039;&#039; of &#039;&#039;&#039;mixed-integer optimal control problems&#039;&#039;&#039;. The main intention is to provide algorithm developers with a set of challenging problems to evaluate their numerical optimization methods. An important focus is given on &#039;&#039;&#039;reproducibility&#039;&#039;&#039; of optimal solutions.&lt;br /&gt;
As, in contrast to say linear programming, there are no standard formats for the formulation of such problems, and they often show completely different characteristics, these pages dedicate some space for a thorough description of problem and solutions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TOP TABLE WITH NEWS  --&amp;gt;&lt;br /&gt;
&amp;lt;table bgcolor=&amp;quot;#EEEEFF&amp;quot; width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;80%&amp;quot; bgcolor=&amp;quot;#EEEEFF&amp;quot;&amp;gt;&lt;br /&gt;
==[[:Category:News|News]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Current News|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&amp;lt;!-- The actual news are being included from the page Current News with the following line. --&amp;gt;&lt;br /&gt;
{{News|2009/08/26:|New results for F8-aircraft (AMPL) in reduced model with Knitro}}&lt;br /&gt;
&amp;lt;!-- Do not edit between this comment and the next &#039;&amp;lt;td&amp;gt;&#039; tag! --&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- CATEGORY FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:Problem characterization|Problem characterization]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Help:Adding a problem characterization|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
via &#039;&#039;[[:Category:Model characterization|mathematical model]]&#039;&#039; - via &#039;&#039;[[:Category:Solution characterization|optimal solution]]&#039;&#039; - via &#039;&#039;[[:Category:Application|application area]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[:Category:ODE model|ODE model]]&#039;&#039; - &#039;&#039;[[:Category:Bang bang|Bang bang]]&#039;&#039; - &#039;&#039;[[:Category:Chattering|Chattering]]&#039;&#039; - &#039;&#039;[[:Category:AMPL|AMPL]]&#039;&#039; - &#039;&#039;[[:Category:C|C code]]&#039;&#039; - &#039;&#039;[[:Category:Optimica|optimica]]&#039;&#039; - &#039;&#039;[[:Category:Periodic|Periodicity]]&#039;&#039;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PROBLEM FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:MIOCP|Problems]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Help:Adding a Problem|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[Lotka Volterra fishing problem]]&#039;&#039; - [[F-8 aircraft]] - [[Annihilation of calcium oscillations | Calcium]] - [[Annihilation of calcium oscillations with PLC activation inhibition| Calcium 2]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[Supermarket refrigeration system]] - &#039;&#039;[[Car testdrive]]&#039;&#039; - &#039;&#039;[[Fuller&#039;s problem]]&#039;&#039;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- HELP FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:Help|Help]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[User:SebastianSager|(contact)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[Help:How to contribute|How to contribute]]&#039;&#039; - &#039;&#039;[[Help:How to cite|How to cite]]&#039;&#039; - &#039;&#039;[[Help:Using LaTeX|LaTeX]]&#039;&#039; - &#039;&#039;[[Help:Description guidelines | Guidelines]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMUNITY FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:Community|Community]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Help:Adding a User|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Have a look at the contributors to this benchmark library. Feel encouraged to participate!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Main]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=F-8_aircraft_(AMPL)&amp;diff=535</id>
		<title>F-8 aircraft (AMPL)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=F-8_aircraft_(AMPL)&amp;diff=535"/>
		<updated>2009-08-27T08:37:54Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: Result from Knitro for the  F-8 aircraft by Henry Kar Ming Chan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a discretized version of the MIOCP [[F-8 aircraft]] in [http://www.ampl.org AMPL] format. You should be aware of the comments regarding discretization made on the [[:Category:AMPL|AMPL overview]] page. Note that you will need to include two generic [[support AMPL files]], ampl_general.mod and ampl_general.dat.&lt;br /&gt;
&lt;br /&gt;
== Model ==&lt;br /&gt;
&lt;br /&gt;
The main difficulty in calculating a time-optimal solution for the [[F-8 aircraft]] problem is the determination of the correct switching structure and of the switching points.&lt;br /&gt;
If we want to formulate a MINLP, we have to slightly modify this problem. Our aim is not a minimization of the overall time, but now we want to get as close as possible to the origin (0,0,0) in&lt;br /&gt;
a prespecified time &amp;lt;MATH&amp;gt;t_f = 3.78086&amp;lt;/MATH&amp;gt; on an equidistant time grid. As this time grid is not a superset of the one used for the [[F-8 aircraft|time-optimal solution]], one can not expect to reach the target state exactly.&lt;br /&gt;
&lt;br /&gt;
=== AMPL ===&lt;br /&gt;
&lt;br /&gt;
The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file f8_ampl.mod,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------&lt;br /&gt;
# F-8 aircraft control problem with collocation (implicit Euler)&lt;br /&gt;
# (c) Sebastian Sager&lt;br /&gt;
# --------------------------------------------------------------&lt;br /&gt;
var x {I, 1..nx};&lt;br /&gt;
param xi &amp;gt; 0;&lt;br /&gt;
&lt;br /&gt;
minimize Deviation: sum {i in 1..3} x[nt,i]*x[nt,i]; &lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_1 {i in I diff {0}}:&lt;br /&gt;
x[i,1] = x[i-1,1] + (dt[uidx[i]]/ntperu) * (&lt;br /&gt;
 - 0.877*x[i,1] + x[i,3] - 0.088*x[i,1]*x[i,3] + 0.47*x[i,1]*x[i,1] &lt;br /&gt;
 - 0.019*x[i,2]*x[i,2]&lt;br /&gt;
 - x[i,1]*x[i,1]*x[i,3] + 3.846*x[i,1]*x[i,1]*x[i,1]&lt;br /&gt;
 + 0.215*xi - 0.28*x[i,1]*x[i,1]*xi + 0.47*x[i,1]*xi^2 - 0.63*xi^2&lt;br /&gt;
 - 2*w[uidx[i]] * ( 0.215*xi - 0.28*x[i,1]*x[i,1]*xi - 0.63*xi^3 )&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_2 {i in I diff {0}}:&lt;br /&gt;
   x[i,2] = x[i-1,2] + (dt[uidx[i]]/ntperu) * x[i,3];&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_3 {i in I diff {0}}:&lt;br /&gt;
x[i,3] = x[i-1,3] + (dt[uidx[i]]/ntperu) * (&lt;br /&gt;
 - 4.208*x[i,1] - 0.396*x[i,3] - 0.47*x[i,1]*x[i,1] &lt;br /&gt;
 - 3.564*x[i,1]*x[i,1]*x[i,1]&lt;br /&gt;
 + 20.967*xi - 6.265*x[i,1]*x[i,1]*xi + 46*x[i,1]*xi^2 - 61.4*xi^3&lt;br /&gt;
 - 2*w[uidx[i]] * (20.967*xi - 6.265*x[i,1]*x[i,1]*xi - 61.4*xi^3)&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
a data file f8_ampl.dat,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# Algorithmic parameters&lt;br /&gt;
param ntperu := 500;&lt;br /&gt;
param nu := 60;&lt;br /&gt;
param nt := 30000;&lt;br /&gt;
param nx := 3;&lt;br /&gt;
param fix_w := 0;&lt;br /&gt;
param fix_dt := 1;&lt;br /&gt;
&lt;br /&gt;
# Problem parameters&lt;br /&gt;
param xi := 0.05236;&lt;br /&gt;
param T := 8;&lt;br /&gt;
&lt;br /&gt;
# Initial values differential states&lt;br /&gt;
let x[0,1] := 0.4655;&lt;br /&gt;
let x[0,2] := 0.0;&lt;br /&gt;
let x[0,3] := 0.0;&lt;br /&gt;
for {i in 1..3} { fix x[0,i]; }&lt;br /&gt;
&lt;br /&gt;
# Initial values control&lt;br /&gt;
let {i in U} w[i] := 0.0;&lt;br /&gt;
for {i in 0..(nu-1) / 2} { let w[i*2] := 1.0; }&lt;br /&gt;
let {i in U} dt[i] := 3.78086 / nu;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and a running script f8_ampl.run,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
model ampl_general.mod;&lt;br /&gt;
model ampl_f8.mod;&lt;br /&gt;
data ampl_f8.dat;&lt;br /&gt;
data ampl_general.dat;&lt;br /&gt;
&lt;br /&gt;
option presolve_eps 1e-10;&lt;br /&gt;
option solver ...;&lt;br /&gt;
&lt;br /&gt;
solve;&lt;br /&gt;
&lt;br /&gt;
param myt;&lt;br /&gt;
let myt := 0;&lt;br /&gt;
for {i in I} { &lt;br /&gt;
	if ( dt[uidx[i]] &amp;gt; 1e-6 ) then {&lt;br /&gt;
		print myt, w[uidx[i]], x[i,1], x[i,2] &amp;gt; resultInt.txt;&lt;br /&gt;
	}&lt;br /&gt;
	let myt := myt + (dt[uidx[i]]/ntperu);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
display w;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
=== Bonmin ===&lt;br /&gt;
&lt;br /&gt;
The solution calculated by Bonmin (subversion revision number 1453, default settings, 3 GHz, Linux 2.6.28-13-generic, with ASL(20081205)) has an objective function value of &amp;lt;MATH&amp;gt;\Phi= 0.023405&amp;lt;/MATH&amp;gt;, while the optimum of the relaxation is &amp;lt;MATH&amp;gt;\Phi=0.023079&amp;lt;/MATH&amp;gt;. Bonmin needs 85702 iterations and 7031 nodes (64282 seconds). Strong branching is done 45 times (1212 iterations), with 0 fathomed nodes and 4 fixed variables. The intervals on the equidistant grid on which &amp;lt;MATH&amp;gt;w(t) = 1&amp;lt;/MATH&amp;gt; holds, counting from 0 to 59, are 0, 1, 31, 32, 42, 52, and 54.&lt;br /&gt;
&lt;br /&gt;
=== Knitro ===&lt;br /&gt;
&lt;br /&gt;
A solution obtained by Knitro version 6.0 under NEOS server environment was tested by [[User:Henry_Chan | Henry Kar Ming Chan]] for the reduced model. The reduced model is defined by using less number of period of time (i.e. ntperu := 200). The standard defaults were used except the strong branching strategies, the integrality gap tolerances and maximum nodes without parallel features. Final objective value is 0.02200987541. Number of nodes processed is 861 and number of subproblems solved is 872. Total program CPU time is 10775.09 seconds with time spent in evaluations for 3276.315 seconds. The intervals on the equidistant grid on which &amp;lt;MATH&amp;gt;w(t) = 1&amp;lt;/MATH&amp;gt; holds, counting from 0 to 59, are 0, 1, 31, 32, 42, 52, and 54.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;360px&amp;quot;  heights=&amp;quot;280px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:AmplF8Control.png| Optimal integer control found by Bonmin.&lt;br /&gt;
 Image:AmplF8States.png| Corresponding differential states.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comparing this solution to the ones described for [[F-8 aircraft]], this solution might well not be the global optimum.&lt;br /&gt;
&lt;br /&gt;
[[Category:AMPL]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem_(AMPL)&amp;diff=464</id>
		<title>Lotka Volterra fishing problem (AMPL)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem_(AMPL)&amp;diff=464"/>
		<updated>2009-07-17T04:14:13Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: Knitro solution for this benchmark tested by Henry Kar Ming Chan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a discretized version of the MIOCP [[Lotka Volterra fishing problem]] in [http://www.ampl.org AMPL] format. You should be aware of the comments regarding discretization made on the [[:Category:AMPL|AMPL overview]] page. Note that you will need to include two generic [[support AMPL files]], ampl_general.mod and ampl_general.dat.&lt;br /&gt;
&lt;br /&gt;
=== AMPL ===&lt;br /&gt;
&lt;br /&gt;
The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file lotka_ampl.mod,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
# Lotka Volterra fishing problem with collocation (implicit Euler)&lt;br /&gt;
# (c) Sebastian Sager&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
var x {I, 1..nx} &amp;gt;= 0;&lt;br /&gt;
param c1 &amp;gt; 0; &lt;br /&gt;
param c2 &amp;gt; 0; &lt;br /&gt;
param ref1 &amp;gt; 0; &lt;br /&gt;
param ref2 &amp;gt; 0;&lt;br /&gt;
&lt;br /&gt;
minimize Deviation:&lt;br /&gt;
 0.5 * (dt[0]/ntperu) * ( (x[0,1]-ref1)^2 + (x[0,2]-ref2)^2 )&lt;br /&gt;
 + 0.5 * (dt[nu-1]/ntperu) * ((x[nt,1]-ref1)^2 + (x[nt,2]-ref2)^2)&lt;br /&gt;
 + sum {i in I diff {0,nt} } ( (dt[uidx[i]]/ntperu) * &lt;br /&gt;
   ( (x[i,1] - ref1)^2 + (x[i,2] - ref2)^2 ) ) ;&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_1 {i in I diff {0}}:&lt;br /&gt;
 x[i,1] = x[i-1,1] + (dt[uidx[i]]/ntperu) * &lt;br /&gt;
  ( x[i,1] - x[i,1]*x[i,2] - x[i,1]*c1*w[uidx[i]] );&lt;br /&gt;
	 &lt;br /&gt;
subj to ODE_DISC_2 {i in I diff {0}}:&lt;br /&gt;
 x[i,2] = x[i-1,2] + (dt[uidx[i]]/ntperu) * &lt;br /&gt;
  ( - x[i,2] + x[i,1]*x[i,2] - x[i,2]*c2*w[uidx[i]] );&lt;br /&gt;
&lt;br /&gt;
subj to overall_stage_length:&lt;br /&gt;
 sum {i in U} dt[i] = T;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
a data file lotka_ampl.dat,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
# Data: Lotka Volterra fishing problem&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Algorithmic parameters&lt;br /&gt;
param ntperu := 100;&lt;br /&gt;
param nu := 100;&lt;br /&gt;
param nt := 10000;&lt;br /&gt;
param nx := 2;&lt;br /&gt;
param fix_w := 0;&lt;br /&gt;
param fix_dt := 1;&lt;br /&gt;
&lt;br /&gt;
# Problem parameters&lt;br /&gt;
param T := 12.0;&lt;br /&gt;
param c1 := 0.4;   &lt;br /&gt;
param c2 := 0.2;&lt;br /&gt;
param ref1 := 1.0; &lt;br /&gt;
param ref2 := 1.0;&lt;br /&gt;
&lt;br /&gt;
# Initial values differential states&lt;br /&gt;
let x[0,1] := 0.5; let x[0,2] := 0.7;&lt;br /&gt;
fix x[0,1]; fix x[0,2];&lt;br /&gt;
&lt;br /&gt;
# Initial values control&lt;br /&gt;
let {i in U} w[i] := 0.0;&lt;br /&gt;
for {i in 0..(nu-1) / 2} { let w[i*2] := 1.0; }&lt;br /&gt;
let {i in U} dt[i] := T / nu;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and a running script lotka_ampl.run,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
# Solve Lotka Volterra fishing problem&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
&lt;br /&gt;
model ampl_general.mod;&lt;br /&gt;
model ampl_lotka.mod;&lt;br /&gt;
data ampl_lotka.dat;&lt;br /&gt;
data ampl_general.dat;&lt;br /&gt;
&lt;br /&gt;
option presolve_eps 1e-10;&lt;br /&gt;
option solver ...;&lt;br /&gt;
&lt;br /&gt;
solve;&lt;br /&gt;
&lt;br /&gt;
param myt;&lt;br /&gt;
let myt := 0;&lt;br /&gt;
for {i in I} { &lt;br /&gt;
	if ( dt[uidx[i]] &amp;gt; 1e-6 ) then {&lt;br /&gt;
		print myt, w[uidx[i]], x[i,1], x[i,2] &amp;gt; resultInt.txt;&lt;br /&gt;
	}&lt;br /&gt;
	let myt := myt + (dt[uidx[i]]/ntperu);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
display w;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
The solution calculated by Bonmin (subversion revision number 1453, default settings, 3 GHz, Linux 2.6.28-13-generic, with ASL(20081205)) has an objective function value of &amp;lt;MATH&amp;gt;\Phi= 1.34434&amp;lt;/MATH&amp;gt;, while the optimum of the relaxation is &amp;lt;MATH&amp;gt;\Phi=1.3423368&amp;lt;/MATH&amp;gt;. Bonmin needs 35301 iterations and 2741 nodes (4899.97 seconds). Strong branching is done 81 times (1859 iterations), with 0 fathomed nodes and 0 fixed variables. The intervals on the equidistant grid on which &amp;lt;MATH&amp;gt;w(t) = 1&amp;lt;/MATH&amp;gt; holds, counting from 0 to 99, are 20-32, 34, 36, 38, 40, 44, 53.&lt;br /&gt;
&lt;br /&gt;
A faster solution obtained by Knitro version 6.0 under NEOS server environment and tested by Henry Kar Ming Chan. The standard defaults are used except the strong branching strategies and the integrality gap tolerances without parallel features. Final objective value is 1.34521362. Number of nodes processed is 508 and number of subproblems solved is 671. Total program CPU time is 2823.85 seconds with time spent in evaluations for 684.37 seconds. The intervals on the equidistant grid on which &amp;lt;MATH&amp;gt;w(t) = 1&amp;lt;/MATH&amp;gt; holds, counting from 0 to 99, are 20-32, 34, 36-37, 42, 44, 52.&lt;br /&gt;
 &lt;br /&gt;
[[Category:AMPL]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=444</id>
		<title>User:Henry Chan</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=444"/>
		<updated>2009-07-03T23:35:54Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: Change the address of Henry Kar Ming Chan web site (temporary???)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Prevent creation of a table of content --&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- User image&lt;br /&gt;
  You have to upload it first. &lt;br /&gt;
  If you do not want an image comment out the following line. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- [[Image:UploadMe.jpg|thumb]]--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
== Personal ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039;: || Henry Kar Ming Chan&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Affiliation&#039;&#039;&#039;: || [http://sites.google.com/site/karminghenry/ KNITRO optimization software]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Background&#039;&#039;&#039;: || High Performance Computing Specialist in Scientific Computation&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
== Contact ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Address&#039;&#039;&#039;: || Queensland, Australia&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Web&#039;&#039;&#039;: || [http://sites.google.com/site/karminghenry/ http://sites.google.com/site/karminghenry]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Email&#039;&#039;&#039;: || karminghenry@sinaman.com&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- Categories&lt;br /&gt;
  Here you can list the categories you are interested in.&lt;br /&gt;
  You can find a list of all categories at [[Special:Categories]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:Community]]&lt;br /&gt;
[[Category:MIOCP]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=441</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=441"/>
		<updated>2009-05-14T03:02:34Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: More Knitro testing result by Henry Kar Ming Chan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; 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. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x}_0(t) &amp;amp; = &amp;amp; x_0(t) - x_0(t) x_1(t) - \; c_0 x_0(t) \; w(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_1(t) &amp;amp; = &amp;amp; - x_1(t) + x_0(t) x_1(t) - \; c_1 x_1(t) \; w(t),  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2(t) &amp;amp; = &amp;amp; (x_0(t) - 1)^2 + (x_1(t) - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory&amp;lt;bibref&amp;gt;Sager2008&amp;lt;/bibref&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* steady state with u == 0 */&lt;br /&gt;
double ref0 = 1, ref1 = 1;&lt;br /&gt;
&lt;br /&gt;
/* Biomass of prey */&lt;br /&gt;
rhs[0] =   xd[0] - xd[0]*xd[1] - p[0]*u[0]*xd[0];&lt;br /&gt;
/* Biomass of predator */&lt;br /&gt;
rhs[1] = - xd[1] + xd[0]*xd[1] - p[1]*u[0]*xd[1];&lt;br /&gt;
/* Deviation from reference trajectory */&lt;br /&gt;
rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AMPL ===&lt;br /&gt;
&lt;br /&gt;
The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file lotka_ampl.mod,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
# Lotka Volterra fishing problem with collocation (explicit Euler)&lt;br /&gt;
# (c) Sebastian Sager&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
param T    &amp;gt; 0;&lt;br /&gt;
param nt   &amp;gt; 0;&lt;br /&gt;
param nu   &amp;gt; 0;&lt;br /&gt;
param ntperu &amp;gt; 0;&lt;br /&gt;
param c1   &amp;gt; 0;&lt;br /&gt;
param c2   &amp;gt; 0;&lt;br /&gt;
param ref1 &amp;gt; 0;&lt;br /&gt;
param ref2 &amp;gt; 0;&lt;br /&gt;
param dt := T / (nt-1);&lt;br /&gt;
set I:= 0..nt;&lt;br /&gt;
set U:= 0..nu-1;&lt;br /&gt;
&lt;br /&gt;
param uidx {I};&lt;br /&gt;
&lt;br /&gt;
var x {I, 1..2} &amp;gt;= 0;&lt;br /&gt;
var w {U} &amp;gt;= 0, &amp;lt;= 1 binary;&lt;br /&gt;
&lt;br /&gt;
minimize Deviation:&lt;br /&gt;
	  0.5 * dt * ( (x[0,1] - ref1)*(x[0,1] - ref1) + (x[0,2] - ref2)*(x[0,2] - ref2) )&lt;br /&gt;
	+ 0.5 * dt * ( (x[nt,1] - ref1)*(x[nt,1] - ref1) + (x[nt,2] - ref2)*(x[nt,2] - ref2) )&lt;br /&gt;
	+ dt * sum {i in I diff {0,nt} } ( (x[i,1] - ref1)*(x[i,1] - ref1) &lt;br /&gt;
	                                 + (x[i,2] - ref2)*(x[i,2] - ref2) ) ;&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_1 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
	 &lt;br /&gt;
subj to ODE_DISC_2 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
a data file lotka_ampl.dat,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
# Data: Lotka Volterra fishing problem&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Algorithmic parameters&lt;br /&gt;
param ntperu := 1;&lt;br /&gt;
param nu := 100;&lt;br /&gt;
param nt := 100;&lt;br /&gt;
&lt;br /&gt;
# Problem parameters&lt;br /&gt;
param T := 12.0;&lt;br /&gt;
param c1 := 0.4;&lt;br /&gt;
param c2 := 0.2;&lt;br /&gt;
param ref1 := 1.0;&lt;br /&gt;
param ref2 := 1.0;&lt;br /&gt;
&lt;br /&gt;
# Initial values differential states&lt;br /&gt;
let x[0,1] := 0.5;&lt;br /&gt;
let x[0,2] := 0.7;&lt;br /&gt;
fix x[0,1];&lt;br /&gt;
fix x[0,2];&lt;br /&gt;
&lt;br /&gt;
# Initial values control&lt;br /&gt;
let {i in U} w[i] := 0.0;&lt;br /&gt;
&lt;br /&gt;
param mysum;&lt;br /&gt;
&lt;br /&gt;
# Set indices of controls corresponding to time points&lt;br /&gt;
for {i in 0..nu-1} {&lt;br /&gt;
	for {j in 0..ntperu-1} {&lt;br /&gt;
		let uidx[i*ntperu+j] := i; &lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
let uidx[nt] := nu-1; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and a running script lotka_ampl.run,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
# Solve Lotka Volterra fishing problem via collocation&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
model ampl_lotka.mod;&lt;br /&gt;
data ampl_lotka.dat;&lt;br /&gt;
&lt;br /&gt;
option solver bonmin;&lt;br /&gt;
&lt;br /&gt;
solve;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preliminary Results ==&lt;br /&gt;
&lt;br /&gt;
Default values for all the options are used in all the solvers under NEOS Server environment using AMPL.&lt;br /&gt;
&lt;br /&gt;
The preliminary results are as follows:&lt;br /&gt;
* MINLP : Infeasible problem&lt;br /&gt;
* FilMINT : Error in MINTO&lt;br /&gt;
* Bonmin : (options = B-BB, B-OA, B-QG and B-Hyb) Infeasible problem&lt;br /&gt;
* KNITRO : problem solved with objective value 1.5847 when using Branch and Bound; the solution can be obtained around 15 seconds (CPU time) by some branching strategies without parallel features&lt;br /&gt;
&lt;br /&gt;
The preliminary results are tested by Henry Kar Ming Chan&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
* a prescribed time grid for the control function &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* different fishing control functions for the two species,&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt; and revisited in his PhD thesis &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--List of all categories this page is part of. List characterization of solution behavior, model properties, ore presence of implementation details (e.g., AMPL for AMPL model) here --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:AMPL]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=439</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=439"/>
		<updated>2009-05-06T01:35:16Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: More testing results from Henry Kar Ming Chan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; 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. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x}_0(t) &amp;amp; = &amp;amp; x_0(t) - x_0(t) x_1(t) - \; c_0 x_0(t) \; w(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_1(t) &amp;amp; = &amp;amp; - x_1(t) + x_0(t) x_1(t) - \; c_1 x_1(t) \; w(t),  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2(t) &amp;amp; = &amp;amp; (x_0(t) - 1)^2 + (x_1(t) - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory&amp;lt;bibref&amp;gt;Sager2008&amp;lt;/bibref&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* steady state with u == 0 */&lt;br /&gt;
double ref0 = 1, ref1 = 1;&lt;br /&gt;
&lt;br /&gt;
/* Biomass of prey */&lt;br /&gt;
rhs[0] =   xd[0] - xd[0]*xd[1] - p[0]*u[0]*xd[0];&lt;br /&gt;
/* Biomass of predator */&lt;br /&gt;
rhs[1] = - xd[1] + xd[0]*xd[1] - p[1]*u[0]*xd[1];&lt;br /&gt;
/* Deviation from reference trajectory */&lt;br /&gt;
rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AMPL ===&lt;br /&gt;
&lt;br /&gt;
The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file lotka_ampl.mod,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
# Lotka Volterra fishing problem with collocation (explicit Euler)&lt;br /&gt;
# (c) Sebastian Sager&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
param T    &amp;gt; 0;&lt;br /&gt;
param nt   &amp;gt; 0;&lt;br /&gt;
param nu   &amp;gt; 0;&lt;br /&gt;
param ntperu &amp;gt; 0;&lt;br /&gt;
param c1   &amp;gt; 0;&lt;br /&gt;
param c2   &amp;gt; 0;&lt;br /&gt;
param ref1 &amp;gt; 0;&lt;br /&gt;
param ref2 &amp;gt; 0;&lt;br /&gt;
param dt := T / (nt-1);&lt;br /&gt;
set I:= 0..nt;&lt;br /&gt;
set U:= 0..nu-1;&lt;br /&gt;
&lt;br /&gt;
param uidx {I};&lt;br /&gt;
&lt;br /&gt;
var x {I, 1..2} &amp;gt;= 0;&lt;br /&gt;
var w {U} &amp;gt;= 0, &amp;lt;= 1 binary;&lt;br /&gt;
&lt;br /&gt;
minimize Deviation:&lt;br /&gt;
	  0.5 * dt * ( (x[0,1] - ref1)*(x[0,1] - ref1) + (x[0,2] - ref2)*(x[0,2] - ref2) )&lt;br /&gt;
	+ 0.5 * dt * ( (x[nt,1] - ref1)*(x[nt,1] - ref1) + (x[nt,2] - ref2)*(x[nt,2] - ref2) )&lt;br /&gt;
	+ dt * sum {i in I diff {0,nt} } ( (x[i,1] - ref1)*(x[i,1] - ref1) &lt;br /&gt;
	                                 + (x[i,2] - ref2)*(x[i,2] - ref2) ) ;&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_1 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
	 &lt;br /&gt;
subj to ODE_DISC_2 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
a data file lotka_ampl.dat,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
# Data: Lotka Volterra fishing problem&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Algorithmic parameters&lt;br /&gt;
param ntperu := 1;&lt;br /&gt;
param nu := 100;&lt;br /&gt;
param nt := 100;&lt;br /&gt;
&lt;br /&gt;
# Problem parameters&lt;br /&gt;
param T := 12.0;&lt;br /&gt;
param c1 := 0.4;&lt;br /&gt;
param c2 := 0.2;&lt;br /&gt;
param ref1 := 1.0;&lt;br /&gt;
param ref2 := 1.0;&lt;br /&gt;
&lt;br /&gt;
# Initial values differential states&lt;br /&gt;
let x[0,1] := 0.5;&lt;br /&gt;
let x[0,2] := 0.7;&lt;br /&gt;
fix x[0,1];&lt;br /&gt;
fix x[0,2];&lt;br /&gt;
&lt;br /&gt;
# Initial values control&lt;br /&gt;
let {i in U} w[i] := 0.0;&lt;br /&gt;
&lt;br /&gt;
param mysum;&lt;br /&gt;
&lt;br /&gt;
# Set indices of controls corresponding to time points&lt;br /&gt;
for {i in 0..nu-1} {&lt;br /&gt;
	for {j in 0..ntperu-1} {&lt;br /&gt;
		let uidx[i*ntperu+j] := i; &lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
let uidx[nt] := nu-1; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and a running script lotka_ampl.run,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
# Solve Lotka Volterra fishing problem via collocation&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
model ampl_lotka.mod;&lt;br /&gt;
data ampl_lotka.dat;&lt;br /&gt;
&lt;br /&gt;
option solver bonmin;&lt;br /&gt;
&lt;br /&gt;
solve;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preliminary Results ==&lt;br /&gt;
&lt;br /&gt;
Default values for all the options are used in all the solvers under NEOS Server environment using AMPL.&lt;br /&gt;
&lt;br /&gt;
The preliminary results are as follows:&lt;br /&gt;
* MINLP : Infeasible problem&lt;br /&gt;
* FilMINT : Error in MINTO&lt;br /&gt;
* Bonmin : (options = B-BB, B-OA, B-QG and B-Hyb) Infeasible problem&lt;br /&gt;
* KNITRO : problem solved with objective value 1.5847 when using Branch and Bound&lt;br /&gt;
&lt;br /&gt;
The preliminary results are tested by Henry Kar Ming Chan&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
* a prescribed time grid for the control function &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* different fishing control functions for the two species,&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt; and revisited in his PhD thesis &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--List of all categories this page is part of. List characterization of solution behavior, model properties, ore presence of implementation details (e.g., AMPL for AMPL model) here --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:AMPL]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=399</id>
		<title>User:Henry Chan</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=399"/>
		<updated>2009-03-25T03:13:50Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: Minor change to the Contact to have a better look&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Prevent creation of a table of content --&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- User image&lt;br /&gt;
  You have to upload it first. &lt;br /&gt;
  If you do not want an image comment out the following line. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- [[Image:UploadMe.jpg|thumb]]--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
== Personal ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039;: || Henry Kar Ming Chan&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Affiliation&#039;&#039;&#039;: || [http://karminghenry.sinaman.com KNITRO optimization software]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Background&#039;&#039;&#039;: || High Performance Computing Specialist in Scientific Computation&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
== Contact ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Address&#039;&#039;&#039;: || Queensland, Australia&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Web&#039;&#039;&#039;: || [http://karminghenry.sinaman.com http://karminghenry.sinaman.com]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Email&#039;&#039;&#039;: || karminghenry@sinaman.com&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- Categories&lt;br /&gt;
  Here you can list the categories you are interested in.&lt;br /&gt;
  You can find a list of all categories at [[Special:Categories]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:Community]]&lt;br /&gt;
[[Category:MIOCP]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=398</id>
		<title>User:Henry Chan</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=User:Henry_Chan&amp;diff=398"/>
		<updated>2009-03-25T03:08:20Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: submit Henry Kar Ming Chan personal page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Prevent creation of a table of content --&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- User image&lt;br /&gt;
  You have to upload it first. &lt;br /&gt;
  If you do not want an image comment out the following line. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- [[Image:UploadMe.jpg|thumb]]--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
== Personal ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039;: || Henry Kar Ming Chan&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Affiliation&#039;&#039;&#039;: || [http://karminghenry.sinaman.com KNITRO optimization software]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Background&#039;&#039;&#039;: || High Performance Computing Specialist in Scientific Computation&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
== Contact ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Address&#039;&#039;&#039;: || Queensland, Australia&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Web&#039;&#039;&#039;: || [http://karminghenry.sinaman.com]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Email&#039;&#039;&#039;: || karminghenry@sinaman.com&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- Categories&lt;br /&gt;
  Here you can list the categories you are interested in.&lt;br /&gt;
  You can find a list of all categories at [[Special:Categories]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:Community]]&lt;br /&gt;
[[Category:MIOCP]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=397</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=397"/>
		<updated>2009-03-24T07:19:07Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: Reorder the Preliminary Results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; 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. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x}_0(t) &amp;amp; = &amp;amp; x_0(t) - x_0(t) x_1(t) - \; c_0 x_0(t) \; w(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_1(t) &amp;amp; = &amp;amp; - x_1(t) + x_0(t) x_1(t) - \; c_1 x_1(t) \; w(t),  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2(t) &amp;amp; = &amp;amp; (x_0(t) - 1)^2 + (x_1(t) - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory&amp;lt;bibref&amp;gt;Sager2008&amp;lt;/bibref&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* steady state with u == 0 */&lt;br /&gt;
double ref0 = 1, ref1 = 1;&lt;br /&gt;
&lt;br /&gt;
/* Biomass of prey */&lt;br /&gt;
rhs[0] =   xd[0] - xd[0]*xd[1] - p[0]*u[0]*xd[0];&lt;br /&gt;
/* Biomass of predator */&lt;br /&gt;
rhs[1] = - xd[1] + xd[0]*xd[1] - p[1]*u[0]*xd[1];&lt;br /&gt;
/* Deviation from reference trajectory */&lt;br /&gt;
rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AMPL ===&lt;br /&gt;
&lt;br /&gt;
The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file lotka_ampl.mod,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
# Lotka Volterra fishing problem with collocation (explicit Euler)&lt;br /&gt;
# (c) Sebastian Sager&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
param T    &amp;gt; 0;&lt;br /&gt;
param nt   &amp;gt; 0;&lt;br /&gt;
param nu   &amp;gt; 0;&lt;br /&gt;
param ntperu &amp;gt; 0;&lt;br /&gt;
param c1   &amp;gt; 0;&lt;br /&gt;
param c2   &amp;gt; 0;&lt;br /&gt;
param ref1 &amp;gt; 0;&lt;br /&gt;
param ref2 &amp;gt; 0;&lt;br /&gt;
param dt := T / (nt-1);&lt;br /&gt;
set I:= 0..nt;&lt;br /&gt;
set U:= 0..nu-1;&lt;br /&gt;
&lt;br /&gt;
param uidx {I};&lt;br /&gt;
&lt;br /&gt;
var x {I, 1..2} &amp;gt;= 0;&lt;br /&gt;
var w {U} &amp;gt;= 0, &amp;lt;= 1 binary;&lt;br /&gt;
&lt;br /&gt;
minimize Deviation:&lt;br /&gt;
	  0.5 * dt * ( (x[0,1] - ref1)*(x[0,1] - ref1) + (x[0,2] - ref2)*(x[0,2] - ref2) )&lt;br /&gt;
	+ 0.5 * dt * ( (x[nt,1] - ref1)*(x[nt,1] - ref1) + (x[nt,2] - ref2)*(x[nt,2] - ref2) )&lt;br /&gt;
	+ dt * sum {i in I diff {0,nt} } ( (x[i,1] - ref1)*(x[i,1] - ref1) &lt;br /&gt;
	                                 + (x[i,2] - ref2)*(x[i,2] - ref2) ) ;&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_1 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
	 &lt;br /&gt;
subj to ODE_DISC_2 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
a data file lotka_ampl.dat,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
# Data: Lotka Volterra fishing problem&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Algorithmic parameters&lt;br /&gt;
param ntperu := 1;&lt;br /&gt;
param nu := 100;&lt;br /&gt;
param nt := 100;&lt;br /&gt;
&lt;br /&gt;
# Problem parameters&lt;br /&gt;
param T := 12.0;&lt;br /&gt;
param c1 := 0.4;&lt;br /&gt;
param c2 := 0.2;&lt;br /&gt;
param ref1 := 1.0;&lt;br /&gt;
param ref2 := 1.0;&lt;br /&gt;
&lt;br /&gt;
# Initial values differential states&lt;br /&gt;
let x[0,1] := 0.5;&lt;br /&gt;
let x[0,2] := 0.7;&lt;br /&gt;
fix x[0,1];&lt;br /&gt;
fix x[0,2];&lt;br /&gt;
&lt;br /&gt;
# Initial values control&lt;br /&gt;
let {i in U} w[i] := 0.0;&lt;br /&gt;
&lt;br /&gt;
param mysum;&lt;br /&gt;
&lt;br /&gt;
# Set indices of controls corresponding to time points&lt;br /&gt;
for {i in 0..nu-1} {&lt;br /&gt;
	for {j in 0..ntperu-1} {&lt;br /&gt;
		let uidx[i*ntperu+j] := i; &lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
let uidx[nt] := nu-1; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and a running script lotka_ampl.run,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
# Solve Lotka Volterra fishing problem via collocation&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
model ampl_lotka.mod;&lt;br /&gt;
data ampl_lotka.dat;&lt;br /&gt;
&lt;br /&gt;
option solver bonmin;&lt;br /&gt;
&lt;br /&gt;
solve;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preliminary Results ==&lt;br /&gt;
&lt;br /&gt;
Default values for all the options are used in all the solvers under NEOS Server environment using AMPL.&lt;br /&gt;
&lt;br /&gt;
The preliminary results are as follows:&lt;br /&gt;
* MINLP : Infeasible problem&lt;br /&gt;
* FilMINT : Error in MINTO&lt;br /&gt;
* Bonmin : Infeasible problem&lt;br /&gt;
* KNITRO : problem solved with objective value 1.5847&lt;br /&gt;
&lt;br /&gt;
The preliminary results are tested by Henry Kar Ming Chan&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
* a prescribed time grid for the control function &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* different fishing control functions for the two species,&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt; and revisited in his PhD thesis &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--List of all categories this page is part of. List characterization of solution behavior, model properties, ore presence of implementation details (e.g., AMPL for AMPL model) here --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:AMPL]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=396</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=396"/>
		<updated>2009-03-24T07:16:08Z</updated>

		<summary type="html">&lt;p&gt;Henry Chan: Preliminary results under NEOS server using AMPL from Henry Kar Ming Chan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; 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. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x}_0(t) &amp;amp; = &amp;amp; x_0(t) - x_0(t) x_1(t) - \; c_0 x_0(t) \; w(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_1(t) &amp;amp; = &amp;amp; - x_1(t) + x_0(t) x_1(t) - \; c_1 x_1(t) \; w(t),  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2(t) &amp;amp; = &amp;amp; (x_0(t) - 1)^2 + (x_1(t) - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory&amp;lt;bibref&amp;gt;Sager2008&amp;lt;/bibref&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/* steady state with u == 0 */&lt;br /&gt;
double ref0 = 1, ref1 = 1;&lt;br /&gt;
&lt;br /&gt;
/* Biomass of prey */&lt;br /&gt;
rhs[0] =   xd[0] - xd[0]*xd[1] - p[0]*u[0]*xd[0];&lt;br /&gt;
/* Biomass of predator */&lt;br /&gt;
rhs[1] = - xd[1] + xd[0]*xd[1] - p[1]*u[0]*xd[1];&lt;br /&gt;
/* Deviation from reference trajectory */&lt;br /&gt;
rhs[2] = (xd[0]-ref0)*(xd[0]-ref0) + (xd[1]-ref1)*(xd[1]-ref1);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AMPL ===&lt;br /&gt;
&lt;br /&gt;
The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file lotka_ampl.mod,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
# Lotka Volterra fishing problem with collocation (explicit Euler)&lt;br /&gt;
# (c) Sebastian Sager&lt;br /&gt;
# ----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
param T    &amp;gt; 0;&lt;br /&gt;
param nt   &amp;gt; 0;&lt;br /&gt;
param nu   &amp;gt; 0;&lt;br /&gt;
param ntperu &amp;gt; 0;&lt;br /&gt;
param c1   &amp;gt; 0;&lt;br /&gt;
param c2   &amp;gt; 0;&lt;br /&gt;
param ref1 &amp;gt; 0;&lt;br /&gt;
param ref2 &amp;gt; 0;&lt;br /&gt;
param dt := T / (nt-1);&lt;br /&gt;
set I:= 0..nt;&lt;br /&gt;
set U:= 0..nu-1;&lt;br /&gt;
&lt;br /&gt;
param uidx {I};&lt;br /&gt;
&lt;br /&gt;
var x {I, 1..2} &amp;gt;= 0;&lt;br /&gt;
var w {U} &amp;gt;= 0, &amp;lt;= 1 binary;&lt;br /&gt;
&lt;br /&gt;
minimize Deviation:&lt;br /&gt;
	  0.5 * dt * ( (x[0,1] - ref1)*(x[0,1] - ref1) + (x[0,2] - ref2)*(x[0,2] - ref2) )&lt;br /&gt;
	+ 0.5 * dt * ( (x[nt,1] - ref1)*(x[nt,1] - ref1) + (x[nt,2] - ref2)*(x[nt,2] - ref2) )&lt;br /&gt;
	+ dt * sum {i in I diff {0,nt} } ( (x[i,1] - ref1)*(x[i,1] - ref1) &lt;br /&gt;
	                                 + (x[i,2] - ref2)*(x[i,2] - ref2) ) ;&lt;br /&gt;
&lt;br /&gt;
subj to ODE_DISC_1 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
	 &lt;br /&gt;
subj to ODE_DISC_2 {i in I diff {0}}:&lt;br /&gt;
   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[uidx[i-1]] );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
a data file lotka_ampl.dat,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
# Data: Lotka Volterra fishing problem&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Algorithmic parameters&lt;br /&gt;
param ntperu := 1;&lt;br /&gt;
param nu := 100;&lt;br /&gt;
param nt := 100;&lt;br /&gt;
&lt;br /&gt;
# Problem parameters&lt;br /&gt;
param T := 12.0;&lt;br /&gt;
param c1 := 0.4;&lt;br /&gt;
param c2 := 0.2;&lt;br /&gt;
param ref1 := 1.0;&lt;br /&gt;
param ref2 := 1.0;&lt;br /&gt;
&lt;br /&gt;
# Initial values differential states&lt;br /&gt;
let x[0,1] := 0.5;&lt;br /&gt;
let x[0,2] := 0.7;&lt;br /&gt;
fix x[0,1];&lt;br /&gt;
fix x[0,2];&lt;br /&gt;
&lt;br /&gt;
# Initial values control&lt;br /&gt;
let {i in U} w[i] := 0.0;&lt;br /&gt;
&lt;br /&gt;
param mysum;&lt;br /&gt;
&lt;br /&gt;
# Set indices of controls corresponding to time points&lt;br /&gt;
for {i in 0..nu-1} {&lt;br /&gt;
	for {j in 0..ntperu-1} {&lt;br /&gt;
		let uidx[i*ntperu+j] := i; &lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
let uidx[nt] := nu-1; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and a running script lotka_ampl.run,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
# Solve Lotka Volterra fishing problem via collocation&lt;br /&gt;
# ----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
model ampl_lotka.mod;&lt;br /&gt;
data ampl_lotka.dat;&lt;br /&gt;
&lt;br /&gt;
option solver bonmin;&lt;br /&gt;
&lt;br /&gt;
solve;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
* a prescribed time grid for the control function &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* different fishing control functions for the two species,&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Preliminary Results ==&lt;br /&gt;
&lt;br /&gt;
Default values for all the options are used in all the solvers under NEOS Server environment using AMPL.&lt;br /&gt;
&lt;br /&gt;
The preliminary results are as follows:&lt;br /&gt;
* MINLP : Infeasible problem&lt;br /&gt;
* FilMINT : Error in MINTO&lt;br /&gt;
* Bonmin : Infeasible problem&lt;br /&gt;
* KNITRO : problem solved with objective value 1.5847&lt;br /&gt;
&lt;br /&gt;
The preliminary results are tested by Henry Kar Ming Chan&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bibref&amp;gt;Sager2006&amp;lt;/bibref&amp;gt; and revisited in his PhD thesis &amp;lt;bibref&amp;gt;Sager2005&amp;lt;/bibref&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--List of all categories this page is part of. List characterization of solution behavior, model properties, ore presence of implementation details (e.g., AMPL for AMPL model) here --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:AMPL]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;/div&gt;</summary>
		<author><name>Henry Chan</name></author>
	</entry>
</feed>