PROPT High Dimensional Control: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
|||
Line 133: | Line 133: | ||
[[File:highDimControl_02.png]] | [[File:highDimControl_02.png]] | ||
[[Category:PROPT Examples]] |
Latest revision as of 05:05, 14 February 2012
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
subject to:
where
% 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');