sympy dsolve for耦合微分方程组(具有复数值)

时间:2018-03-16 06:19:31

标签: sympy

我试图解决一个如下所示的一阶微分方程组:

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),但这些其他问题的答案在这种情况下无济于事。

0 个答案:

没有答案
相关问题