Advertisement
sve_vash

Untitled

May 31st, 2020
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import math
  3.  
  4. x = [0]
  5. y = [0]
  6. u = [1]
  7.  
  8. h = 0.01
  9.  
  10. i = 0
  11. while i <= 20000:
  12. x.append(x[i] + h)
  13. y.append(y[i] + h * u[i])
  14. u.append(u[i] + h * (- 0.64 * math.sin(y[i])))
  15. i += 1
  16.  
  17. plt.plot(y, u)
  18. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement