Author: Not specified | Language: python |
Description: Not specified | Timestamp: 2018-01-17 20:48:00 +0000 |
View raw paste | Reply |
- import numpy as np
- import matplotlib.pyplot as plt
- n = np.arange(40) * 1.0
- h = np.exp(-n)
- ab = np.cos(1)
- est_raw = (np.sin(1+h) - np.sin(1)) / h
- est_new = 2 * np.cos(1+h/2) * np.sin(h/2) / h
- err = ab - est_new
- plt.grid(True)
- plt.title('test')
- plt.loglog(n, err)
- plt.show()
View raw paste | Reply |