PROPT Curve Area Maximization: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 56: | Line 56: | ||
<pre> | <pre> | ||
Problem type appears to be: lpcon | Problem type appears to be: lpcon | ||
Time for symbolic processing: 0. | Time for symbolic processing: 0.070311 seconds | ||
Starting numeric solver | Starting numeric solver | ||
===== * * * =================================================================== * * * | ===== * * * =================================================================== * * * | ||
Line 71: | Line 71: | ||
FuncEv 1 ConstrEv 120 ConJacEv 120 Iter 99 MinorIter 137 | FuncEv 1 ConstrEv 120 ConJacEv 120 Iter 99 MinorIter 137 | ||
CPU time: 0.062400 sec. Elapsed time: 0. | CPU time: 0.062400 sec. Elapsed time: 0.065000 sec. | ||
</pre> | </pre> |
Revision as of 09:04, 8 November 2011
This page is part of the PROPT Manual. See PROPT Manual. |
On smooth optimal control determination, Ilya Ioslovich and Per-Olof Gutman, Technion, Israel Institute of Technology.
Example 3: Maximal area under a curve of given length
Problem Description
Find u over t in [0; 1 ] to minimize:
subject to:
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
p = tomPhase('p', t, 0, 1, 20);
setPhase(p);
tomStates x1 x2
tomControls u
x0 = {icollocate({x1 == 0.1, x2 == t*pi/3}), collocate(u==0.5-t)};
% Boundary constraints
cbnd = {initial({x1 == 0; x2 == 0})
final({x1 == 0; x2 == pi/3})};
% ODEs and path constraints
ceq = collocate({dot(x1) == u
dot(x2) == sqrt(1+u.^2)});
% Objective
objective = -integrate(x1);
Solve the problem
options = struct;
options.name = 'Curve Area Maximization';
solution = ezsolve(objective, {cbnd, ceq}, x0, options);
Problem type appears to be: lpcon Time for symbolic processing: 0.070311 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Curve Area Maximization f_k -0.090586073472539344 sum(|constr|) 0.000000003581147677 f(x_k) + sum(|constr|) -0.090586069891391660 f(x_0) -0.100000000000000200 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 120 ConJacEv 120 Iter 99 MinorIter 137 CPU time: 0.062400 sec. Elapsed time: 0.065000 sec.
Plot result
t = subs(collocate(t),solution);
x1 = subs(collocate(x1),solution);
figure(1);
plot(t,x1,'*-');
xlabel('t')
ylabel('x1')