i have maximize the function below
z=0.75x1+0.91x2+0.98x3;
subject to
150x1+275x2+310x3<=1000
3.75x1+4.55x2+4.90x3<=1000
150x1+275x2<=500
i tried to find out the value using linpro() function
[x opt]=ling(-c,A,b)
x1= 775.7752
x2=-421.3319
opt=-200

댓글 수: 2

linpro()? But you used ling().
[x opt]=ling(-c,A,b)
dpb
dpb 2022년 1월 9일
If course if there are no bounds specified (as there weren't)
Keep reading the documentation for all the variations -- you need the one at least with
x = linprog(f,A,b,Aeq,beq,lb,ub) defines a set of lower and upper bounds on the design variables, x, so that the solution is always in the range lb ≤ x ≤ ub. Set Aeq = [] and beq = [] if no equalities exist.
to specify the lb array.
Your sample code above is full of typos and missing variables; I didn't try to fix it to be able to run it...

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

질문:

2022년 1월 9일

댓글:

dpb
2022년 1월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by