PROPT Goddard Rocket, Maximum Ascent, Final time fixed, Singular solution: Difference between revisions
From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the PROPT Manual|link=PROPT Manual}} Example 7.2 (ii) from the paper: H. Maurer, "Numerical solution of singular control problems using multi...") |
No edit summary |
||
Line 1: | Line 1: | ||
{{Part Of Manual|title=the PROPT | {{Part Of Manual|title=the PROPT Manual|link=[[PROPT|PROPT Manual]]}} | ||
Example 7.2 (ii) from the paper: H. Maurer, "Numerical solution of singular control problems using multiple shooting techniques", Journal of Optimization Theory and Applications, Vol. 18, No. 2, 1976, pp. 235-257 | Example 7.2 (ii) from the paper: H. Maurer, "Numerical solution of singular control problems using multiple shooting techniques", Journal of Optimization Theory and Applications, Vol. 18, No. 2, 1976, pp. 235-257 | ||
Line 173: | Line 173: | ||
title('Goddard Rocket control'); | title('Goddard Rocket control'); | ||
</source> | </source> | ||
[[File:goddardSingular2_01.png]] |
Revision as of 14:23, 2 November 2011
This page is part of the PROPT Manual. See PROPT Manual. |
Example 7.2 (ii) from the paper: H. Maurer, "Numerical solution of singular control problems using multiple shooting techniques", Journal of Optimization Theory and Applications, Vol. 18, No. 2, 1976, pp. 235-257
Remark: You can vary the fixed final time t_f to obtain Fig. 8 in the paper
L.G. van Willigenburg, W.L. de Koning
Copyright (c) 2007-2009 by Tomlab Optimization Inc.
Problem setup
toms t
% Parameters
aalpha = 0.01227; bbeta = 0.145e-3; c = 2060; g0 = 9.81;
r0 = 6.371e6; r02=r0*r0; m0 = 214.839; mf = 67.9833; Fm = 9.525515;
t_f = 100; %Paper value 206.661;
Solve the problem, using a successively larger number of collocation points
nvec = [20 40 60];
for i=1:length(nvec);
n = nvec(i);
p = tomPhase('p', t, 0, t_f, n);
setPhase(p);
tomStates h v m
tomControls F
% Initial guess
if i==1
x0 = {icollocate({v == 10*t; h == 10*t^2
m == m0+(t/t_f)*(mf-m0)})
collocate(F == Fm)};
else
x0 = {icollocate({v == vopt; h == hopt
m == mopt})
collocate(F == Fopt)};
end
% Box constraints
cbox = {icollocate({0 <= v; 0 <= h
mf <= m <= m0
0 <= F <= Fm})};
% Boundary constraints
cbnd = {initial({v == 0; h == 0; m == m0})
final({m == mf})};
D = aalpha*v.^2.*exp(-bbeta*h);
g = g0; % or g0*r02./(r0+h).^2;
% ODEs and path constraints
ceq = collocate({dot(h) == v
m*dot(v) == F*c-D-g*m
dot(m) == -F});
% Objective
objective = -final(h);
Solve the problem
options = struct;
options.name = 'Goddard Rocket';
if i==1
options.solver = 'multiMin';
options.xInit = 20;
end
%options.scale = 'auto'
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);
Fopt = subs(F, solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.14168 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Goddard Rocket - Trial 6 f_k -108076.040035191810000000 sum(|constr|) 0.000056143369498595 f(x_k) + sum(|constr|)-108076.039979048440000000 Solver: multiMin with local solver snopt. EXIT=0. INFORM=0. Find local optima using multistart local search Did 20 local tries. Found 1 global, 1 minima. TotFuncEv 20. TotConstrEv 2459 FuncEv 20 ConstrEv 2459 ConJacEv 45 Iter 1218 CPU time: 2.043613 sec. Elapsed time: 2.060000 sec.
Problem type appears to be: lpcon Time for symbolic processing: 0.13751 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Goddard Rocket f_k -108220.931718003210000000 sum(|constr|) 0.000357162660653284 f(x_k) + sum(|constr|)-108220.931360840550000000 f(x_0)-108076.040035191220000000 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 20 ConJacEv 20 Iter 19 MinorIter 533 CPU time: 0.062400 sec. Elapsed time: 0.076000 sec.
Problem type appears to be: lpcon Time for symbolic processing: 0.136 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Goddard Rocket f_k -108245.171344193350000000 sum(|constr|) 0.000396801422444240 f(x_k) + sum(|constr|)-108245.170947391930000000 f(x_0)-108220.931718002890000000 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 31 ConJacEv 31 Iter 23 MinorIter 749 CPU time: 0.234001 sec. Elapsed time: 0.228000 sec.
end
t = subs(collocate(t),solution);
v = subs(collocate(vopt),solution);
h = subs(collocate(hopt),solution);
m = subs(collocate(mopt),solution);
F = subs(collocate(Fopt),solution);
Plot result
subplot(2,1,1)
plot(t,v/1e3,'*-',t,h/1e5,'*-',t,m/1e2,'*-');
legend('v','h','m');
title('Goddard Rocket state variables');
subplot(2,1,2)
plot(t,F,'+-');
legend('F');
title('Goddard Rocket control');