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 CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by