Reputation: 21
import sympy
p1, p2, p3 = sympy.symbols('p1, p2, p3')
A = sympy.Matrix([(p1+p2+p3) + 5, p2, p3],[p1, (p1+p2+p3) + 8, p3],[p1, p2, (p1+p2+p3) + 8] )
print(A.eigenvals())
I get an error of the values not being integers. What is the proper way to calculate this?
Upvotes: 0
Views: 592
Reputation: 1343
You need another [
and ]
inside the Matrix
:
A = Matrix([[(p1+p2+p3) + 5, p2, p3],[p1, (p1+p2+p3) + 8, p3],[p1, p2, (p1+p2+p3) + 8]])
will construct the matrix without raising an error.
Upvotes: 1