In [1]:
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
import auswertung as au

In [2]:
au.import_experiment_data('../Daten/2017-05-08-1403-Aufgabe 3')

In [10]:
DruckT1 = au.messungen[0]
p0 = au.messungen[0][0]
V = 10.6
Zeit = au.messungen[1]

In [4]:
# calculate the neccesary data
logpdurchp0 = [np.log(elem/p0) for elem in DruckT1]
Sp = [-V*elem*(1/Zeit[i]) for i,elem in enumerate(logpdurchp0)]


/usr/lib/python3.6/site-packages/ipykernel/__main__.py:3: RuntimeWarning: divide by zero encountered in double_scalars
  app.launch_new_instance()
/usr/lib/python3.6/site-packages/ipykernel/__main__.py:3: RuntimeWarning: invalid value encountered in double_scalars
  app.launch_new_instance()

In [5]:
# create LaTeX table
tabellendaten = au.pivot_table(au.messungen)
au.Create_Messdaten_tabellen('../Daten/Aufgabe3Tabelle',au.messgroessen, tabellendaten)

In [6]:
# render figure
figure = plt.figure()
axis_1 = figure.add_subplot(111)
xlabel_1 = axis_1.set_xlabel('Druck [mBar]')
ylabel_1 = axis_1.set_ylabel('S(p) [l/s]')
T1kurve = axis_1.plot(DruckT1, Sp, 'bx', label='S(p)')
plt.legend()

plt.savefig('../Daten/grap_aufgabe3.pdf')

plt.show()



In [7]:
figure = plt.figure()
axis_1= figure.add_subplot(111)
xlabel_1 = axis_1.set_xlabel('ln(Druck)')
ylabel_1 = axis_1.set_ylabel('S(p) [l/s]')
SpLogp = axis_1.plot(np.log(DruckT1), Sp, color='cyan', marker='x', linestyle ='', label='S(p)')
plt.legend()

plt.savefig('../Daten/grap_aufgabe_ln_3.pdf')

plt.show()



In [8]:
mean_range = np.array([ x for x in zip(Sp,DruckT1) if 0.75 > x[0] >0.65])
print(mean_range)


[[  0.72029664  66.        ]
 [  0.74058229  30.4       ]
 [  0.74915978  14.4       ]
 [  0.73545074   0.97      ]
 [  0.73054235   0.51      ]
 [  0.71653598   0.3       ]
 [  0.69447883   0.2       ]
 [  0.67187859   0.14      ]]

In [9]:
mean_performance = np.mean(au.pivot_table(mean_range)[0])
print('Mean Performance of Pump = '+str(mean_performance*3.6)+' m^3/h')


Mean Performance of Pump = 2.59151633632 m^3/h