22 lines
397 B
Python
22 lines
397 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
"""
|
||
|
Created on Tue Nov 5 16:58:41 2024
|
||
|
|
||
|
@author: Carla
|
||
|
|
||
|
Lineare Algebra
|
||
|
|
||
|
Übung 03 Gauss
|
||
|
"""
|
||
|
#Python initialisieren
|
||
|
import numpy as np;
|
||
|
#Parameter
|
||
|
A=np.array([...]);
|
||
|
b=np.array([...]);
|
||
|
pr_L=...; pr_C=...;
|
||
|
#Berechnungen:
|
||
|
L=np.linalg.solve(A,b);
|
||
|
C=np.linalg.cond(A);
|
||
|
#Ausgabe
|
||
|
print(f"L= {np.array2string(L,precision=pr_L)}");
|
||
|
print(f"C= {C:#.{pr_C}g}");
|