Aim:
☛
UNIT - I: Eigen values and Eigenvectors:
Programs:
โข Finding real and complex Eigen values.
โข Finding Eigen vectors.
Solution :
PROGRAM: (Eigen_Values_Vectors.py)
import sympy as sp
# Define matrix (you can change values)
A = sp.Matrix([[1, 2],
[5, 4]])
# Eigenvalues and eigenvectors
eigen_data = A.eigenvects()
print("Eigenvalues and Eigenvectors:\n")
for val, mult, vecs in eigen_data:
print("Eigenvalue:", val)
print("Eigenvector:", vecs[0])
print()
OUTPUT:
Eigenvalues and Eigenvectors:
Eigenvalue: -1
Eigenvector: Matrix([[-1], [1]])
Eigenvalue: 6
Eigenvector: Matrix([[2/5], [1]])
๐ป Run This Python Program
triangle using for loop
The selected Python program is loaded
automatically into the editor.
Edit the program, provide input if required
and click Run.
The compiler is embedded using OneCompiler.
Your Python program runs inside the embedded
Python environment; Study Glance does not execute
Python code directly on your web server.
MATLAB programs shown in the experiment should be run in
MATLAB (or GNU Octave), and programs that use libraries such as
NumPy, SciPy or SymPy depend on what the embedded environment provides.