Professional Documents
Culture Documents
15.2 Problem Setup
15.2 Problem Setup
2 Problem setup
toms t
toms t_f
p = tomPhase('p', t, 0, t_f, 20);
setPhase(p);
tomStates x y
% Initial guess
x0 = {t_f == 10};
% Box constraints
cbox = {0.1 <= t_f <= 100};
% Boundary constraints
cbnd = {initial({x == 0; y == 0})
final({x == 10; y == -3})};
% Expressions for kinetic and potential energy
m = 1;
g = 9.81;
Ekin = 0.5*m*(dot(x).^2+dot(y).^2);
Epot = m*g*y;
v = sqrt(2/m*Ekin);
% ODEs and path constraints
ceq = collocate(Ekin + Epot == 0);
% Objective
objective = t_f;
= subs(collocate(x),solution);
= subs(collocate(y),solution);
= subs(collocate(v),solution);
= subs(collocate(t),solution);
999001. Valid
======================================================================
===============
Problem: --- 1: Brachistochrone-DAE
1.869963310229847400
f_k
sum(|constr|)
0.000000000158881015
f(x_k) + sum(|constr|)
1.869963310388728300
f(x_0)
10.000000000000000000
Solver: snopt.
EXIT=0.
INFORM=1.
1 ConstrEv
168 ConJacEv
168 Iter
93 MinorIter
154