PROPT Goddard Rocket, Maximum Ascent
From TomWiki
Jump to navigationJump to search
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 ] to minimize
subject to:
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
toms t_f
Solve the problem, using a successively larger number collocation points
for n=[20 50 100]
p = tomPhase('p', t, 0, t_f, n);
setPhase(p);
tomStates v h m
tomControls T
% Initial guess
if n==20
x0 = {t_f == 1
icollocate({v == 620; h == 1
m == 1-0.4*t/t_f})
collocate(T == 0)};
else
x0 = {t_f == tfopt
icollocate({v == vopt; h == hopt
m == mopt})
collocate(T == Topt)};
end
% Box constraints
cbox = {0.1 <= t_f <= 1
icollocate({
0 <= v; 1 <= h
0.6 <= m <= 1
0 <= T <= 3.5})};
% Boundary constraints
cbnd = {initial({v == 0; h == 1; m == 1})
final({m == 0.6})};
b = 500;
D = 0.5*620*v.^2.*exp(-b*h);
g = 1./h.^2;
c = 0.5;
% ODEs and path constraints
ceq = collocate({dot(v) == (T-D)./m-g
dot(h) == v; dot(m) == -T/c});
% Objective
objective = -final(h);
Solve the problem
options = struct;
options.name = 'Goddard Rocket';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
% Optimal v and more to use as starting guess
vopt = subs(v, solution);
hopt = subs(h, solution);
mopt = subs(m, solution);
Topt = subs(T, solution);
tfopt = subs(t_f, solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.18806 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Goddard Rocket f_k -1.025133422819133800 sum(|constr|) 0.000006395961328869 f(x_k) + sum(|constr|) -1.025127026857805000 f(x_0) -0.999999999999998220 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 58 ConJacEv 58 Iter 30 MinorIter 1241 CPU time: 0.078000 sec. Elapsed time: 0.075000 sec.
Problem type appears to be: lpcon Time for symbolic processing: 0.18523 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Goddard Rocket f_k -1.025311927405713400 sum(|constr|) 0.000015914331448424 f(x_k) + sum(|constr|) -1.025296013074265000 f(x_0) -1.025133233935944700 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 23 ConJacEv 23 Iter 14 MinorIter 536 CPU time: 0.124801 sec. Elapsed time: 0.130000 sec.
Problem type appears to be: lpcon Time for symbolic processing: 0.19339 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Goddard Rocket f_k -1.025328777109888200 sum(|constr|) 0.000000000007557030 f(x_k) + sum(|constr|) -1.025328777102331200 f(x_0) -1.025311927405706300 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 12 ConJacEv 12 Iter 7 MinorIter 554 CPU time: 0.405603 sec. Elapsed time: 0.411000 sec.
end
t = subs(collocate(t),solution);
v = subs(collocate(vopt),solution);
h = subs(collocate(hopt),solution);
m = subs(collocate(mopt),solution);
T = subs(collocate(Topt),solution);
Plot result
subplot(2,1,1)
plot(t,v,'*-',t,h,'*-',t,m,'*-');
legend('v','h','m');
title('Goddard Rocket state variables');
subplot(2,1,2)
plot(t,T,'+-');
legend('T');
title('Goddard Rocket control');