feat: NEWTON-Schema funktion angefangen. Parameter werden gesetzt

This commit is contained in:
Sandro Zimmermann 2026-03-12 17:08:49 +01:00
parent 7eee7fc75b
commit 868566149d

32
src/serie_3.py Normal file
View File

@ -0,0 +1,32 @@
# %%
import numpy as np
import matplotlib.pyplot as plt
# %%
print("----------------------------------------------------------------")
print(__file__)
print("Aufgabe 2. Interpolationspolynome gemäss NEWTON-Schema berechnen")
print("----------------------------------------------------------------")
# punkte [[x0, x1, x2, xn], [y0, y1, y2, yn]]
punkte = [
[np.array([4, 8]), np.array([1, -1])],
[np.array([-1, 1, 2]), np.array([15, 5, 9])],
[np.array([-1, 0, 1, 2]), np.array([-5, -1, -1, 1])],
]
for punkt in punkte:
# Parameter
x_data = punkt[0]
y_data = punkt[1]
x_0 = x_data[0]
x_e = x_data[-1]
N = 201
lw = 3
fig = 1
# Berechnung
print("----------------------------------------------------------------")