Question about propt optimization code

1 回表示 (過去 30 日間)
Jaime De La Mota Sanchis
Jaime De La Mota Sanchis 2019 年 10 月 23 日
Hello everyone. I have found the following example in which a version of Zermelo's optimization problem is solved. There is however a part of the code that I don't understand:
The first two lines of the document are:
% Array with consecutive number of collocation points
narr = [20 40];
and later on, the author writes
% Initial guess
if n==narr(1)
x0 = {tf == 2; icollocate({x1 == xi(1); x2 == xi(2)})
collocate({u1 == pi})};
else
x0 = {tf == tfopt; icollocate({x1 == xopt1; x2 == xopt2})
collocate({u1 == uopt1})};
end
and
tfopt = subs(tf,solution);
xopt1 = subs(x1,solution);
xopt2 = subs(x2,solution);
uopt1 = subs(u1,solution);
If I understand propperly, the code first constructs an optimal solution based on a very simple guess and then, uses the found optimal solution as an initial guess for a second optimal solution?
If someone can confirm that I have undestoood this correctly, I would be very thankful.
Regards.
Jaime.

回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by