## #959 To know which are the inconsistent equations

closed
nobody
5
2009-11-29
2006-07-12
No

Hi,
I have an inconsistent equation system,
I need to know which are the inconsistent equations
when the linsolve command is used. I know that this is
displayed when the flag solve_inconsistent_error is
true, but I need to use this information in a program.

For example,
(%i169) linsolve([a+b=0,a+b=1,a+c=2],[a,c]);
Inconsistent equations: (2)
-- an error. Quitting. To debug this try
debugmode(true);
(%i170)

I need to know that 2 is the inconsistent equation,
Is there any way to know that?
Thank you

Araceli

## Discussion

• Barton Willis
2006-08-14

Logged In: YES
user_id=895922

Without hacking the function solvex (in src/solve), I
don't think there is a way to get at this information.
Of course, which equation is is inconsistent is somewhat
arbitrary: in [x=3,x=6,x=7], which two equations are
inconsistent?

Maybe you would like to use the function rank:

(%i25) rank(matrix([6,7],[6,17]));
(%o25) 2(%i26) rank(matrix([6,7],[6,7]));
(%o26) 1

• Robert Dodier
2006-08-26

• labels: --> Lisp Core - Solving equations

• Logged In: NO

hi
(%i12) linsolve([a+b=1,a+c=2],[a,c]);
(%o12) [a = 1 - b, c = b + 1]
(%i13) linsolve([a+b=0,a+c=2],[a,c]);
(%o13) [a = - b, c = b + 2]
(%i14) linsolve([a+b=0,a+b=1],[a,c]);
Inconsistent equations: (2)
-- an error. To debug this try debugmode(true);
the equations [a+b=0,a+b=1] are contradictory, and if you remove one of them your system has a solution. but look at the system
linsolve([a=0,c=0,a+c=1],[a,c])
these three equations are inconsistent but if you pick two of them a unique solution exists. so what are the inconsistent equations?
in the common case you cannot say these equations of a systems are inconsistent and the rest is consistent. of course an inconsistent system can contain an inconsistent subsystems, but i think how to find out such inconsistent subsystems is a question for a mathematics group and not for a bug report
guenter

• Dieter Kaiser
2009-11-29

• status: open --> closed

• Dieter Kaiser
2009-11-29

I think this is not a bug report, but a support request. Perhaps it is a feature request.
Closing this bug report as out of date.
Dieter Kaiser