## #2059 algsys -- variable order dependent

None
closed
nobody
5
2016-10-04
2010-08-24
No

(%i1) algsys([z-a=%i*b,z+a=c,a*z+3*(a-z)=13-12*%i,3*(z-a)+a*z=12*%i+13],[a,c,b,z]);
(%o1) []

(%i2) algsys([z-a=%i*b,z+a=c,a*z+3*(a-z)=13-12*%i,3*(z-a)+a*z=12*%i+13],[z,a,c,b]);
(%o2) [[z=2*%i-3,a=-2*%i-3,c=-6,b=4],[z=-(3*%i+11)/(%i-3),a=3-2*%i,c=6,b=4]]

## Discussion

• Dieter Kaiser - 2010-08-25

I think this is a known bug. See ID: 1944012 - solve() fails depending on equation order.
Dieter Kaiser

• Robert Dodier - 2013-07-26
• labels: --> Lisp Core - Solving equations
• Description has changed:

Diff:

```--- old
+++ new
@@ -1,4 +1,3 @@
-
\(%i1\) algsys\(\[z-a=%i\*b,z+a=c,a\*z+3\*\(a-z\)=13-12\*%i,3\*\(z-a\)+a\*z=12\*%i+13\],\[a,c,b,z\]\);
\(%o1\) \[\]
```
• Group: --> None

• status: open --> closed

• Closing, as this particular example now works. Perhaps due to recent changes to algsys.

```(%i1) eqs:[z-a=%i*b,z+a=c,a*z+3*(a-z)=13-12*%i,3*(z-a)+a*z=12*%i+13];

(%o1) [z-a = %i*b,z+a = c,a*z+3*(a-z) = 13-12*%i,3*(z-a)+a*z = 12*%i+13]
(%i2) map(lambda([u],algsys(eqs,u)), listify(permutations([a,c,b,z])));

(%o2) [[[a = (-2*%i)-3,b = 4,c = -6,z = 2*%i-3],
[a = 3-2*%i,b = 4,c = 6,z = 2*%i+3]],
[[a = (-2*%i)-3,b = 4,z = 2*%i-3,c = -6],
[a = 3-2*%i,b = 4,z = 2*%i+3,c = 6]],
[[a = (-2*%i)-3,c = -6,b = 4,z = 2*%i-3],
[a = 3-2*%i,c = 6,b = 4,z = 2*%i+3]],
[[a = (-2*%i)-3,c = -6,z = 2*%i-3,b = 4],
[a = 3-2*%i,c = 6,z = 2*%i+3,b = 4]],
[[a = (-2*%i)-3,z = 2*%i-3,b = 4,c = -6],
[a = 3-2*%i,z = 2*%i+3,b = 4,c = 6]],
[[a = (-2*%i)-3,z = 2*%i-3,c = -6,b = 4],
[a = 3-2*%i,z = 2*%i+3,c = 6,b = 4]],
[[b = 4,a = (-2*%i)-3,c = -6,z = 2*%i-3],
[b = 4,a = 3-2*%i,c = 6,z = 2*%i+3]],
[[b = 4,a = (-2*%i)-3,z = 2*%i-3,c = -6],
[b = 4,a = 3-2*%i,z = 2*%i+3,c = 6]],
[[b = 4,c = -6,a = (-2*%i)-3,z = 2*%i-3],
[b = 4,c = 6,a = 3-2*%i,z = 2*%i+3]],
[[b = 4,c = -6,z = 2*%i-3,a = (-2*%i)-3],
[b = 4,c = 6,z = 2*%i+3,a = 3-2*%i]],
[[b = 4,z = 2*%i-3,a = (-2*%i)-3,c = -6],
[b = 4,z = 2*%i+3,a = 3-2*%i,c = 6]],
[[b = 4,z = 2*%i-3,c = -6,a = (-2*%i)-3],
[b = 4,z = 2*%i+3,c = 6,a = 3-2*%i]],
[[c = -6,a = (-2*%i)-3,b = 4,z = 2*%i-3],
[c = 6,a = 3-2*%i,b = 4,z = 2*%i+3]],
[[c = -6,a = (-2*%i)-3,z = 2*%i-3,b = 4],
[c = 6,a = 3-2*%i,z = 2*%i+3,b = 4]],
[[c = -6,b = 4,a = (-2*%i)-3,z = 2*%i-3],
[c = 6,b = 4,a = 3-2*%i,z = 2*%i+3]],
[[c = -6,b = 4,z = 2*%i-3,a = (-2*%i)-3],
[c = 6,b = 4,z = 2*%i+3,a = 3-2*%i]],
[[c = -6,z = 2*%i-3,a = (-2*%i)-3,b = 4],
[c = 6,z = 2*%i+3,a = 3-2*%i,b = 4]],
[[c = -6,z = 2*%i-3,b = 4,a = (-2*%i)-3],
[c = 6,z = 2*%i+3,b = 4,a = 3-2*%i]],
[[z = 2*%i-3,a = (-2*%i)-3,b = 4,c = -6],
[z = 2*%i+3,a = 3-2*%i,b = 4,c = 6]],
[[z = 2*%i-3,a = (-2*%i)-3,c = -6,b = 4],
[z = 2*%i+3,a = 3-2*%i,c = 6,b = 4]],
[[z = 2*%i-3,b = 4,a = (-2*%i)-3,c = -6],
[z = 2*%i+3,b = 4,a = 3-2*%i,c = 6]],
[[z = 2*%i-3,b = 4,c = -6,a = (-2*%i)-3],
[z = 2*%i+3,b = 4,c = 6,a = 3-2*%i]],
[[z = 2*%i-3,c = -6,a = (-2*%i)-3,b = 4],
[z = 2*%i+3,c = 6,a = 3-2*%i,b = 4]],
[[z = 2*%i-3,c = -6,b = 4,a = (-2*%i)-3],
[z = 2*%i+3,c = 6,b = 4,a = 3-2*%i]]]
```