Why do i receive Solving problem using linprog. The dual-simplex algorithm uses a built-in starting point; ignoring supplied X0. Problem is unbounded.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Deepak Singh
el 6 de Sept. de 2021
Comentada: Deepak Singh
el 14 de Oct. de 2021
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.
0 comentarios
Respuesta aceptada
Matt J
el 6 de Sept. de 2021
Editada: Matt J
el 6 de Sept. de 2021
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);
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!