<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 NOTE TO USER
Step1:  Aluminum Free Convection
Step2:  Calculation of Time Constant $\tau$ for Free Convection Aluminum
Step3:  Calculation of $h$ for Free Convection Aluminum
From the value of tau calculated above, the value of h can be obtained using the relation, 
$$\tau = \frac{\rho V c}{hA}$$
Step4:  Brass Free Convection
Step5:  Dimensionless Plot for Free Convection Brass
Step6:  Calculation of Time Constant $\tau$ for Free Convection Brass
Step7:  Calculation of $h$ for Free Convection Brass
Step8:  Aluminum Forced Convection
Step9:  Aluminum Forced Convection Time Constant Calculations
Step10:  Calculation of $h$ for Forced Convection Aluminum
Step11:  Brass Forced Convection
Step12:  Aluminum Forced Convection Time Constant Calculations
Step13:  Calculation of $h$ for Forced Convection Aluminum
<ASSISTANT_TASK:>
Python Code:
temp1 = np.array([30,35,40,45,50,55,60,65,70,75,80,85,90])
temp2 = np.array([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90])
measured = np.array([1.142,1.280,1.475,1.698,1.882,2.10,2.26,2.53,2.70,2.93,3.11,3.32,3.42])
expected = np.array([0,.198,.397,.597,.798,1,1.203,1.407,1.612,1.817,2.023,2.230,2.436,2.644,2.851,3.059,3.267,3.474,3.682])
plt.errorbar(temp1,measured,fmt = "--",label = "Measured Data", xerr = .5,yerr=.01)
plt.plot(temp2,expected, label = "Standard Data")
plt.legend()
plt.xlabel('Temperature (\N{DEGREE SIGN}C)')
plt.ylabel('Voltage (V)')
plt.show()
Explanation: NOTE TO USER: ONLY RUN SEQUENTIALLY (don't forget your namespaces)
End of explanation
dirPath = os.path.realpath('.')
fileName = 'rawData\AL_NewtonsCoolingComplete.csv'
filePath = os.path.join(dirPath, fileName)
df = pd.read_csv(filePath,header=0)
cols = df.columns
startTime = df[cols[0]][0]
timeArray = []
for i in range(0,len(df[cols[0]])):
    startTime = datetime.strptime(df[cols[0]][0], '%I:%M:%S %p')
    timeArray = []
for i in range(0,len(df[cols[0]])):
    timeArray.append((datetime.strptime(df[cols[0]][i], '%I:%M:%S %p') - startTime).total_seconds())
offsetValue = 4.1
tempWithOffset = df[cols[1]] + offsetValue
plt.plot(timeArray,tempWithOffset,'b')
plt.xlabel('Time (s)')
plt.ylabel('Temperature (\N{DEGREE SIGN}C)')
plt.grid()
plt.title('Al Free Convection Temperature vs. Time')
plt.xlim([0,250])
plt.ylim([0,95])
plt.plot(timeArray[1005], df[cols[1]][1005],'*r')
plt.show()
tempWithOffset = df[cols[1]] + offsetValue
Tinf = 4
T0= df[cols[1]][0] + offsetValue
theta = (tempWithOffset - Tinf)/(T0-Tinf)
rho= 2707
c = 879
R= .0254
k = 204
tauTime = k*np.array(timeArray)/(rho*c*R**2)  # dimensionless time
plt.plot(tauTime,np.log(theta),'b')
plt.xlabel('Dimensionless Time')
plt.ylabel('Natural Log Dimensionless Temperature')
plt.grid()
plt.title('Al Free Convection Temperature vs. Time')
plt.show()
Ttau = np.average(df[cols[1]][0:300]*(1-0.632))
print('Ttau =',Ttau)
Explanation: Aluminum Free Convection
End of explanation
Ttau = np.average(df[cols[1]][0:300]*(1/np.e))
Tau = []  # time constant
for i in range(0,len(df[cols[1]])):
    if np.abs(df[cols[1]][i]-Ttau) < 0.1:
        print(df[cols[1]][i])
        print('i =',i)
        Tau.append(timeArray[i])
print(len(timeArray))
testStart = 68
Tau = np.average(Tau) - testStart
print('Time constant, tau =',Tau)
Explanation: Calculation of Time Constant $\tau$ for Free Convection Aluminum
End of explanation
h = rho*R*c/(3*Tau)
print('h =', h)
Bi = h*R/k
print('Biot =',Bi)
Explanation: Calculation of $h$ for Free Convection Aluminum
From the value of tau calculated above, the value of h can be obtained using the relation, 
$$\tau = \frac{\rho V c}{hA}$$
End of explanation
dirPath = os.path.realpath('.')
fileName = 'rawData\Brass_NewtonsCoolingComplete1.csv'
filePath = os.path.join(dirPath, fileName)
df = pd.read_csv(filePath,header=0)
cols = df.columns
startTime = df[cols[0]][0]
timeArray = []
for i in range(0,len(df[cols[0]])):
    startTime = datetime.strptime(df[cols[0]][0], '%I:%M:%S %p')
    timeArray = []
for i in range(0,len(df[cols[0]])):
    timeArray.append((datetime.strptime(df[cols[0]][i], '%I:%M:%S %p') - startTime).total_seconds())
offsetValue = 4.1
tempWithOffset = df[cols[1]] + offsetValue
plt.plot(timeArray,tempWithOffset,'b')
plt.xlabel('Time (s)')
plt.ylabel('Temperature (\N{DEGREE SIGN}C)')
plt.grid()
plt.title('Brass Free Convection Temperature vs. Time')
plt.xlim([0,250])
plt.ylim([0,95])
plt.show()
Explanation: Brass Free Convection
End of explanation
tempWithOffset = df[cols[1]] + offsetValue
Tinf = 4
T0= df[cols[1]][0] + offsetValue
theta = (tempWithOffset - Tinf)/(T0-Tinf)
# Brass material properties
rho= 8522
c = 380
R= .0254
k = 104
tauTime = k*np.array(timeArray)/(rho*c*R**2)  # dimensionless time
plt.plot(tauTime,np.log(theta),'b')
plt.xlabel('Dimensionless Time')
plt.ylabel('Natural Log Dimensionless Temperature')
plt.grid()
plt.title('Brass Free Convection Temperature vs. Time')
plt.show()
Explanation: Dimensionless Plot for Free Convection Brass
End of explanation
Ttau = np.average(df[cols[1]][0:300]*(1/np.e))
Tau = []  # time constant
for i in range(0,len(df[cols[1]])):
    if np.abs(df[cols[1]][i]-Ttau) < 0.1:
        print(df[cols[1]][i])
        print('i =',i)
        Tau.append(timeArray[i])
print(len(timeArray))
testStart = 32
Tau = np.average(Tau) - testStart
print('Time constant, tau =',Tau)
Explanation: Calculation of Time Constant $\tau$ for Free Convection Brass
End of explanation
h = rho*R*c/(3*Tau)
print('h =', h)
Bi = h*R/k
print('Biot =',Bi)
Explanation: Calculation of $h$ for Free Convection Brass
End of explanation
dirPath = os.path.realpath('.')
fileName = 'rawData\Al_ForcedConvection.csv'
filePath = os.path.join(dirPath, fileName)
df = pd.read_csv(filePath,header=0)
cols = df.columns
startTime = df[cols[0]][0]
timeArray = []
for i in range(0,len(df[cols[0]])):
    startTime = datetime.strptime(df[cols[0]][0], '%I:%M:%S %p')
    timeArray = []
for i in range(0,len(df[cols[0]])):
    timeArray.append((datetime.strptime(df[cols[0]][i], '%I:%M:%S %p') - startTime).total_seconds())
offsetValue = 4.6
tempWithOffset = df[cols[1]] + offsetValue
plt.plot(timeArray,tempWithOffset,'b')
plt.xlabel('Time (s)')
plt.ylabel('Temperature (\N{DEGREE SIGN}C)')
plt.grid()
plt.title('Al Forced Convection Temperature vs. Time')
plt.xlim([0,250])
plt.ylim([0,95])
plt.show()
tempWithOffset = df[cols[1]] + offsetValue
Tinf = 4
T0= df[cols[1]][0] + offsetValue
theta = (tempWithOffset - Tinf)/(T0-Tinf)
rho= 2707
c = 879
R= .0254
k = 204
tauTime = k*np.array(timeArray)/(rho*c*R**2)  # dimensionless time
plt.plot(tauTime,np.log(theta),'b')
plt.xlabel('Dimensionless Time')
plt.ylabel('Natural Log Dimensionless Temperature')
plt.grid()
plt.title('Al Forced Convection Temperature vs. Time')
plt.show()
Explanation: Aluminum Forced Convection
End of explanation
Ttau = np.average(df[cols[1]][0:300]*(1/np.e))
Tau = []  # time constant
for i in range(0,len(df[cols[1]])):
    if np.abs(df[cols[1]][i]-Ttau) < 0.1:
        print(df[cols[1]][i])
        print('i =',i)
        Tau.append(timeArray[i])
print(len(timeArray))
testStart = 75
Tau = np.average(Tau) - testStart
print('Time constant, tau =',Tau)
Explanation: Aluminum Forced Convection Time Constant Calculations
End of explanation
h = rho*R*c/(3*Tau)
print('h =', h)
Bi = h*R/k
print('Biot =',Bi)
Explanation: Calculation of $h$ for Forced Convection Aluminum
End of explanation
dirPath = os.path.realpath('.')
fileName = 'rawData\Brass_ForcedConvection1.csv'
filePath = os.path.join(dirPath, fileName)
df = pd.read_csv(filePath,header=0)
cols = df.columns
startTime = df[cols[0]][0]
timeArray = []
for i in range(0,len(df[cols[0]])):
    startTime = datetime.strptime(df[cols[0]][0], '%I:%M:%S %p')
    timeArray = []
for i in range(0,len(df[cols[0]])):
    timeArray.append((datetime.strptime(df[cols[0]][i], '%I:%M:%S %p') - startTime).total_seconds())
offsetValue = 2.3
tempWithOffset = df[cols[1]] + offsetValue
plt.plot(timeArray,tempWithOffset,'b')
plt.xlabel('Time (s)')
plt.ylabel('Temperature (\N{DEGREE SIGN}C)')
plt.grid()
plt.title('Brass Forced Convection Temperature vs. Time')
plt.xlim([0,145])
plt.ylim([0,95])
plt.show()
tempWithOffset = df[cols[1]] + offsetValue
Tinf = 3
T0= df[cols[1]][0] + offsetValue
theta = (tempWithOffset - Tinf)/(T0-Tinf)
# material properties
rho= 8522
c = 380
R= .0254
k = 104
tauTime = k*np.array(timeArray)/(rho*c*R**2)  # dimensionless time
plt.plot(tauTime,np.log(theta),'b')
plt.xlabel('Dimensionless Time')
plt.ylabel('Natural Log Dimensionless Temperature')
plt.grid()
plt.title('Brass Free Convection Temperature vs. Time')
plt.show()
Explanation: Brass Forced Convection
End of explanation
Ttau = np.average(df[cols[1]][0:300]*(1/np.e))
Tau = []  # time constant
for i in range(0,len(df[cols[1]])):
    if np.abs(df[cols[1]][i]-Ttau) < 0.1:
        print(df[cols[1]][i])
        print('i =',i)
        Tau.append(timeArray[i])
print(len(timeArray))
testStart = 35
Tau = np.average(Tau) - testStart
print('Time constant, tau =',Tau)
Explanation: Aluminum Forced Convection Time Constant Calculations
End of explanation
h = rho*R*c/(3*Tau)
print('h =', h)
Bi = h*R/k
print('Biot =',Bi)
1/50
Explanation: Calculation of $h$ for Forced Convection Aluminum
End of explanation
<END_TASK>