六元一次方程组求解。 i3=i1+i2, i1=i3+i5, i4=i2+i5, i1+5*i5=2*i2, 5*i5+4*i4=3*i3, 2*i2+4*i4+6*i6=10。
from sympy import * i1,i2,i3,i4,i5,i6=symbols(['i1','i2','i3','i4','i5','i6']) solve([ i1+i2-i3, i3+i5-i1, i4-i2-i5, i1+5*i5-2*i2, 5*i5+4*i4-3*i3, 2*i2+4*i4+6*i6-10 ],[i1,i2,i3,i4,i5,i6]) > Out[6]: {i1: 0, i2: 0, i3: 0, i4: 0, i5: 0, i6: 5/3}