フィルターのクリア

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 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