LoginSignup
1
2

More than 1 year has passed since last update.

python 変数の入った行列式を求め, 根を求めよう。

Last updated at Posted at 2021-07-01

7/3 編集

python 変数の入った行列式を求め, 根を求めよう。
※根とは多項式に対して 右辺が0となるような方程式を考えたときの解、のこと。

用途:固有多項式を求めたいとき、など

import sympy as sp

x = sp.Symbol("x")
M = sp.Matrix([[x, 3], [4, -1]])


ret = sp.solve(M.det())
print(M.det())

print(ret) 
1
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2