# Curve Area Maximization

On smooth optimal control determination, Ilya Ioslovich and Per-Olof Gutman, Technion, Israel Institute of Technology.

Example 3: Maximal area under a curve of given length

## Problem Description

Find u over t in [0; 1 ] to minimize: subject to:    % Copyright (c) 2007-2008 by Tomlab Optimization Inc.


## Problem setup

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

tomStates x1 x2
tomControls u

x0 = {icollocate({x1 == 1, x2 == t*pi/3})};

% Boundary constraints
cbnd = {initial({x1 == 0; x2 == 0})
final({x1 == 0; x2 == pi/3})};

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

% Objective
objective = -integrate(x1);


## Solve the problem

options = struct;
options.name = 'Curve Area Maximization';
solution = ezsolve(objective, {cbnd, ceq}, x0, options);

Problem type appears to be: lpcon
===== * * * =================================================================== * * *
TOMLAB - Tomlab Optimization Inc. Development license  999001. Valid to 2010-02-05
=====================================================================================
Problem: ---  1: Curve Area Maximization        f_k      -0.090586077493297917
sum(|constr|)      0.000000083570791380
f(x_k) + sum(|constr|)     -0.090585993922506533
f(x_0)     -0.999999999999997560

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

FuncEv    1 ConstrEv   82 ConJacEv   82 Iter   49 MinorIter   91
CPU time: 0.093750 sec. Elapsed time: 0.093000 sec.


## Plot result

t = subs(collocate(t),solution);
x1 = subs(collocate(x1),solution);
figure(1);
plot(t,x1,'*-');
xlabel('t')
ylabel('x1') 