Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. import tkinter
  2. import matplotlib.pyplot as plt
  3. import math as m
  4. import numpy as np
  5.  
  6. warmup = 30
  7. starttemp = 120
  8. waittime = 10
  9. soaktime = 15
  10. endtemp = 210
  11. heatrate = 10 # x/min
  12. one = 1
  13.  
  14. temprange = endtemp - starttemp
  15. time = ((temprange//heatrate)*60)
  16. #time in seconds from start to end temp
  17. y = list(range(1,warmup,1))
  18. x = temprange/heatrate
  19. wur = list(range(warmup, starttemp,1))
  20. interval = int(temprange//time)
  21. methtime = list(range(starttemp,endtemp,1))
  22. #integrate heating rate functionality into the
  23. #projection graph by adding interval variable.
  24.  
  25. for _ in range(one):
  26. y.extend(wur)
  27.  
  28. for _ in range(soaktime):
  29. y.append(starttemp)
  30.  
  31. for _ in range(waittime):
  32. y.append(starttemp)
  33.  
  34. for _ in range(one):
  35. y.extend(methtime)
  36.  
  37. def smooth(y, box_pts):
  38. box = np.ones(box_pts)/box_pts
  39. y_smooth = np.convolve(y, box, mode='same')
  40. return y_smooth
  41.  
  42. plt.plot(y,'g--')
  43. #plt.plot(smooth(y,15), 'r--', lw=1)
  44. plt.ylabel('Temperature')
  45. plt.xlabel('Time')
  46. plt.title('PID Control Graph For Current Method')
  47. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement