PROPT High Dimensional Control: Difference between revisions
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
<math> \int_0^{0.2} 5.8*(q*x_1-u_4)-3.7*u_1-4.1*u_2+ </math> | <math> \int_0^{0.2} 5.8*(q*x_1-u_4)-3.7*u_1-4.1*u_2+ </math> | ||
<math> q*(23*x_4+11*x_5+28*x_6+35*x_7)-5.0*u_3^2-0.099 \mathrm{d}t </math> | <math> q*(23*x_4+11*x_5+28*x_6+35*x_7)-5.0*u_3^2-0.099 \mathrm{d}t </math> | ||
subject to: | subject to: | ||
<math> \frac{dx_1}{dt} = u_4-q*x_1-17.6*x_1*x_2-23*x_1*x_6*u_3 </math> | <math> \frac{dx_1}{dt} = u_4-q*x_1-17.6*x_1*x_2-23*x_1*x_6*u_3 </math> | ||
<math> \frac{dx_2}{dt} = u_1-q*x_2-17.6*x_1*x_2-146*x_2*x_3 </math> | <math> \frac{dx_2}{dt} = u_1-q*x_2-17.6*x_1*x_2-146*x_2*x_3 </math> | ||
<math> \frac{dx_3}{dt} = u_2-q*x_3-73*x_2*x_3 </math> | <math> \frac{dx_3}{dt} = u_2-q*x_3-73*x_2*x_3 </math> | ||
<math> \frac{dx_4}{dt} = -q*x_4+35.2*x_1*x_2-51.3*x_4*x_5 </math> | <math> \frac{dx_4}{dt} = -q*x_4+35.2*x_1*x_2-51.3*x_4*x_5 </math> | ||
<math> \frac{dx_5}{dt} = -q*x_5+219*x_2*x_3-51.3*x_4*x_5 </math> | <math> \frac{dx_5}{dt} = -q*x_5+219*x_2*x_3-51.3*x_4*x_5 </math> | ||
<math> \frac{dx_6}{dt} = -q*x_6+102.6*x_4*x_5-23*x_1*x_6*u_3 </math> | <math> \frac{dx_6}{dt} = -q*x_6+102.6*x_4*x_5-23*x_1*x_6*u_3 </math> | ||
<math> \frac{dx_7}{dt} = -q*x_7+46*x_1*x_6*u_3 </math> | <math> \frac{dx_7}{dt} = -q*x_7+46*x_1*x_6*u_3 </math> | ||
where | where | ||
<math> q = u_1+u_2+u_4 </math> | <math> q = u_1+u_2+u_4 </math> | ||
<math> x(0) = [0.1883 \ 0.2507 \ 0.0467 \ 0.0899 \ 0.1804 \ 0.1394 \ 0.1046]' </math> | <math> x(0) = [0.1883 \ 0.2507 \ 0.0467 \ 0.0899 \ 0.1804 \ 0.1394 \ 0.1046]' </math> | ||
<math> 0 <= u_1 <= 20 </math> | <math> 0 <= u_1 <= 20 </math> | ||
<math> 0 <= u_2 <= 6 </math> | <math> 0 <= u_2 <= 6 </math> | ||
<math> 0 <= u_3 <= 4 </math> | <math> 0 <= u_3 <= 4 </math> | ||
<math> 0 <= u_4 <= 20 </math> | <math> 0 <= u_4 <= 20 </math> | ||
<source lang="matlab"> | <source lang="matlab"> | ||
Revision as of 08:08, 9 November 2011
|
This page is part of the PROPT Manual. See PROPT Manual. |
Problem 7: DYNOPT User's Guide version 4.1.0
M. Cizniar, M. Fikar, M. A. Latifi, MATLAB Dynamic Optimisation Code DYNOPT. User's Guide, Technical Report, KIRP FCHPT STU Bratislava, Slovak Republic, 2006.
Problem description
Find u over t in [0; 0.2 ] to minimize
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 q*(23*x_4+11*x_5+28*x_6+35*x_7)-5.0*u_3^2-0.099 \mathrm{d}t }
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_1}{dt} = u_4-q*x_1-17.6*x_1*x_2-23*x_1*x_6*u_3 }
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_1-q*x_2-17.6*x_1*x_2-146*x_2*x_3 }
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} = u_2-q*x_3-73*x_2*x_3 }
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_4}{dt} = -q*x_4+35.2*x_1*x_2-51.3*x_4*x_5 }
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_5}{dt} = -q*x_5+219*x_2*x_3-51.3*x_4*x_5 }
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_6}{dt} = -q*x_6+102.6*x_4*x_5-23*x_1*x_6*u_3 }
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_7}{dt} = -q*x_7+46*x_1*x_6*u_3 }
where
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 q = u_1+u_2+u_4 }
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.1883 \ 0.2507 \ 0.0467 \ 0.0899 \ 0.1804 \ 0.1394 \ 0.1046]' }
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 0 <= u_1 <= 20 }
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 0 <= u_2 <= 6 }
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 0 <= u_3 <= 4 }
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 0 <= u_4 <= 20 }
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.Problem setup
toms t
p = tomPhase('p', t, 0, 0.2, 20);
setPhase(p);
tomStates x1 x2 x3 x4 x5 x6 x7
tomControls u1 u2 u3 u4
x = [x1; x2; x3; x4; x5; x6; x7];
u = [u1; u2; u3; u4];
x0i = [0.1883;0.2507;0.0467;0.0899;0.1804;0.1394;0.1046];
x0 = icollocate({x1==x0i(1),x2==x0i(2),x3==x0i(3),x4==x0i(4),x5==x0i(5),x6==x0i(6),x7==x0i(7)});
% Box constraints and boundary
uL = zeros(4,1); uU = [20;6;4;20];
cbb = {collocate(uL <= u <= uU)
initial(x == x0i)};
% ODEs and path constraints
q = u(1)+u(2)+u(4);
ceq = collocate({
dot(x1) == u4-q.*x1-17.6*x1.*x2-23*x1.*x6.*u3;
dot(x2) == u1-q.*x2-17.6*x1.*x2-146*x2.*x3;
dot(x3) == u2-q.*x3-73*x2.*x3;
dot(x4) == -q.*x4+35.2*x1.*x2-51.3*x4.*x5;
dot(x5) == -q.*x5+219*x2.*x3-51.3*x4.*x5;
dot(x6) == -q.*x6+102.6*x4.*x5-23*x1.*x6.*u3;
dot(x7) == -q.*x7+46*x1.*x6.*u3});
% Objective
objective = integrate(-(5.8*(q.*x1-u4)-3.7*u1-4.1*u2+...
q.*(23*x4+11*x5+28*x6+35*x7)-5.0*u3.^2-0.099));Solve the problem
options = struct;
options.name = 'High Dim Control';
solution = ezsolve(objective, {cbb, ceq}, x0, options);Problem type appears to be: qpcon
Time for symbolic processing: 0.52418 seconds
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31
=====================================================================================
Problem: --- 1: High Dim Control f_k -21.834326989498166000
sum(|constr|) 0.000000000215774218
f(x_k) + sum(|constr|) -21.834326989282392000
f(x_0) 0.000000000000000000
Solver: snopt. EXIT=0. INFORM=1.
SNOPT 7.2-5 NLP code
Optimality conditions satisfied
FuncEv 1 ConstrEv 95 ConJacEv 95 Iter 88 MinorIter 489
CPU time: 0.343202 sec. Elapsed time: 0.344000 sec.
Plot result
figure(1)
ezplot(x);
legend('x1','x2','x3','x4','x5','x6','x7');
title('High Dim Control state variables');
figure(2)
ezplot(u);
legend('u1','u2','u3','u4');
title('High Dim Control control');
