Exiting: One or more of the residuals, duality gap, or total relative error has grown 100000 times greater than its minimum value so far:

15 次查看(过去 30 天)
Dear All I am running my code but I faced this problem Exiting: One or more of the residuals, duality gap, or total relative error has grown 100000 times greater than its minimum value so far: the primal appears to be infeasible (and the dual unbounded). (The dual residual < TolFun=1.00e-008.) Could you please suggest what shall I do? It is so urgent
Thanks again for any suggestions Regards

采纳的回答

Titus Edelhofer
Titus Edelhofer 2012-3-26
Hi,
I guess (!) you are using linprog and get this error message? In this case the combination of bounds, equality constraints and inequality constraints are not permitting a solution. Try the following: either run linprog with bounds and inequality constraints only (setting Aeq=[], beq=[]), then with bounds and equality constraints only (setting A=[], b=[]). If one of them works, the other fails, start to take only parts of the "bad" constraints (i.e., some rows of Aeq and beq or A and b) to find out) which are the offending rows ...
Titus

更多回答(1 个)

Bestun
Bestun 2012-3-26
Dear Titus
Thanks a lot for you answer. Yes I am using linprog in my code. this is the command line
[variables, solution] = linprog(obj, [], [], equalityMatrix, equalityRHS, lowerB, upperB);
I used the first suggestion that you wrote in you message but I am still having the same problem.
the lines below are the section that I got the message error from.
function [variables, solution] = solve(B, N, padN, fD, fL, tied, objP);
bigNumber = 1000; warning off MATLAB:divideByZero;
[padB padFL padTied] = deal(sparse(size(B, 1), size(N, 2)), sparse(1, size(N, 2)), sparse(size(tied, 1), size(N, 2)));
equalityMatrix = [B padB; padN N; fL padFL; tied padTied];
equalityRHS = sparse(size(equalityMatrix, 1), 1);
equalityRHS(size(B, 1) + size(N, 1) + 1, 1) = 1;
obj = [fD; objP']; % objP' contains plastic multiplier terms
lowerB = [-bigNumber * ones(size(B, 2), 1); sparse(size(N, 2), 1)];
upperB = [bigNumber * ones(size(B, 2), 1); bigNumber * ones(size(N, 2), 1)];
[variables, solution] = linprog(obj, [], [], equalityMatrix, equalityRHS, lowerB, upperB);
Just I am asking is there is any change could be done in the linprog line to solve this error
I look forward to hearing from you
Regards
Bestun

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by