预期的方阵?

时间:2014-09-04 07:26:39

标签: python sympy

请帮助找出错误。

import sympy as sp
from scipy.linalg import solve
x, y, z,w = sp.symbols('x,y,z,w')
alpha,beta, gamma, delta = sp.symbols('alpha,beta,gamma,delta')
f1 = alpha*y*z - beta*w
f2= gamma*z - delta*x
f3=-alpha*y*z + beta*w + x
f4= -alpha*y*z + beta*w - gamma*z + delta*x
K=solve(f1,f2,f3,f4)
print K

显示的错误是

Expected square matrix

1 个答案:

答案 0 :(得分:0)

scipy.linalg.solve无法解决SymPy方程。使用SymPy求解器。例如,请参阅http://docs.sympy.org/dev/modules/solvers/solvers.html