PROPT Disturbance Control: Difference between revisions
From TomWiki
Jump to navigationJump to search
No edit summary |
|||
Line 120: | Line 120: | ||
[[File:disturbanceControl_01.png]] | [[File:disturbanceControl_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. |
Optimal On-Line Control and Classical Regulation Problem, Faina M. Kirillova, Institute of Mathematics National Academy of Sciences of Belarus.
Algorithm of Acting Optimal Controller
Problem Description
Find u over t in [0; 25 ] to minimize:
subject to:
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
p = tomPhase('p', t, 0, 25, 80);
setPhase(p);
tomStates x1 x2 x3 x4
tomControls u
% Box constraints
cbox = {0 <= collocate(u) <= 1};
% Boundary constraints
cbnd = {initial({x1 == 0; x2 == 0
x3 == 2; x4 == 1})
final({x1 == 0; x2 == 0
x3 == 0; x4 == 0})};
% ODEs and path constraints
ceq = collocate({
dot(x1) == x3
dot(x2) == x4
dot(x3) == -x1+x2+u
dot(x4) == 0.1*x1-1.02*x2+0.3*sin(4*t).*(t<9.75)});
% Objective
objective = 0;
Solve the problem
options = struct;
options.name = 'Disturbance Control';
solution = ezsolve(objective, {cbox, cbnd, ceq}, [], options);
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);
u = subs(collocate(u),solution);
Problem type appears to be: lp Time for symbolic processing: 0.069168 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Disturbance Control f_k 0.000000000000000000 sum(|constr|) 0.000000000013822610 f(x_k) + sum(|constr|) 0.000000000013822610 f(x_0) 0.000000000000000000 Solver: CPLEX. EXIT=0. INFORM=1. CPLEX Dual Simplex LP solver Optimal solution found FuncEv 330 Iter 330 CPU time: 0.124801 sec. Elapsed time: 0.080000 sec.
Plot result
figure(1);
subplot(2,2,1)
plot(x1,x3,'-');
title('Disturbance control');
legend('x1 vs x3');
subplot(2,2,2)
plot(x2,x4,'-');
legend('x2 vs x4');
subplot(2,2,3)
plot(t,u,'-');
legend('u');
subplot(2,2,4)
plot(t,0.3*sin(4*t).*(t<9.75),'-');
legend('disturbance');