linear equality constraint writing
1 回表示 (過去 30 日間)
古いコメントを表示
Saifullah Khalid
2017 年 6 月 21 日
コメント済み: Saifullah Khalid
2017 年 6 月 21 日
I am facing difficulty to write linear inequality constraint given below. Here Φ, 48 element long vector, is decision variable where as P and μ are vectors of 48 elements each and λ is a constant. I shall appreciate any help.
λ * P ≤ μ * Φ
0 件のコメント
採用された回答
Walter Roberson
2017 年 6 月 21 日
lambda .* P <= mu * phi so
lambda .* P / mu <= phi
With lambda, P, and mu all being constants, this does not need to be written as a linear constraint. Instead, it can be written as lower bound: phi >= lambda .* P / mu so
x0 = .... %starting point
A = []; b = [];
Aeq = []; beq = [];
LB = lamda .* P ./ mu; UB = inf(1,48);
fmincon( fun, x0, A, b, Aeq, beq, LB, UB )
If you prefer to implement it as a linear constraint (perhaps because you are using a different minimizer) then
A = -eye(48); B = lambda .* P ./ mu;
6 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!