PROPT Singular Control 5: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
|||
Line 113: | Line 113: | ||
[[File:singularControl5_01.png]] | [[File:singularControl5_01.png]] | ||
[[Category:PROPT Examples]] |
Latest revision as of 05:28, 14 February 2012
This page is part of the PROPT Manual. See PROPT Manual. |
ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS
10.3 Yeo's singular control problem
CHAPMAN & HALL/CRC Monographs and Surveys in Pure and Applied Mathematics
Problem Formulation
Find u over t in [0; 1 ] to minimize:
subject to:
The initial condition are:
The state x4 is implemented as a cost directly. x4 in the implementation is x5. u has a low limit of 9 in the code.
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
p = tomPhase('p', t, 0, 1, 80);
setPhase(p)
tomStates x1 x2 x3 x4
tomControls u
% Initial guess
x0 = {icollocate({x1 == 0; x2 == -1
x3 == -sqrt(5); x4 == 0})
collocate(u == 3)};
% Box constraints
cbox = {0 <= collocate(u) <= 10};
% Boundary constraints
cbnd = initial({x1 == 0; x2 == -1
x3 == -sqrt(5); x4 == 0});
% ODEs and path constraints
ceq = collocate({dot(x1) == x2
dot(x2) == -x3.*u + 16*x4 - 8
dot(x3) == u; dot(x4) == 1});
% Objective
objective = integrate(x1.^2 + x2.^2 + ...
0.0005*(x2+16*x4-8-0.1*x3.*u.^2).^2);
Solve the problem
options = struct;
options.name = 'Singular Control 5';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t = subs(collocate(t),solution);
u = subs(collocate(u),solution);
Problem type appears to be: con Time for symbolic processing: 0.16034 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Singular Control 5 f_k 0.119318613152343460 sum(|constr|) 0.000000483936371958 f(x_k) + sum(|constr|) 0.119319097088715420 f(x_0) 1.024412849382206200 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 374 GradEv 372 ConstrEv 372 ConJacEv 372 Iter 345 MinorIter 938 CPU time: 4.180827 sec. Elapsed time: 4.185000 sec.
Plot result
figure(1)
plot(t,u,'+-');
legend('u');
title('Singular Control 5 control');