In [1]:
    
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline 
plt.style.use('ggplot')
    
In [2]:
    
# read in the test data (voltages of thermocouples)
# header u1-u10 thermocouples along the winding bar; 
# u11 - a thermocouple on a bar emersed in water
# u12 - a thermocouple in the water 
header = ['t', 'u1', 'u2', 'u3', 'u4', 'u5', 'u6', 'u7', 'u8', 'u9', 'u10', 'u11', 'u12']
df = pd.read_csv('pomiary.txt', sep='\t', header=None, names=header)
df.head()
    
    Out[2]:
In [3]:
    
# definition of thermocouple function
def getTemp(u):
    # coefficient a [degC/mV]
    a = 24
    return a*u + 19
    
In [4]:
    
t = df['t']
dfT = df.iloc[:,1:13].apply(getTemp)
header = ['T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', 'T11', 'T12']
dfT.columns = header
dfT.head()
    
    Out[4]:
In [5]:
    
plt.figure(figsize=(10,5))
for k in dfT.columns:
    plt.plot(t, dfT[k], label=k)
plt.xlabel('Time [min]')
plt.ylabel('Temperature [degC]')
plt.legend();
    
    
In [6]:
    
# max temperatures by thermocouples
dfT.max()
    
    Out[6]:
In [7]:
    
# max winding temperature
max(dfT.max())
    
    Out[7]:
In [ ]: