Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ae6f0d

Browse files
authored
Update finite-difference.py
1 parent a4cb64c commit 5ae6f0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numpy/finite-difference/solution/finite-difference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
# Compare to cos. Note that derivative was not defined in end points
1414
f_ref = np.cos(xi[1:-1])
15-
print("Mean squared difference:")
16-
print(np.sqrt(np.sum((dfi - f_ref)**2)))
15+
print("Root mean squared difference:")
16+
print(np.sqrt(np.mean((dfi - f_ref)**2)))
1717
plt.plot(xi[1:-1], dfi, label="sin'")
1818
plt.plot(xi[1:-1], f_ref, label="cos")
1919
plt.legend()

0 commit comments

Comments
 (0)