-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise-d-8.py
34 lines (28 loc) · 1010 Bytes
/
exercise-d-8.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def f(m, mp, x, xp, xc, y, yp):
h = x - xp
return (m / (2 * h)) * (xc - xp) ** 2 - (mp / (2 * h)) * (x - xc) ** 2 + (y - m * h ** 2 / 6) / h - (
yp - mp * h ** 2 / 6) / h
if __name__ == '__main__':
matrix = [[1.410, 0.888551],
[1.416, 0.889559],
[1.422, 0.890637],
[1.428, 0.891667],
[1.434, 0.892687],
[1.440, 0.893698]]
xd_2 = (-2 * matrix[0][1] - 3 * matrix[1][1] + 6 * matrix[2][1] - matrix[3][1]) / (6 * 0.006)
print(f'{xd_2=}')
xdd_2 = (-2 * matrix[1][1] + 5 * matrix[2][1] - 4 * matrix[3][1] + matrix[4][1]) / 0.006 ** 2
print(f'{xdd_2=}')
sdd = -0.08823529411800789 * ((1.4258 - 1.422) / (1.428 - 1.422)) + -0.0980392156858277 * (
(1.4528 - 1.428) / (1.422 - 1.428))
print(f'{sdd=}')
sd = f(
-0.08823529411800789,
-0.0980392156858277,
1.428,
1.422,
1.4528,
0.891667,
0.890637
)
print(f'{sd=}')