PROPT Singular Control 2: Difference between revisions
No edit summary |
|||
| Line 103: | Line 103: | ||
[[File:singularControl2_01.png]] | [[File:singularControl2_01.png]] | ||
[[Category:PROPT Examples]] | |||
Latest revision as of 05:29, 14 February 2012
|
This page is part of the PROPT Manual. See PROPT Manual. |
ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS
10.2.2 Example 2
CHAPMAN & HALL/CRC Monographs and Surveys in Pure and Applied Mathematics
Problem Formulation
Find u over t in [0; 5 ] to minimize
subject to:
Failed to parse (SVG with PNG fallback (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \frac{dx_2}{dt} = u }
Failed to parse (SVG with PNG fallback (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \frac{dx_3}{dt} = x_1^2 }
The initial condition are:
Failed to parse (SVG with PNG fallback (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x(0) = [0 \ 1 \ 0] }
Failed to parse (SVG with PNG fallback (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle -1 <= u <= 1 }
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.Problem setup
toms t
p = tomPhase('p', t, 0, 5, 50);
setPhase(p);
tomStates x1 x2 x3
tomControls u
% Initial guess
x0 = {icollocate({x1 == 0; x2 == 1; x3 == 0})
collocate(u == 0)};
% Box constraints
cbox = {-1 <= collocate(u) <= 1};
% Boundary constraints
cbnd = initial({x1 == 0; x2 == 1; x3 == 0});
% ODEs and path constraints
ceq = collocate({dot(x1) == x2
dot(x2) == u; dot(x3) == x1.^2});
% Objective
objective = final(x3);Solve the problem
options = struct;
options.name = 'Singular Control 2';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t = subs(collocate(t),solution);
u = subs(collocate(u),solution);Problem type appears to be: lpcon
Time for symbolic processing: 0.07418 seconds
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31
=====================================================================================
Problem: --- 1: Singular Control 2 f_k 0.268336059478540940
sum(|constr|) 0.000000004483166969
f(x_k) + sum(|constr|) 0.268336063961707890
f(x_0) 0.000000000000000000
Solver: snopt. EXIT=0. INFORM=1.
SNOPT 7.2-5 NLP code
Optimality conditions satisfied
FuncEv 1 ConstrEv 107 ConJacEv 107 Iter 100 MinorIter 353
CPU time: 0.343202 sec. Elapsed time: 0.333000 sec.
Plot result
figure(1)
plot(t,u,'+-');
legend('u');
title('Singular Control 2 control');