Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter
- import matplotlib.pyplot as plt
- import math as m
- import numpy as np
- warmup = 30
- starttemp = 120
- waittime = 10
- soaktime = 15
- endtemp = 210
- heatrate = 10 # x/min
- one = 1
- temprange = endtemp - starttemp
- time = ((temprange//heatrate)*60)
- #time in seconds from start to end temp
- y = list(range(1,warmup,1))
- x = temprange/heatrate
- wur = list(range(warmup, starttemp,1))
- interval = int(temprange//time)
- methtime = list(range(starttemp,endtemp,1))
- #integrate heating rate functionality into the
- #projection graph by adding interval variable.
- for _ in range(one):
- y.extend(wur)
- for _ in range(soaktime):
- y.append(starttemp)
- for _ in range(waittime):
- y.append(starttemp)
- for _ in range(one):
- y.extend(methtime)
- def smooth(y, box_pts):
- box = np.ones(box_pts)/box_pts
- y_smooth = np.convolve(y, box, mode='same')
- return y_smooth
- plt.plot(y,'g--')
- #plt.plot(smooth(y,15), 'r--', lw=1)
- plt.ylabel('Temperature')
- plt.xlabel('Time')
- plt.title('PID Control Graph For Current Method')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement