diff --git a/Schenk_Brandenberger_S7_Aufg1.py b/Schenk_Brandenberger_S7_Aufg1.py index 90c5a16..3a54920 100644 --- a/Schenk_Brandenberger_S7_Aufg1.py +++ b/Schenk_Brandenberger_S7_Aufg1.py @@ -31,7 +31,6 @@ def Schenk_Brandenberger_S6_Aufg2(A, b): countRowSwitch += 1 else: A, b = calculateRow(A, b, row, column) - print("\nObere Dreiecksmatrix A:\n", A, "\nb:\n", b) # Rückwärtseinsetzen diff --git a/Schenk_Brandenberger_S7_Aufg2.pdf b/Schenk_Brandenberger_S7_Aufg2.pdf index 3232f29..0f7dcc4 100644 Binary files a/Schenk_Brandenberger_S7_Aufg2.pdf and b/Schenk_Brandenberger_S7_Aufg2.pdf differ diff --git a/Schenk_Brandenberger_S7_Aufg2.py b/Schenk_Brandenberger_S7_Aufg2.py new file mode 100644 index 0000000..d3ca9bc --- /dev/null +++ b/Schenk_Brandenberger_S7_Aufg2.py @@ -0,0 +1,21 @@ +import numpy as np +import scipy + +import Schenk_Brandenberger_S7_Aufg1 + + + + + +if __name__ == '__main__': + # Überprüfung Aufgabe 2 + A = np.array([[0.8, 2.2, 3.6], + [2.0, 3.0, 4.0], + [1.2, 2.0, 5.8]]) + + b = np.array([[2.4], + [1.0], + [4.0]]) + + p, l, u = scipy.linalg.lu(A) + print("\np:\n", p, "\nl:\n", l, "\nu:\n", u) \ No newline at end of file