Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- y0 = math.sqrt(2) - 1
- a0 = 6 - (4 * math.sqrt(2))
- def f(y):
- fy= (1 - (y**4)) ** (0.25)
- return fy
- def calculate_y_kp1(k):
- return (1 - f(y[k])) / (1 + f(y[k]))
- def calculate_a_kp1(k):
- return (a[k] * (1 + y[k+1]) ** 4) - (2 ** (2*k+3) * y[k+1] * (1 + y[k+1] + (y[k+1] ** 2)))
- y = [y0]
- a = [a0]
- est = []
- for k in range(15):
- y.append(calculate_y_kp1(k))
- a.append(calculate_a_kp1(k))
- est.append(1/a[k+1])
- print(est)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement