PROPT Linear Tangent Steering Problem: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
<math> J = t_f </math> | <math> J = t_f </math> | ||
subject to: | subject to: | ||
<math> \frac{d^{2}y_1}{dt^{2}} = a*cos(u) </math> | <math> \frac{d^{2}y_1}{dt^{2}} = a*cos(u) </math> | ||
<math> \frac{d^{2}y_2}{dt^{2}} = a*sin(u) </math> | <math> \frac{d^{2}y_2}{dt^{2}} = a*sin(u) </math> | ||
<math> |u| <= \frac{pi}{2} </math> | <math> |u| <= \frac{pi}{2} </math> | ||
<math> y_{1:2}(0) = 0 </math> | <math> y_{1:2}(0) = 0 </math> | ||
<math> \frac{dy_{1:2}}{dt} = 0 </math> | <math> \frac{dy_{1:2}}{dt} = 0 </math> | ||
<math> a = 1 </math> | <math> a = 1 </math> | ||
<math> y_{2}(f) = 5 </math> | <math> y_{2}(f) = 5 </math> | ||
<math> \frac{dy_{1:2}}{dt}(f) = [45 \ 0] </math> | <math> \frac{dy_{1:2}}{dt}(f) = [45 \ 0] </math> | ||
The following transformation gives a new formulation: | The following transformation gives a new formulation: | ||
<math> x_1 = y_1 </math> | <math> x_1 = y_1 </math> | ||
<math> x_2 = \frac{dy_1}{dt} </math> | <math> x_2 = \frac{dy_1}{dt} </math> | ||
<math> x_3 = y_2 </math> | <math> x_3 = y_2 </math> | ||
<math> x_4 = \frac{dy_2}{dt} </math> | <math> x_4 = \frac{dy_2}{dt} </math> | ||
<math> \frac{dx_1}{dt} = x_2 </math> | <math> \frac{dx_1}{dt} = x_2 </math> | ||
<math> \frac{dx_2}{dt} = a*cos(u) </math> | <math> \frac{dx_2}{dt} = a*cos(u) </math> | ||
<math> \frac{dx_3}{dt} = x_4 </math> | <math> \frac{dx_3}{dt} = x_4 </math> | ||
<math> \frac{dx_4}{dt} = a*sin(u) </math> | <math> \frac{dx_4}{dt} = a*sin(u) </math> | ||
<source lang="matlab"> | <source lang="matlab"> |
Revision as of 08:09, 9 November 2011
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');