PROPT Singular Control 1: 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 10.2.1 Example 1 CHAPMAN & HALL/CRC Monographs and Surveys in Pu...")
 
No edit summary
Line 12: Line 12:


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


subject to:
subject to:


<math> \frac{dx_1}{dt} = u </math>
<math> \frac{dx_1}{dt} = u </math>
<math> \frac{dx_2}{dt} = 0.5*x_1^2 </math>
<math> \frac{dx_2}{dt} = 0.5*x_1^2 </math>


The initial condition are:
The initial condition are:


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


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

Revision as of 08:12, 9 November 2011

Notice.png

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

ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS

10.2.1 Example 1

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

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
p = tomPhase('p', t, 0, 2, 50);
setPhase(p);

tomStates x1 x2
tomControls u

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

% Box constraints
cbox = {-1 <= collocate(u) <= 1};

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

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

% Objective
objective = final(x2);

Solve the problem

options = struct;
options.name = 'Singular Control 1';
solution = ezsolve(objective, {cbox, 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.064118 seconds
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - TOMLAB Development license  999007. Valid to 2011-12-31
=====================================================================================
Problem: ---  1: Singular Control 1             f_k       0.166665695130345510
                                       sum(|constr|)      0.000000330654862346
                              f(x_k) + sum(|constr|)      0.166666025785207870
                                              f(x_0)      0.000000000000000000

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

FuncEv    1 ConstrEv   41 ConJacEv   41 Iter   39 MinorIter  164
CPU time: 0.078001 sec. Elapsed time: 0.079000 sec. 

Plot result

figure(1)
plot(t,u,'+-');
legend('u');
title('Singular Control 1 control');

SingularControl1 01.png