Solving Constrained Optimization for 4 variables (or 3?)

조회 수: 2 (최근 30일)
Tristofani Agasta
Tristofani Agasta 2022년 4월 8일
댓글: Tristofani Agasta 2022년 4월 8일
I am trying to solve the question from the picture below.
I dont know how to modify the original code from solving 2 variables into solving 4 variables. My friend said it was supposedly only 3 variables (x4 supposedly was x3), maybe because the typo.
There are my Matlab code

답변 (1개)

Torsten
Torsten 2022년 4월 8일
편집: Torsten 2022년 4월 8일
It's a simple linear optimization problem. If you are allowed to, use "linprog" to solve.
f = [1; 1; 1; 0];
Aeq = [3 1 0 -1;1 -2 1 0];
beq = [-5;1];
lb = [-Inf; 0 ;0 ;0];
ub = [Inf ;Inf; Inf ;Inf];
sol = linprog(f,[],[],Aeq,beq,lb,ub)
  댓글 수: 7
Torsten
Torsten 2022년 4월 8일
편집: Torsten 2022년 4월 8일
Then look up "simplex algorithm".
Programming it, everything is hand-made.
Tristofani Agasta
Tristofani Agasta 2022년 4월 8일
Thank you for your reply

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

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by