Spektral-Norm

This commit is contained in:
Sandro Zimmermann 2026-06-02 22:16:05 +02:00
parent 827588a435
commit 5aacc216a7

View File

@ -0,0 +1,28 @@
"""
Spektral-Norm ||A||2
A Matrix:
[4 9]
[2 7]
"""
import numpy as np
import sympy as sp
# Numpy
A = np.array([[4, 9], [2, 7]])
n = np.linalg.norm(A, ord=2)
print(n.round(4))
# Sympy
A = sp.Matrix([[4, 9], [2, 7]])
n = A.norm(ord=2)
print(n)
"""
Ausgabe:
12.2201
sqrt(5*sqrt(221) + 75)
"""