PROPT Time Delay 2: 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.2 Example 2 CHAPMAN & HALL/CRC Monographs and Surveys in Pur...")
 
No edit summary
Line 14: Line 14:


<math> J = x_2(t_F) </math>
<math> J = x_2(t_F) </math>


subject to:
subject to:


<math> \frac{dx_1}{dt} = t*x_1 + x_1(t-tau) + u </math>
<math> \frac{dx_1}{dt} = t*x_1 + x_1(t-tau) + u </math>
<math> \frac{dx_2}{dt} = x_1^2 + u^2 </math>
<math> \frac{dx_2}{dt} = x_1^2 + u^2 </math>
<math> tau = 1 </math>
<math> tau = 1 </math>


The initial condition are:
The initial condition are:


<math> x(t<=0) = [1 \ 0] </math>
<math> x(t<=0) = [1 \ 0] </math>
<math> -inf <= u <= inf </math>
<math> -inf <= u <= inf </math>


<source lang="matlab">
<source lang="matlab">

Revision as of 08:13, 9 November 2011

Notice.png

This page is part of the PROPT Manual. See PROPT Manual.

ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS

8.3.2 Example 2

CHAPMAN & HALL/CRC Monographs and Surveys in Pure and Applied Mathematics

Linear time-delay system considered by Palanisamy et al.

Problem Formulation

Find u over t in [0; 2 ] to minimize


subject to:


The initial condition are:


% Copyright (c) 2007-2008 by Tomlab Optimization Inc.

Problem setup

toms t
p1 = tomPhase('p1', t, 0, 2, 50);
setPhase(p1);

tomStates x1 x2
tomControls u

% Initial guess
x0 = {icollocate({x1 == 1; x2 == 0})
    collocate(u == 0)};

% Boundary constraints
cbnd = initial({x1 == 1; x2 == 0});

% Expression for x1(t-tau)
tau = 1;
x1delayed = ifThenElse(t<tau, 1, subs(x1,t,t-tau));

% ODEs and path constraints
ceq = collocate({
    dot(x1) == t.*x1 + x1delayed + u
    dot(x2) == x1.^2 + u.^2});

% Objective
objective = final(x2);

Solve the problem

options = struct;
options.name = 'Time Delay 2';
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.07238 seconds
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - TOMLAB Development license  999007. Valid to 2011-12-31
=====================================================================================
Problem: ---  1: Time Delay 2                   f_k       4.796108536142885900
                                       sum(|constr|)      0.000000305572513302
                              f(x_k) + sum(|constr|)      4.796108841715399000
                                              f(x_0)      0.000000000000000000

Solver: snopt.  EXIT=0.  INFORM=1.
SNOPT 7.2-5 NLP code
Optimality conditions satisfied

FuncEv    1 ConstrEv   32 ConJacEv   32 Iter   27 MinorIter  137
CPU time: 0.062400 sec. Elapsed time: 0.071000 sec. 

Plot result

figure(1)
plot(t,u,'+-');
legend('u');
title('Time Delay 2 control');

TimeDelay2 01.png