필터 지우기
필터 지우기

How do I correctly use the Syntax of fmincon?

조회 수: 2 (최근 30일)
Brendan Görres
Brendan Görres 2018년 12월 10일
댓글: Walter Roberson 2018년 12월 10일
I am trying to optimize a flight path. I have the following equations of motions:
dydt=(thrust*sin(alphat)/m*v)-gh*cos(y)-v*cos(y)/(re+h);
dvdt=(thrust*cos(alphat)/m)-Adrag* rhoh*(v^2)/2*m- gh *sin(y);
dhdt=v*sin(y);
dxddt=(re/re+h)*v*cos(y);
dmdt=-propflow;
dwdt=(1/Ix)*thrust*sin(alphat)*rs;
h and v are limited by the final orbit:
hmax=hfinal;
vmax=vfinal;
the downrange x and w are not constrained. I will set the max values of these parameters to a high value, which they will never reach.
m is the parameter that I want to maximize in my final orbit ans the flight path angle y should be equal to 0,because I want my rocket to reach a circular orbit.
Finally my alphat is the thrust vector control variable with which I would like to minimize my mass loss. So I would like fmincon to calculate my function alphat, so that my mass in the final orbit is as high as possible.
The problem is that I dont't understand how to define
A*x=b;
. Could someone here explain me what exactly A, x and b are and how I calculate them??
Thanks
  댓글 수: 3
Brendan Görres
Brendan Görres 2018년 12월 10일
OK, maybe the question was not clear enough.I have read these two links, but the problem is that I don't understand how to formulate A and b for my particular problem. Because I do not have a function that depends on one variable but on 7. I can formulate these 7 variables for example as a vector Y, so that my function depends on Y(1)...Y(7) but there is still the problem to formulate A and b. How do I do that?
Walter Roberson
Walter Roberson 2018년 12월 10일
? The code you posted does not use A or x or b? fmincon does name some parameters A and x and b but not in a A*x=b context only A*x<=b . That is to say those names are only used to express linear inequality constraints . Your description mentions some bounds constraints but no linear inequalities . So you would set the A and b linear inequality parameters to the empty matrix (and the Aeq and beq parameters as well )

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2018년 12월 10일
If you do not have any linear constraints, then just set them empty
A=[]; b=[];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver-Based Nonlinear Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by