File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,16 @@ def trapezoidal_rule(boundary, steps):
15
15
:param steps: The number of steps (intervals) used in the approximation
16
16
:return: The numerical approximation of the integral
17
17
18
- >>> abs(method_1 ([0, 1], 10) - 0.33333) < 0.01
18
+ >>> abs(trapezoidal_rule ([0, 1], 10) - 0.33333) < 0.01
19
19
True
20
20
21
- >>> abs(method_1 ([0, 1], 100) - 0.33333) < 0.01
21
+ >>> abs(trapezoidal_rule ([0, 1], 100) - 0.33333) < 0.01
22
22
True
23
23
24
- >>> abs(method_1 ([0, 2], 1000) - 2.66667) < 0.01
24
+ >>> abs(trapezoidal_rule ([0, 2], 1000) - 2.66667) < 0.01
25
25
True
26
26
27
- >>> abs(method_1 ([1, 2], 1000) - 2.33333) < 0.01
27
+ >>> abs(trapezoidal_rule ([1, 2], 1000) - 2.33333) < 0.01
28
28
True
29
29
"""
30
30
h = (boundary [1 ] - boundary [0 ]) / steps
@@ -94,7 +94,7 @@ def main():
94
94
b = 1.0
95
95
steps = 10.0
96
96
boundary = [a , b ]
97
- y = method_1 (boundary , steps )
97
+ y = trapezoidal_rule (boundary , steps )
98
98
print (f"y = { y } " )
99
99
100
100
You can’t perform that action at this time.
0 commit comments