Compare commits
No commits in common. "76153f334e5225c8db3c273ff678e2789e5c06a1" and "18d7e8cdb5968d9c75631af9e374d31151d62c08" have entirely different histories.
76153f334e
...
18d7e8cdb5
@ -1,3 +1,2 @@
|
|||||||
numpy
|
numpy
|
||||||
matplotlib
|
matplotlib
|
||||||
ipykernel
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
# %%
|
|
||||||
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
|
|
||||||
n = np.size(y_data)
|
|
||||||
TAB = np.block([[y_data], [np.zeros((n-1, n))]])
|
|
||||||
c_data = np.zeros(n)
|
|
||||||
c_data[0] = y_data[0]
|
|
||||||
|
|
||||||
print("----------------------------------------------------------------")
|
|
||||||
Loading…
x
Reference in New Issue
Block a user