PROPT Curve Area Maximization: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 10: | Line 10: | ||
<math> J = \int_0^{1} x_1 \mathrm{d}t </math> | <math> J = \int_0^{1} x_1 \mathrm{d}t </math> | ||
subject to: | subject to: | ||
<math> \frac{dx_1}{dt} = u </math> | <math> \frac{dx_1}{dt} = u </math> | ||
<math> \frac{dx_2}{dt} = \sqrt{1+u^2} </math> | <math> \frac{dx_2}{dt} = \sqrt{1+u^2} </math> | ||
<math> x(t_0) = [0 \ 0] </math> | <math> x(t_0) = [0 \ 0] </math> | ||
<math> x(t_f) = [0 \ \frac{pi}{3}] </math> | <math> x(t_f) = [0 \ \frac{pi}{3}] </math> | ||
<source lang="matlab"> | <source lang="matlab"> | ||
Line 56: | Line 61: | ||
<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 76: | ||
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> | ||
Line 87: | Line 92: | ||
[[File:curveAreaMaximization_01.png]] | [[File:curveAreaMaximization_01.png]] | ||
[[Category:PROPT Examples]] |
Latest revision as of 04:57, 14 February 2012
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')