Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. from math import*
  3. import numpy as np
  4.  
  5.  
  6. def Qin(i,n,teta):
  7. return max(0,sin(teta-((2*pi*(i-1))/5)))
  8.  
  9. def Qn(teta,n):
  10. S=0
  11. for p in range(1,n):
  12. S=S+max(0,sin(teta-((2*pi*(p-1))/5)))
  13. return S
  14. X=np.linspace(0,2*pi,100)
  15. L=list(range(1,6))
  16. Y1=[Qin(3,5,u) for u in X]
  17. Y2=[Qn(m,5) for m in X]
  18. for i in range(1,6):
  19.  
  20. plt.subplot(2,2,1)
  21. plt.plot(X,Y1,'b')
  22. plt.subplot(2,2,2)
  23. plt.plot(X,Y2,'r')
  24. plt.plot(X,Y3,'b')
  25. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement