필터 지우기
필터 지우기

Fsolve : I want to give a condition which is something should be bigger than something, how can I do it?

조회 수: 1 (최근 30일)
I am solving one objective function.
And one of the conditions is that something is bigger than something.
I can I write this condition in fsolve function?
pl=@(E) [
g/E(1)+G0(E)+rho*G1(E)*b/(1+a*b)-b/(1+a*b)*(g/E(2)+b*G1(E));
R-E(1)-E(2)
];
P=fsolve(pl, E0);
Here I want to give two more condition such as
pl=@(E) [
g/E(1)+G0(E)+rho*G1(E)*b/(1+a*b)>0
b/(1+a*b)*(g/E(2)+b*G1(E))>0
How can I do this?

답변 (2개)

Walter Roberson
Walter Roberson 2012년 4월 17일
In order to express that a > b, you can reframe that as a + c = b where c is constrained to be positive.
However, it may perhaps be difficult to express strictly positive, as a lot of the routines are set up for constraints >= 0 rather than > 0

Sargondjani
Sargondjani 2012년 4월 17일
you could also use fmincon. have a look at it
then you have to make the objective pl^2, and you can supply the constraints separately
  댓글 수: 2
Walter Roberson
Walter Roberson 2012년 4월 17일
If pl(E).^2 is the objective, then pl(E) and -pl(E) become equally plausible, which does not help in requiring pl(E) > 0 .
Sargondjani
Sargondjani 2012년 4월 17일
i think there is some confusion...
his first 'pl' is the objective
his second 'pl' (should have gotten another name) are the constraints, which are the first and second part of the the objective function (both required >0).
when the latter 2 are inserted as constraints in fmincon, the algorithm will solve this properly...

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

카테고리

Help CenterFile Exchange에서 Solver 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