@@ -19,7 +19,6 @@ def __init__(
19
19
step_size : float ,
20
20
x_final : float ,
21
21
) -> None :
22
-
23
22
self .func = func
24
23
self .x_initials = x_initials
25
24
self .y_initials = y_initials
@@ -34,7 +33,10 @@ def __init__(
34
33
if step_size <= 0 :
35
34
raise ValueError ("Step size must be positive." )
36
35
37
- if not all (round (x1 - x0 ,10 ) == step_size for x0 , x1 in zip (x_initials , x_initials [1 :])):
36
+ if not all (
37
+ round (x1 - x0 , 10 ) == step_size
38
+ for x0 , x1 in zip (x_initials , x_initials [1 :])
39
+ ):
38
40
raise ValueError ("x-values must be equally spaced according to step size." )
39
41
40
42
"""
@@ -70,7 +72,6 @@ def __init__(
70
72
"""
71
73
72
74
def step_2 (self ) -> np .ndarray :
73
-
74
75
"""
75
76
>>> def f(x, y):
76
77
... return x
@@ -106,7 +107,6 @@ def step_2(self) -> np.ndarray:
106
107
return y
107
108
108
109
def step_3 (self ) -> np .ndarray :
109
-
110
110
"""
111
111
>>> def f(x, y):
112
112
... return x + y
@@ -146,7 +146,6 @@ def step_3(self) -> np.ndarray:
146
146
return y
147
147
148
148
def step_4 (self ) -> np .ndarray :
149
-
150
149
"""
151
150
>>> def f(x,y):
152
151
... return x + y
@@ -155,7 +154,7 @@ def step_4(self) -> np.ndarray:
155
154
0.30699999999999994
156
155
>>> y[5]
157
156
0.5771083333333333
158
-
157
+
159
158
>>> def f(x, y):
160
159
... return (x -y)/2
161
160
>>> AdamsBashforth(f, [0, 0.2, 0.4], [0, 0, 0.04], 0.2, 1).step_4()
@@ -192,7 +191,6 @@ def step_4(self) -> np.ndarray:
192
191
return y
193
192
194
193
def step_5 (self ) -> np .ndarray :
195
-
196
194
"""
197
195
>>> def f(x,y):
198
196
... return x + y
0 commit comments