# Linear Tangent Steering Problem

Benchmarking Optimization Software with COPS Elizabeth D. Dolan and Jorge J. More ARGONNE NATIONAL LABORATORY

## Problem Formulation

Find u(t) over t in [0; tF ] to minimize subject to:        The following transformation gives a new formulation:        % Copyright (c) 2007-2008 by Tomlab Optimization Inc.


## Problem setup

toms t
toms tf
p = tomPhase('p', t, 0, tf, 30);
setPhase(p);

tomStates x1 x2 x3 x4
tomControls u

% Initial guess
x0 = {tf == 1
icollocate({
x1 == 12*t/tf
x2 == 45*t/tf
x3 == 5*t/tf
x4 == 0})};

% Box constraints
cbox = {sqrt(eps) <= tf
-pi/2 <= collocate(u) <= pi/2};

% Boundary constraints
cbnd = {initial({x1 == 0; x2 == 0; x3 == 0; x4 == 0})
final({x2 == 45; x3 == 5; x4 == 0})};

% ODEs and path constraints
a = 100;
ceq = collocate({dot(x1) == x2
dot(x2) == a*cos(u)
dot(x3) == x4
dot(x4) == a*sin(u)});

% Objective
objective = tf;


## Solve the problem

options = struct;
options.name = 'Linear Tangent Steering';
options.solver = 'knitro';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t  = subs(collocate(t),solution);
x1 = subs(collocate(x1),solution);
x2 = subs(collocate(x2),solution);
x3 = subs(collocate(x3),solution);
x4 = subs(collocate(x4),solution);
u  = subs(collocate(u),solution);

Problem type appears to be: lpcon
===== * * * =================================================================== * * *
TOMLAB - Tomlab Optimization Inc. Development license  999001. Valid to 2010-02-05
=====================================================================================
Problem: ---  1: Linear Tangent Steering        f_k       0.554570878334224250
sum(|constr|)      0.000000008174906782
f(x_k) + sum(|constr|)      0.554570886509131000
f(x_0)      1.000000000000000000

Solver: KNITRO.  EXIT=0.  INFORM=0.
Default NLP KNITRO
Locally optimal solution found

FuncEv    9 GradEv    7 HessEv    7 ConstrEv    8 ConJacEv    7 ConHessEv    6 Iter    6 MinorIter    6
CPU time: 0.218750 sec. Elapsed time: 0.110000 sec.


## Plot result

subplot(2,1,1)
plot(t,x1,'*-',t,x2,'*-',t,x3,'*-',t,x4,'*-');
legend('x1','x2','x3','x4');
title('Linear Tangent Steering state variables');

subplot(2,1,2)
plot(t,u,'+-');
legend('u');
title('Linear Tangent Steering control'); 