我正在尝试解决一阶微分方程组,如下所示:

import numpy as np
from sympy import *

tR1201 = Rational(1,2)
tR1212 = Rational(1,2)
tB12 = Rational(1,2)
tB01 = Rational(1,2)
Gamma = Rational(1,4)
delta = Rational(1,10)
hbar = 1 

t = Symbol('t')
p1 = Function('p1')(t)
p2 = Function('p2')(t)
p3 = Function('p3')(t)
p4 = Function('p4')(t)
Psi = Matrix([[p1],[p2],[p3],[p4]])
Coupling = Matrix([[0,tB01,tR1201,0],[tB01,0,0,tR1212],[tR1201,0,delta +(-I*Gamma),tB12],[0,tR1212,tB12,delta +(-I*Gamma)]])
diffeq = I*hbar * diff(Psi, t) - Coupling*Psi
solution = dsolve(diffeq,[p1,p2,p3,p4])

当我运行它时,我收到此错误:

line 1122, in eigenvals raise MatrixError("Could not compute 
eigenvalues for {}".format(self))

MatrixError: Could not compute eigenvalues for Matrix([[0, 1/2, 1/2, 0], [1/2, 0, 0, 1/2], [1/2, 0, 1/10 - I/4, 1/2], [0, 1/2, 1/2, 1/10 - I/4]])

dsolve的一部分涉及寻找特征值,并且该误差表明不可能计算矩阵耦合的特征值 . 但是,我用另一种方法找到了特征值,它们很复杂 . Sympy是否存在复杂的特征值问题?

我发现了类似的问题(比如这个问题:Computation of symbolic eigenvalues with sympy),但这些其他问题的答案对这种情况没有帮助 .