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
Find u over t in [0; 5 ] to minimize
| J = x3(tF) |
subject to:
| = x2 |
| = −10*x1−5*x2−2*x1(t−tau)−x2(t−tau)+u |
| = 0.5*(10*x12+x22+u2) |
| tau = 0.25 |
A Taylor series expansion gives:
| ≈ (−12*x1+(2*tau−6)*x2 + u)/(1−tau) |
The initial condition are:
| x(0) = [1 1 0] |
| −inf <= u <= inf |
Reference: [25]
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);
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
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - Tomlab Optimization Inc. Development license 999001. Valid to 2011-02-05
=====================================================================================
Problem: --- 1: Time Delay 1 Appr. f_k 2.387051416916649200
sum(|constr|) 0.000000035059442522
f(x_k) + sum(|constr|) 2.387051451976091700
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 214
CPU time: 0.671875 sec. Elapsed time: 0.734000 sec.
figure(1)
plot(t,u,'+-');
legend('u');
title('Time Delay 1 control');