PROPT Flow in a Channel: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 8: | Line 8: | ||
<math> J = 0 </math> | <math> J = 0 </math> | ||
subject to: | subject to: | ||
<math> \frac{d^{4}u}{dt^{4}} = R*(\frac{du}{dt}*\frac{d^{2}u}{dt^{2}}-u*\frac{d^{3}u}{dt^{3}}) </math> | <math> \frac{d^{4}u}{dt^{4}} = R*(\frac{du}{dt}*\frac{d^{2}u}{dt^{2}}-u*\frac{d^{3}u}{dt^{3}}) </math> | ||
<math> u_0 = 0 </math> | <math> u_0 = 0 </math> | ||
<math> u_1 = 1 </math> | <math> u_1 = 1 </math> | ||
<math> \frac{du}{dt}_0 = 0 </math> | <math> \frac{du}{dt}_0 = 0 </math> | ||
<math> \frac{du}{dt}_1 = 0 </math> | <math> \frac{du}{dt}_1 = 0 </math> | ||
<math> R = 10 </math> | <math> R = 10 </math> | ||
After some transformation we get this problem: | After some transformation we get this problem: | ||
<math> \frac{dx_1}{dt} = x_2 </math> | <math> \frac{dx_1}{dt} = x_2 </math> | ||
<math> \frac{dx_2}{dt} = x_3 </math> | <math> \frac{dx_2}{dt} = x_3 </math> | ||
<math> \frac{dx_3}{dt} = x_4 </math> | <math> \frac{dx_3}{dt} = x_4 </math> | ||
<math> \frac{dx_4}{dt} = R*(x_2*x_3-x_1*x_4) </math> | <math> \frac{dx_4}{dt} = R*(x_2*x_3-x_1*x_4) </math> | ||
<math> x_1(0) = 0 </math> | <math> x_1(0) = 0 </math> | ||
<math> x_1(1) = 1 </math> | <math> x_1(1) = 1 </math> | ||
<math> x_2(0) = 0 </math> | <math> x_2(0) = 0 </math> | ||
<math> x_2(1) = 0 </math> | <math> x_2(1) = 0 </math> | ||
<source lang="matlab"> | <source lang="matlab"> | ||
Line 81: | Line 96: | ||
<pre> | <pre> | ||
Problem type appears to be: lpcon | Problem type appears to be: lpcon | ||
Time for symbolic processing: 0. | Time for symbolic processing: 0.095156 seconds | ||
Starting numeric solver | Starting numeric solver | ||
===== * * * =================================================================== * * * | ===== * * * =================================================================== * * * | ||
Line 96: | Line 111: | ||
FuncEv 1 ConstrEv 11 ConJacEv 11 Iter 9 MinorIter 91 | FuncEv 1 ConstrEv 11 ConJacEv 11 Iter 9 MinorIter 91 | ||
CPU time: 0. | CPU time: 0.015600 sec. Elapsed time: 0.029000 sec. | ||
</pre> | </pre> | ||
Line 110: | Line 125: | ||
[[File:channelFlow_01.png]] | [[File:channelFlow_01.png]] | ||
[[Category:PROPT Examples]] |
Latest revision as of 04:55, 14 February 2012
This page is part of the PROPT Manual. See PROPT Manual. |
Benchmarking Optimization Software with COPS Elizabeth D. Dolan and Jorge J. More ARGONNE NATIONAL LABORATORY
Problem Formulation
Find u(t) over t in [0; 1 ] to minimize
subject to:
After some transformation we get this problem:
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
p = tomPhase('p', t, 0, 1, 30);
setPhase(p);
tomStates x1 x2 x3 x4
x0 = icollocate({x1 == 3*t.^2 - 2*t.^3
x2 == 2*t - 6*t.^2
x3 == t - 12*t
x4 == -12});
% Boundary constraints
cbnd = {initial({x1 == 0; x2 == 0})
final({x1 == 1; x2 == 0})};
% Various constants and expressions
R = 10;
% ODEs and path constraints
ceq = collocate({dot(x1) == x2
dot(x2) == x3; dot(x3) == x4
dot(x4) == R*(x2.*x3-x1.*x4)});
% Objective
objective = 1; %(feasibility problem)
Solve the problem
options = struct;
options.name = 'Flow in a Channel Steering';
solution = ezsolve(objective, {cbnd, ceq}, x0, options);
% Extract optimal states and controls from solution
t = subs(collocate(t),solution);
x1 = subs(collocate(x1),solution);
x2 = subs(collocate(x2),solution);
x3 = subs(collocate(x3),solution);
x4 = subs(collocate(x4),solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.095156 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Flow in a Channel Steering f_k 1.000000000000000000 sum(|constr|) 0.000000000018584877 f(x_k) + sum(|constr|) 1.000000000018584900 f(x_0) 0.000000000000000000 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 11 ConJacEv 11 Iter 9 MinorIter 91 CPU time: 0.015600 sec. Elapsed time: 0.029000 sec.
Plot result
figure(1)
plot(t,x2,'*-');
legend('x2');
title('Flow in a Channel state variables');