Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Function linprog
Replies: 0

 Jeremy Rioult Posts: 1 Registered: 5/3/13
Function linprog
Posted: May 3, 2013 2:56 AM

Hi,
I have a problem with the function linprog. The solution doesn't converge and i don't understand why.
I try with the options, large scale, simplex, nothing works.
For example, for the 'interior point', the program exits with this message :

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

How can i do ?
Does the lines of the Matrix Aeq and Aineq must be independent ?

I give you my function and my matrix, if somebody can help me...

fct = [1 1 1 1 10000 10000 1 1 10000 150 150 150 150 150 150 100 100 100]

Matrix_Equal_constraints = [0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 1 1 -1 0 -1 0 0 0 0 0 0 0 0 0
-1 0 0 1 0 0 1 -1 0 0 0 0 0 0 0 0 0 0
0 0 0 -1 0 -1 0 1 1 0 0 0 0 0 0 0 0 0]

Matrix_Inequal_constraints = [1 0 0 0 0 0 0 0 0 -10 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 -10 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 -10 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 -10 0 0
0 0 0 0 0 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