Fix incorrect algorithm
This commit is contained in:
parent
483f4d1c25
commit
57bb3a3368
|
@ -28,7 +28,7 @@ def Miguel_S5_Aufg2(x, y, xx):
|
||||||
z[i] = 3 * (((y[2] - y[1]) / h[1]) - ((y[1] - y[0]) / h[0]))
|
z[i] = 3 * (((y[2] - y[1]) / h[1]) - ((y[1] - y[0]) / h[0]))
|
||||||
elif i == n - 3:
|
elif i == n - 3:
|
||||||
A[i][i - 1] = h[i - 1]
|
A[i][i - 1] = h[i - 1]
|
||||||
A[i][i] = h[i - 1] + h[i]
|
A[i][i] = 2 * (h[i - 1] + h[i])
|
||||||
z[i] = 3 * (((y[i + 1] - y[i]) / h[i]) - ((y[i] - y[i - 1]) / h[i - 1]))
|
z[i] = 3 * (((y[i + 1] - y[i]) / h[i]) - ((y[i] - y[i - 1]) / h[i - 1]))
|
||||||
else:
|
else:
|
||||||
A[i][i - 1] = h[i - 1]
|
A[i][i - 1] = h[i - 1]
|
||||||
|
@ -63,6 +63,5 @@ y = array([6, 3, 9, 0])
|
||||||
xx = array([4.5, 6.5, 9.0])
|
xx = array([4.5, 6.5, 9.0])
|
||||||
|
|
||||||
Miguel_S5_Aufg2(x, y, xx)
|
Miguel_S5_Aufg2(x, y, xx)
|
||||||
pyplot.scatter(xx, interpolate.CubicSpline(x, y)(xx))
|
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
|
|
Loading…
Reference in a new issue