'Error in maximization optimization problem in MATLAB
I am solving a optimization problem in MATLAB. It is a maximization problem. Following is the code:
x = optimvar("x", "LowerBound",0);
y = optimvar("y", "LowerBound",0);
z = optimvar('z');
prob = optimproblem;
prob.Objective =(2.583*z)/(6.533*x+2.317*y );
prob.Constraints.cons1 = (4.616*z)/(6.533*x+2.317*y ) <= 1;
prob.Constraints.cons2 = (4.616*z)/(6.533*x+2.317*y )>=0;
prob.Constraints.cons3 = (8.303*z)/(6.533*x+2.317*y ) <= 1;
prob.Constraints.cons4 = (8.303*z)/(6.533*x+2.317*y )>=0;
prob.Constraints.cons5 = (2.583*z)/(6.533*x+2.317*y ) <= 1;
prob.Constraints.cons6 = (2.583*z)/(6.533*x+2.317*y ) >= 0;
prob.Constraints.cons7 = (16.169*z)/(6.533*x+2.317*y ) <= 1;
prob.Constraints.cons8 = (16.169*z)/(6.533*x+2.317*y ) >= 0;
prob.Constraints.cons9 = (0.973*z)/(6.533*x+2.317*y ) <= 1;
prob.Constraints.cons10 = (0.973*z)/(6.533*x+2.317*y ) >= 0;
sol = solve(prob)
However I get the following error:
Any suggestions on how to solve this issue
Solution 1:[1]
so I got the solution to this problem. MATLAB was giving this issue since the objective function and the constraints have a denominator which may be zero. So to get a solution to the problem, remove the denominators and linearize the constraints.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | SG26 |

