# Singular Control 5

ITERATIVE DYNAMIC PROGRAMMING, REIN LUUS

10.3 Yeo's singular control problem

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

## Problem Formulation

Find u over t in [0; 1 ] to minimize: subject to:     The initial condition are:  The state x4 is implemented as a cost directly. x4 in the implementation is x5. u has a low limit of 9 in the code.

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


## Problem setup

toms t
p = tomPhase('p', t, 0, 1, 80);
setPhase(p)

tomStates x1 x2 x3 x4
tomControls u

% Initial guess
x0 = {icollocate({x1 == 0; x2 == -1
x3 == -sqrt(5); x4 == 0})
collocate(u == 3)};

% Box constraints
cbox = {0 <= collocate(u) <= 10};

% Boundary constraints
cbnd = initial({x1 == 0; x2 == -1
x3 == -sqrt(5); x4 == 0});

% ODEs and path constraints
ceq = collocate({dot(x1) == x2
dot(x2) == -x3.*u + 16*x4 - 8
dot(x3) == u; dot(x4) == 1});

% Objective
objective = integrate(x1.^2 + x2.^2 + ...
0.0005*(x2+16*x4-8-0.1*x3.*u.^2).^2);


## Solve the problem

options = struct;
options.name = 'Singular Control 5';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t = subs(collocate(t),solution);
u = subs(collocate(u),solution);

Problem type appears to be: con
===== * * * =================================================================== * * *
TOMLAB - Tomlab Optimization Inc. Development license  999001. Valid to 2010-02-05
=====================================================================================
Problem: ---  1: Singular Control 5             f_k       0.119253718195990290
sum(|constr|)      0.000000404768612994
f(x_k) + sum(|constr|)      0.119254122964603280
f(x_0)      1.024412849382205600

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

FuncEv  105 GradEv  103 ConstrEv  103 ConJacEv  103 Iter   92 MinorIter  699
CPU time: 2.875000 sec. Elapsed time: 2.890000 sec.


## Plot result

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