by Anonymous » 15 Feb 2025, 03:23
Ich möchte die Eigenvektoren
x aus einem System a berechnen: a
x = < EM> λ
x
Das
Problem ist, dass ich nicht weiß, wie ich die Eigenwerte mit Sympy löst.
Hier ist mein Code. Ich möchte einige Werte für x1 und x2 aus Matrix A < /code> < /p>
abrufen
Code: Select all
from sympy import *
x1, x2, Lambda = symbols('x1 x2 Lambda')
I = eye(2)
A = Matrix([[0, 2], [1, -3]])
equation = Eq(det(Lambda*I-A), 0)
D = solve(equation)
print([N(element, 4) for element in D]) # Eigenvalus in decimal form
print(pretty(D)) # Eigenvalues in exact form
X = Matrix([[x1], [x2]]) # Eigenvectors
T = A*X - D[0]*X # The Ax = %Lambda X with the first %Lambda = D[0]
print(pretty(solve(T, x1, x2)))
Ich möchte die Eigenvektoren [b] x [/b] aus einem System a berechnen: a [b] x [/b] = < EM> λ [b] x [/b]
Das [url=viewtopic.php?t=11587]Problem[/url] ist, dass ich nicht weiß, wie ich die Eigenwerte mit Sympy löst.
Hier ist mein Code. Ich möchte einige Werte für x1 und x2 aus Matrix A < /code> < /p>
abrufen[code]from sympy import *
x1, x2, Lambda = symbols('x1 x2 Lambda')
I = eye(2)
A = Matrix([[0, 2], [1, -3]])
equation = Eq(det(Lambda*I-A), 0)
D = solve(equation)
print([N(element, 4) for element in D]) # Eigenvalus in decimal form
print(pretty(D)) # Eigenvalues in exact form
X = Matrix([[x1], [x2]]) # Eigenvectors
T = A*X - D[0]*X # The Ax = %Lambda X with the first %Lambda = D[0]
print(pretty(solve(T, x1, x2)))
[/code]