| Hosted by CoCalc | Download
Kernel: Python 3 (Anaconda 2019)
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.integrate import odeint from numpy import diff dt = 1 f=open('vacuum.txt') g=open('5torr.txt') h=open('23torr.txt') i=open('120torr.txt') j=open('180torr.txt') #vacuum temp_vac = [] for line in f: temp=line.split () temp_vac.append(eval(temp[0])) time = np.linspace(0,412,412) time_dT = np.linspace(0,411,411) dT=-1*(diff(temp_vac)/dt) #5torr temp_5 = [] for line in g: temp=line.split () temp_5.append(eval(temp[0])) time_5 = np.linspace(0,572,572) dT_5=-1*(diff(temp_5)/dt) #23torr temp_23 = [] for line in h: temp=line.split () temp_23.append(eval(temp[0])) time_23 = np.linspace(0,758,758) dT_23=-1*(diff(temp_23)/dt) #120torr temp_120 = [] for line in i: temp=line.split () temp_120.append(eval(temp[0])) time_120 = np.linspace(0,799,799) dT_120=-1*(diff(temp_120)/dt) #180torr temp_180 = [] for line in j: temp=line.split () #print(temp) temp_180.append(eval(temp[0])) time_180 = np.linspace(0,663,663) dT_180=-1*(diff(temp_180)/dt) plt.figure(figsize=(20,10)) plt.ylim(0,2.2) plt.xlabel('Time(s)') plt.ylabel('dT/dt') plt.plot(time_dT,(dT),label='0torr') plt.plot(time_5,dT_5,label='5torr') plt.plot(time_23,dT_23,label='23torr') plt.plot(time_120,dT_120,label='120torr') plt.plot(time_180,dT_180,label='180torr') plt.legend() plt.show
<function matplotlib.pyplot.show>
Image in a Jupyter notebook
plt.figure(figsize=(20,10)) #plt.ylim(0,2.2) del temp_vac[-1] del temp_5[1] del temp_23[-1] del temp_120[-1] del temp_180[-1] plt.xlabel('Temp (deg C)') plt.ylabel('dT/dt') plt.plot(temp_vac,(dT),label='0torr') plt.plot(temp_5,dT_5,label='5torr') plt.plot(temp_23,dT_23,label='23torr') plt.plot(temp_120,dT_120,label='120torr') plt.plot(temp_180,dT_180,label='180torr') plt.legend() plt.show
<function matplotlib.pyplot.show>
Image in a Jupyter notebook