Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions profiling/numerical_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def numerical_integration(f, a, b, n):
dx = (b - a) / n
x = a + (i + 0.5) * dx
y = f(x)
s = s + [y * dx]
s.append(y * dx)
return s


Expand All @@ -27,7 +27,7 @@ def measure_integration_errors(f, F, n_values, a, b):
for F_analytical, F_numerical_boxes in zip(F_a_list, F_n_list):
F_numerical = sum(F_numerical_boxes)
error = abs(F_analytical - F_numerical)
errors = errors + [error]
errors.append(error)

return errors

Expand Down