Why do i receive Solving problem using linprog. The dual-simplex algorithm uses a built-in starting point; ignoring supplied X0. Problem is unbounded.

조회 수: 4 (최근 30일)
Can anyone tell or explain me why the below is coming after writing the code:-
x = optimvar('x',2,'LowerBound',[0 0],'UpperBound',[inf inf]);
obj = (45* x(1) + 80* x(2));
A = 5*x(1) + 20*x(2) <= 400;
B = 10*x(1) + 15*x(2) <=450;
Prob = optimproblem('Objective',obj, 'ObjectiveSense', 'maximize');
prob.Contraints.con_1 = A;
prob.Contraints.con_2 = B;
x0.x = [0 0];
[sol, fval, exitflag, output] = solve(Prob, x0);
Solving problem using linprog.
The dual-simplex algorithm uses a built-in starting point;
ignoring supplied X0.
Problem is unbounded.

채택된 답변

Matt J
Matt J 2021년 9월 6일
편집: Matt J 2021년 9월 6일
The first part of the message is because you are giving an initial guess x0 to solve(). This x0 is being ignored because it is not useful to the solver algorithm. The algorithm autogenerates its own starting point.
The second part "Problem is unbounded" is because the solver has determined that there is no finite solution. This is because you asssigned your constraints to "prob" instead of to "Prob".
x = optimvar('x',2,'LowerBound',[0 0],'UpperBound',[inf inf]);
obj = (45* x(1) + 80* x(2));
A = 5*x(1) + 20*x(2) <= 400;
B = 10*x(1) + 15*x(2) <=450;
Prob = optimproblem('Objective',obj, 'ObjectiveSense', 'maximize');
Prob.Constraints.con_1 = A;
Prob.Constraints.con_2 = B;
x0.x = [0 0];
[sol, fval, exitflag, output] = solve(Prob, x0);
Solving problem using linprog. The dual-simplex algorithm uses a built-in starting point; ignoring supplied X0. Optimal solution found.
  댓글 수: 3
Deepak Singh
Deepak Singh 2021년 10월 9일
I had a question about matlab please help regarding this question:-
Write a MATLAB program to calculate the efficiency of a reversible heat engine operating between a hot reservoir at 900°K and a cold reservoir at 500°K.
Write a generalized program in terms of units of the temperatures of heat reservoirs.
The temperature of any of the heat reservoirs can be changedby 100°K up or down.
Modify the same program to determine the highest efficiency that can be achieved by making this temperature change. Print that maximum efficiency achieved along with the corresponding temperatures of hot and cold heat reservoirs.
Without using ‘max’ command while writing the program.

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

추가 답변 (0개)

카테고리

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