PROPT Linear Tangent Steering Problem: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 143: | Line 143: | ||
[[File:linTanSte_01.png]] | [[File:linTanSte_01.png]] | ||
[[Category:PROPT Examples]] |
Latest revision as of 05:21, 14 February 2012
This page is part of the PROPT Manual. See PROPT Manual. |
Benchmarking Optimization Software with COPS Elizabeth D. Dolan and Jorge J. More ARGONNE NATIONAL LABORATORY
Problem Formulation
Find u(t) over t in [0; t_F ] to minimize
subject to:
The following transformation gives a new formulation:
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
toms t_f
p = tomPhase('p', t, 0, t_f, 30);
setPhase(p);
tomStates x1 x2 x3 x4
tomControls u
% Initial guess
x0 = {t_f == 1
icollocate({
x1 == 12*t/t_f
x2 == 45*t/t_f
x3 == 5*t/t_f
x4 == 0})};
% Box constraints
cbox = {sqrt(eps) <= t_f
-pi/2 <= collocate(u) <= pi/2};
% Boundary constraints
cbnd = {initial({x1 == 0; x2 == 0; x3 == 0; x4 == 0})
final({x2 == 45; x3 == 5; x4 == 0})};
% ODEs and path constraints
a = 100;
ceq = collocate({dot(x1) == x2
dot(x2) == a*cos(u)
dot(x3) == x4
dot(x4) == a*sin(u)});
% Objective
objective = t_f;
Solve the problem
options = struct;
options.name = 'Linear Tangent Steering';
options.solver = 'knitro';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t = subs(collocate(t),solution);
x1 = subs(collocate(x1),solution);
x2 = subs(collocate(x2),solution);
x3 = subs(collocate(x3),solution);
x4 = subs(collocate(x4),solution);
u = subs(collocate(u),solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.12675 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Linear Tangent Steering f_k 0.554570876848740510 sum(|constr|) 0.000053415505390106 f(x_k) + sum(|constr|) 0.554624292354130580 f(x_0) 1.000000000000000000 Solver: KNITRO. EXIT=0. INFORM=0. Default NLP KNITRO Locally optimal solution found FuncEv 14 GradEv 152 ConstrEv 13 ConJacEv 152 Iter 11 MinorIter 12 CPU time: 0.093601 sec. Elapsed time: 0.106000 sec.
Plot result
subplot(2,1,1)
plot(t,x1,'*-',t,x2,'*-',t,x3,'*-',t,x4,'*-');
legend('x1','x2','x3','x4');
title('Linear Tangent Steering state variables');
subplot(2,1,2)
plot(t,u,'+-');
legend('u');
title('Linear Tangent Steering control');