Updates:
Labels: NeedsReview smichr
Comment #4 on issue 2750 by [email protected]: solve could do a better job
with over determined systems
http://code.google.com/p/sympy/issues/detail?id=2750
The solver now skips equations that are found to be independent of symbols
of interest. I'm not sure what to do with the results, yet:
def test_issue_2750():
I1 = Symbol('I1')
I2 = Symbol('I2')
I3 = Symbol('I3')
I4 = Symbol('I4')
I5 = Symbol('I5')
I6 = Symbol('I6')
dI1 = Symbol('dI1')
dQ4 = Symbol('dQ4')
dQ2 = Symbol('dQ2')
Q2 = Symbol('Q2')
Q4 = Symbol('Q4')
dI4 = Symbol('dI4')
e = (
I1 - I2 - I3,
I3 - I4 - I5,
I4 + I5 - I6,
-I1 + I2 + I6,
-2*I1 - 2*I3 - 2*I5 - 3*I6 - dI1/2 + 12,
-I4 + dQ4,
-I2 + dQ2,
2*I3 + 2*I5 + 3*I6 - Q2,
I4 - 2*I5 + 2*Q4 + dI4
)
assert solve(e, I1, I4, Q2, Q4, dI1, dI4, dQ2, dQ4) == {
dI4: -I3 + 3*I5 - 2*Q4,
dI1: -4*I2 - 8*I3 - 4*I5 - 6*I6 + 24,
dQ2: I2,
I1: I2 + I3,
Q2: 2*I3 + 2*I5 + 3*I6,
dQ4: I3 - I5,
I4: I3 - I5}
assert [ei.subs(ans) for ei in eqs] == [0, 0, I3 - I6, -I3 + I6, 0, 0,
0, 0, 0]
Notice that the two solutions are the same (dQ4 and I4) and substitution
into the original equations implies that I3 == I6. Any ideas?
https://github.com/sympy/sympy/pull/656
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.