Compare commits

..

No commits in common. "0d8f8ef6cc7b54eeca789cdc5283918a4a081215" and "57bb3a3368472c4facdbaffc940e6567d9ff5bd8" have entirely different histories.

View file

@ -26,13 +26,15 @@ def Miguel_S5_Aufg2(x, y, xx):
A[i][0] = 2 * (h[0] + h[1]) A[i][0] = 2 * (h[0] + h[1])
A[i][1] = h[1] A[i][1] = h[1]
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:
A[i][i - 1] = h[i - 1]
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]))
else: else:
A[i][i - 1] = h[i] A[i][i - 1] = h[i - 1]
A[i][i] = 2 * (h[i] + h[i + 1]) A[i][i] = 2 * (h[i - 1] + h[i])
z[i] = 3 * (((y[i + 2] - y[i + 1]) / h[i + 1]) - ((y[i + 1] - y[i]) / h[i])) A[i][i + 1] = h[i]
z[i] = 3 * (((y[i + 1] - y[i]) / h[i]) - ((y[i] - y[i - 1]) / h[i - 1]))
if i < n - 3:
A[i][i + 1] = h[i + 1]
c[1:n - 1,:] = linalg.solve(A, z) c[1:n - 1,:] = linalg.solve(A, z)