Difference between revisions of "Hanging chain problem (TACO)"

From mintOC
Jump to: navigation, search
(AMPL)
(AMPL)
 
Line 22: Line 22:
 
var L >= 0, <= 10;
 
var L >= 0, <= 10;
 
var E >= 0, <= 10;
 
var E >= 0, <= 10;
var u >= -10, <= 20;
+
var u >= -10, <= 20 suffix type "u1";
let u.type := "u1";
+
  
 
param a := 1;
 
param a := 1;
Line 35: Line 34:
 
dx: diff(x,t) = u;
 
dx: diff(x,t) = u;
 
dE: diff(E,t) = x*sqrt(1+u^2);
 
dE: diff(E,t) = x*sqrt(1+u^2);
dL: diff(L,t) = sqrt(1+u^2);
+
dL: diff(L,t) = sqrt(1+u^2);
  
 
x0: eval(x,0) = a;
 
x0: eval(x,0) = a;

Latest revision as of 19:25, 29 September 2011

This page contains a model of the Hanging chain problem in AMPL format, making use of the TACO toolkit for AMPL control optimization extensions. The original model using a collocation formulation can be found in the COPS library. 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 NLP code that uses the TACO toolkit to support the AMPL optimal control extensions.

AMPL

This is the source file hangchain_taco.mod

# ----------------------------------------------------------------
# Hanging chain problem using AMPL and TACO
# (c) Christian Kirches, Sven Leyffer
#
# Source: COPS 3.1 collocation formulation - March 2004
#         Alexander S. Bondarenko - Summer 1998
# ----------------------------------------------------------------
include OptimalControl.mod;
 
var t;
var tf := 1;
 
var x >= 0, <= 10;
var L >= 0, <= 10;
var E >= 0, <= 10;
var u >= -10, <= 20 suffix type "u1";
 
param a := 1;
param b := 3;
param Lp := 4;
 
minimize energy: eval(E,tf);
 
subject to
 
dx: diff(x,t) = u;
dE: diff(E,t) = x*sqrt(1+u^2);
dL: diff(L,t) = sqrt(1+u^2);
 
x0: eval(x,0) = a;
x1: eval(x,1) = b;
E0: eval(E,0) = 0;
L0: eval(L,0) = 0;
L1: eval(L,1) = Lp;
 
option solver ...;
 
solve;

Other Descriptions

Other descriptions of this problem are available in