daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2. import matplotlib.pyplot as plt
  3. import numpy as np
  4.  
  5. u1 = []
  6. u2 = []
  7. x = []
  8. i = 0
  9. a = 0.0
  10. b = 1.0
  11. h = 0.05
  12. n = (b-a)/h
  13. k = 0.0
  14.  
  15. u1.append(0.0)
  16. u2.append(1.0)
  17. x.append(0.0)
  18.  
  19. while i < n:
  20.     u1.append(u1[i]+h*u2[i])
  21.     u2.append(u2[i]+h*(-2*(math.tan(k))*u2[i]-(1.0-math.tan(k))*u1[i]+(1.0-math.tan(k))*(math.asin(math.tan(k)))))
  22.     i+=1
  23.     k+=h
  24.     x.append(k)
  25.    
  26. print(u1,x)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top