I have a linear programming problem to solve. It looks like:
zx = max z
s.t. z ≤ c*y1 + y1*x
z ≤ c*y2 + y2*x
Σ x ≤ 5
Where:
c = 0
1
1
100
1
0
1
1
1
1
0
1
100
1
1
0
y1 = 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
y2 = 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0.
x is an array of 16 numbers.
The result should be optimized for x.
How do I solve it using Matlab?

댓글 수: 1

John D'Errico
John D'Errico 2020년 7월 27일
편집: John D'Errico 2020년 7월 27일
This question is morphing too many times, now on the third variation. I've closed the other copy of this question. Please stop reposting new duplicate questions if your question changes agian.

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

 채택된 답변

Matt J
Matt J 2020년 7월 27일

0 개 추천

댓글 수: 3

Nika Dolnikava
Nika Dolnikava 2020년 7월 27일
I want to find y. There are not y in maximum function. So I can't use linprog.
Matt J
Matt J 2020년 7월 27일
편집: Matt J 2020년 7월 27일
No, you said in your original post that the y variables were known and that you wanted to find x,
"The result should be optimized for x."
linprog is definitely the tool to use. Your problem is very much a linear program and that is the kind of problem that linprog solves. Although, be mindful that z must be solved for as well and therefore z and x must be viewed as part of a single vector of 17 unknowns p=[-z,x]
Nika Dolnikava
Nika Dolnikava 2020년 7월 27일
It worked! Thank you so much.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

질문:

2020년 7월 26일

댓글:

2020년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by