PROPT Isoperimetric Constraint Problem
From TomWiki
Jump to navigationJump to search
This page is part of the PROPT Manual. See PROPT Manual. |
Problem Formulation
Find u over t in [0; 1 ] to minimize
subject to:
The initial condition are:
% Copyright (c) 2009-2009 by Tomlab Optimization Inc.
Problem setup
toms t
p = tomPhase('p', t, 0, 1, 30);
setPhase(p);
tomStates x
tomControls u
% Initial guess
x0 = {icollocate(x == 0)
collocate(u == 0)};
% Box constraints
cbox = {icollocate(-10 <= x <= 10)
collocate(-4 <= u <= 4)};
% Boundary constraints
cbnd = {initial(x == 1)
final(x == 0)};
% ODEs and path constraints
ceq = collocate(dot(x) == -sin(x)+u);
% Integral constraint
cint = {integrate(u^2) == 10};
% Objective
objective = integrate(x);
Solve the problem
options = struct;
options.name = 'Isoperimetric';
solution = ezsolve(objective, {cbox, cbnd, ceq, cint}, x0, options);
t = subs(collocate(t),solution);
x = subs(collocate(x),solution);
u = subs(collocate(u),solution);
Problem type appears to be: lpcon Time for symbolic processing: 0.071268 seconds Starting numeric solver ===== * * * =================================================================== * * * TOMLAB - TOMLAB Development license 999007. Valid to 2011-12-31 ===================================================================================== Problem: --- 1: Isoperimetric f_k -0.375495523108186620 sum(|constr|) 0.000000031769296196 f(x_k) + sum(|constr|) -0.375495491338890430 f(x_0) 0.000000000000000000 Solver: snopt. EXIT=0. INFORM=1. SNOPT 7.2-5 NLP code Optimality conditions satisfied FuncEv 1 ConstrEv 112 ConJacEv 112 Iter 53 MinorIter 216 CPU time: 0.046800 sec. Elapsed time: 0.054000 sec.
Plot result
subplot(2,1,1)
plot(t,x,'*-');
legend('x');
title('Isoperimetric state variable');
subplot(2,1,2)
plot(t,u,'+-');
legend('u');
title('Isoperimetric control');