フィルターのクリア

To know the Exact Code Please To Run this Example: (optimization linprog)

1 回表示 (過去 30 日間)
Dalia ElNakib
Dalia ElNakib 2023 年 5 月 3 日
編集済み: Torsten 2023 年 5 月 4 日
Dear Eng.
I'm trying to solve this attached problem as Assignment using linprog Code
Then it will be solved through:
h(1) = 0.6
h(2) =0.8
h(3) =1
g(1) =0.1
g(2) =0.2
g(3) =0.3
C Matrix
C = [1
1
1]
A Matrix (3*3)
A= [h(1) - g(1)h(2) -g(3)h(3)
-g(2)h(1) h(2) -g(2)h(3)
-g(3)h(1) -g(3)h(2) h(3)]
b Matrix
b = [0
0
0]
Assuming Values for h's and Gamma's as shown above
Do you think we'll need Upper limit and Lower Limit for this example?
I need the correct Matlab Linprog Code to run please?
Thanks alot for your cooperation
I
  7 件のコメント
Dalia ElNakib
Dalia ElNakib 2023 年 5 月 4 日
h(1) = 0.6;
h(2) = 0.8;
h(3) = 1;
g(1) = 0.1;
g(2) = 0.2;
g(3) = 0.3;
%c Matrix
c = [1; 1; 1];
%A Matrix (3*3)
A = [h(1) -g(1)*h(2) -g(3)*h(3);-g(2)*h(1) h(2) -g(2)*h(3);-g(3)*h(1) -g(3)*h(2) h(3)];
%b Matrix
b = [0; 0 ;0];
%Bound constraint
lb = [0.0000003; 0.0000003; 0.0000003];
ub = [1000 ;1000 ;1000];
%Solve
p = linprog(c,A,b,[],[],lb,ub);
Optimal solution found.
Torsten
Torsten 2023 年 5 月 4 日
編集済み: Torsten 2023 年 5 月 4 日
No, my code from above was correct (using -A and -b).
I only wanted to point out that for linprog, it's necessary to pass -A and -b because the inequality is reversed compared to your problem formulation.

サインインしてコメントする。

回答 (0 件)

カテゴリ

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