Minimization linprog constraint no feasible solution
The problem lies in the equality constraints you set up in the code.
In the equality constraints (Aeq and Beq), there are conflicting conditions. Specifically, the last two constraints in Aeq are identical, but they are associated with different values in Beq. This creates a situation where the same set of variables is required to meet two contradictory conditions, making it impossible for linprog to find a feasible solution.
clear;
clc;
%objective cost coefficients
f = [40; 45; 50; 60; 55; 0; 0; 0];
[L1, L2, L3, L4] = deal(2.5, 2, 2, 2.3); %line constraints in per unit
%inequality constraints
Aineq = [0 0 0 0 0 10 -1 0;
0 0 0 0 0 -10 -1 0;
0 0 0 0 0 0 8 0;
0 0 0 0 0 0 -8 0;
0 0 0 0 0 0 0 5;
0 0 0 0 0 0 0 -5;
0 0 0 0 0 0 5 0;
0 0 0 0 0 0 -5 0];
Bineq = [L1; L1; L2; L2; L3; L3; L4; L4];
%equality constraints
Aeq = [1, 1, 1, 1, 1, 0, 0, 0;
0, 0, 0, 0, 0, 0, 10, 8;
0, 0, 0, 0, 0, 0, 15, -5;
0, 0, 0, 0, 0, 0, 0, 0]
Beq = [2.4 3 4 6.6];
%variable bounds
Lb = [0; 0; 0; 0; 0; -pi; -pi; -pi];
Ub = [3.70; 4.60; 3.40; 3.60; 6.50; pi; pi; pi];%call matlab LP solver
[x,feval,exitflag,output,lambda] = linprog(f, Aineq, Bineq, Aeq, Beq, Lb, Ub);
%display results
disp(x);
disp(feval);
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!