Solved Task 2

This commit is contained in:
schrom01 2022-11-14 23:06:06 +01:00
parent 6c528077ac
commit f3ee0390aa
3 changed files with 21 additions and 1 deletions

View File

@ -31,7 +31,6 @@ def Schenk_Brandenberger_S6_Aufg2(A, b):
countRowSwitch += 1 countRowSwitch += 1
else: else:
A, b = calculateRow(A, b, row, column) A, b = calculateRow(A, b, row, column)
print("\nObere Dreiecksmatrix A:\n", A, "\nb:\n", b) print("\nObere Dreiecksmatrix A:\n", A, "\nb:\n", b)
# Rückwärtseinsetzen # Rückwärtseinsetzen

Binary file not shown.

View File

@ -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)