PROPT Time Delay 1 (Approximate): Difference between revisions
From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the PROPT Manual|link=PROPT Manual}} ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS 8.3.1 Example 1 CHAPMAN & HALL/CRC Monographs and Surveys in Pur...") |
No edit summary |
||
Line 14: | Line 14: | ||
<math> J = x_3(t_F) </math> | <math> J = x_3(t_F) </math> | ||
subject to: | subject to: | ||
<math> \frac{dx_1}{dt} = x_2 </math> | <math> \frac{dx_1}{dt} = x_2 </math> | ||
<math> \frac{dx_2}{dt} = -10*x_1-5*x_2-2*x_1(t-tau)-x_2(t-tau)+u </math> | <math> \frac{dx_2}{dt} = -10*x_1-5*x_2-2*x_1(t-tau)-x_2(t-tau)+u </math> | ||
<math> \frac{dx_3}{dt} = 0.5*(10*x_1^2+x_2^2+u^2) </math> | <math> \frac{dx_3}{dt} = 0.5*(10*x_1^2+x_2^2+u^2) </math> | ||
<math> tau = 0.25 </math> | <math> tau = 0.25 </math> | ||
A Taylor series expansion gives: | A Taylor series expansion gives: | ||
<math> \frac{dx_2}{dt} \approx (-12*x_1+(2*tau-6)*x_2 + u)/(1-tau) </math> | <math> \frac{dx_2}{dt} \approx (-12*x_1+(2*tau-6)*x_2 + u)/(1-tau) </math> | ||
The initial condition are: | The initial condition are: | ||
<math> x(0) = [1 \ 1 \ 0] </math> | <math> x(0) = [1 \ 1 \ 0] </math> | ||
<math> -inf <= u <= inf </math> | <math> -inf <= u <= inf </math> | ||
<source lang="matlab"> | <source lang="matlab"> |
Latest revision as of 08:13, 9 November 2011
This page is part of the PROPT Manual. See PROPT Manual. |
ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS
8.3.1 Example 1
CHAPMAN & HALL/CRC Monographs and Surveys in Pure and Applied Mathematics
Linear time-delay system used for optimal control studies by Chan and Perkins
Problem Formulation
Find u over t in [0; 5 ] to minimize
subject to:
A Taylor series expansion gives:
The initial condition are:
% Copyright (c) 2007-2008 by Tomlab Optimization Inc.
Problem setup
toms t
p = tomPhase('p', t, 0, 5, 50);
setPhase(p);
tomStates x1 x2 x3
tomControls u
% Initial guess
x0 = {icollocate({x1 == 1; x2 == 1; x3 == 0})
collocate(u == 0)};
% Boundary constraints
cbnd = initial({x1 == 1; x2 == 1; x3 == 0});
% ODEs and path constraints
tau = 0.25;
ceq = collocate({dot(x1) == x2
dot(x2) == (-12*x1+(2*tau-6)*x2 + u)/(1-tau)
dot(x3) == 0.5*(10*x1.^2+x2.^2+u.^2)});
% Objective
objective = final(x3);
Solve the problem
options = struct;
options.name = 'Time Delay 1 Appr.';
solution = ezsolve(objective, {cbnd, ceq}, x0, options);
t = subs(collocate(t),solution);
u = subs(collocate(u),solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.093181 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Time Delay 1 Appr. f_k 2.387051416916647900 sum(|constr|) 0.000000035059748131 f(x_k) + sum(|constr|) 2.387051451976395900 f(x_0) 0.000000000000000000 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 67 ConJacEv 67 Iter 48 MinorIter 213 CPU time: 0.249602 sec. Elapsed time: 0.256000 sec.
Plot result
figure(1)
plot(t,u,'+-');
legend('u');
title('Time Delay 1 control');