PROPT Radio telescope
From TomWiki
Jump to navigationJump to search
This page is part of the PROPT Manual. See PROPT Manual. |
Problem description
Time-optimal positioning of a radio telescope with bounded control.
Programmers: Gerard Van Willigenburg (Wageningen University) Willem De Koning (retired from Delft University of Technology)
% Copyright (c) 2009-2009 by Tomlab Optimization Inc.
Problem setup
% Array with consecutive number of collocation points
narr = [20 40];
% Free final time
toms t t_f
for n=narr
p = tomPhase('p', t, 0, t_f, n);
setPhase(p)
tomStates x1 x2 x3
tomControls u1
% Initial & terminal states
xi = [0; 0; 0];
xf = [1; 0; 0];
% Initial guess
if n==narr(1)
x0 = {t_f == 5; icollocate({x1 == xi(1); x2 == xi(2)
x3 == xi(3)})
collocate({u1 == 0})};
else
x0 = {t_f == tfopt; icollocate({x1 == xopt1; x2 == xopt2
x3 == xopt3})
collocate({u1 == uopt1})};
end
% Box constraints
cbox = {-1 <= collocate(u1) <= 1, 0.1 <= t_f <= 10};
% Boundary constraints
cbnd = {initial({x1 == xi(1); x2 == xi(2); x3 == xi(3)})
final({x1 == xf(1); x2 == xf(2); x3 == xf(3)})};
% ODEs and path constraints
dx1 = x2;
dx2 = -0.5*x2-0.1*x2./sqrt(x2.*x2+1e-4)+x3;
dx3 = -2*x3+2*u1;
ceq = collocate({
dot(x1) == dx1
dot(x2) == dx2
dot(x3) == dx3});
% Objective
objective = t_f;
Solve the problem
options = struct;
options.name = 'Radio telescope';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
tfopt = subs(t_f,solution);
xopt1 = subs(x1,solution);
xopt2 = subs(x2,solution);
xopt3 = subs(x3,solution);
uopt1 = subs(u1,solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.15665 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Radio telescope f_k 2.866900592275517300 sum(|constr|) 0.000001022940522519 f(x_k) + sum(|constr|) 2.866901615216039800 f(x_0) 5.000000000000000000 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 41 ConJacEv 41 Iter 22 MinorIter 169 CPU time: 0.046800 sec. Elapsed time: 0.039000 sec.
Problem type appears to be: lpcon Time for symbolic processing: 0.15618 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Radio telescope f_k 2.859991999288975100 sum(|constr|) 0.000002602280475099 f(x_k) + sum(|constr|) 2.859994601569450200 f(x_0) 2.866900592275517300 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 5 ConJacEv 5 Iter 4 MinorIter 133 CPU time: 0.031200 sec. Elapsed time: 0.023000 sec.
end
figure(1)
subplot(2,1,1);
ezplot([x1; x2; x3]); legend('x1','x2','x3');
title('Radio telescope states');
subplot(2,1,2);
ezplot(u1); legend('u1');
title('Radio telescope controls');