We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe4e998 commit 159fd76Copy full SHA for 159fd76
1 file changed
pynumdiff/finite_difference/_finite_difference.py
@@ -28,7 +28,7 @@ def _finite_difference(x, dt, num_iterations, order):
28
elif order == 4:
29
dxdt_hat[2:-2] = (8*(x_hat[3:-1] - x_hat[1:-3]) - x_hat[4:] + x_hat[:-4])/12 # fourth-order center-difference
30
dxdt_hat[1] = (x_hat[2] - x_hat[0])/2
31
- dxdt_hat[-2] = (x_hat[-1] - x_hat[-3])/2 # use second-order formula for next-to-endpionts so as not to amplify noise
+ dxdt_hat[-2] = (x_hat[-1] - x_hat[-3])/2 # use second-order formula for next-to-endpoints so as not to amplify noise
32
dxdt_hat[0] = x_hat[1] - x_hat[0]
33
dxdt_hat[-1] = x_hat[-1] - x_hat[-2] # use first-order endpoint formulas so as not to amplify noise. See #104
34
0 commit comments