Difference between revisions of "Hanging chain problem (TACO)"
From mintOC
(Hanging chain problem (TACO)) |
(→AMPL) |
||
(One intermediate revision by the same user not shown) | |||
Line 16: | Line 16: | ||
include OptimalControl.mod; | 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 ...; | option solver ...; |
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
- Mathematical notation at Hanging chain problem
- AMPL (using a fixed discretization) at the COPS library