I`m creating a script in Python Sympy library and trying to access the result returned by solveset() and linsolve() functions. My problem is that the object returned by these functions is of type finiteset and I want to select some results automaticaly to re-enter it in other equations.
Any body could help me?
An example: I create a list of equations with two unknown variables:
>>> a1, a2 = symbols('a1, a2')
>>> eq2_1 = Eq(-3*a1/10 - 3*a2/20 + 1/12)
>>> eq2_2 = Eq(-3*a1/20 - 13*a2/105 + 1/20)
>>> lista = [eq2_1,eq2_2]
>>> str(lista)
[-3*a1/10 - 3*a2/20 + 1/12, -3*a1/20 - 13*a2/105 + 1/20]
Then a solve it with the linsolve() method.
>>> a = linsolve(lista,a1,a2)
>>> a
{(71/369, 7/41)}
The result is correct, but I'm unable to get these results in to a variable.
O tried dics, lists, tuples, indexing commands, but always return the error. "Finiteset objects has no attribute 'command'"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…