PROPT Rayleigh Unconstrained

From TomWiki
Jump to navigationJump to search

Notice.png

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

Lecture Notes for ECE/MAE 7360, Robust and Optimal Control (part 2) Fall 2003, Jinsong Liang, Nov. 20, 2003 Utah State University at Logan

Problem Formulation

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


subject to:


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

Problem setup

toms t
p = tomPhase('p', t, 0, 2.5, 50);
setPhase(p);

tomStates x1 x2
tomControls u

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

% Box constraints
cbox = {-100 <= icollocate(x1) <= 100
    -100 <= icollocate(x2) <= 100
    -100 <= collocate(u) <= 100};

% Boundary constraints
cbnd = initial({x1 == -5; x2 == -5});

% ODEs and path constraints
ceq = collocate({dot(x1) == x2
    dot(x2) == -x1+(1.4-0.14*x2.^2).*x2+4*u});

% Objective
objective = integrate(x1.^2+u.^2);

Solve the problem

options = struct;
options.name = 'Rayleigh Unconstrained';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t  = subs(collocate(t),solution);
x1 = subs(collocate(x1),solution);
x2 = subs(collocate(x2),solution);
u  = subs(collocate(u),solution);
Problem type appears to be: qpcon
Time for symbolic processing: 0.10859 seconds
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - TOMLAB Development license  999007. Valid to 2011-12-31
=====================================================================================
Problem: ---  1: Rayleigh Unconstrained         f_k      29.376079656023276000
                                       sum(|constr|)      0.000000003739617241
                              f(x_k) + sum(|constr|)     29.376079659762894000
                                              f(x_0)     62.499999999999517000

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

FuncEv    1 ConstrEv   47 ConJacEv   47 Iter   36 MinorIter  144
CPU time: 0.093601 sec. Elapsed time: 0.091000 sec. 

Plot result

subplot(2,1,1)
plot(t,x1,'*-',t,x2,'*-');
legend('x1','x2');
title('Rayleigh Unconstrained state variables');

subplot(2,1,2)
plot(t,u,'+-');
legend('u');
title('Rayleigh Unconstrained System control');

RayleighUnconstrained 01.png