Skip to content

Commit

Permalink
Update finite-difference.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jussienko authored Sep 11, 2020
1 parent a4cb64c commit 5ae6f0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/finite-difference/solution/finite-difference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

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

0 comments on commit 5ae6f0d

Please sign in to comment.