In [6]:
from __future__ import division, print_function
import os
if os.path.split(os.getcwd())[-1] == "Lab notebooks":
os.chdir("../../")
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import Modules.processing as pr
import Modules.plotting as pl
%load_ext autoreload
%autoreload 2
%matplotlib inline
Got in at about 10 AM. Didn't turn off DAQ last night so that appears to be working fine. Test processed a run from last night and results look just like what we expect.
Homed tow and turbine axes.
In [26]:
r = pr.Run("Perf", 2)
print(r.mean_tsr)
print(r.mean_cp)
print(r.mean_cd)
s = 5
plt.plot(r.angle[:s*2000], r.cp[:s*2000])
plt.show()
In [27]:
pr.process_latest_run("Perf")
In [30]:
s = pr.Section("Perf")
s.process()
In [33]:
omega = s.data.rpm*2*np.pi/60
s.data["tsr"] = omega*pr.R/1
power = s.data.torque*omega
s.data["cp"] = power/(0.5*1000*1*1**3)
s.data["cd"] = s.data.drag/(0.5*1000*1*1**2)
s.data
Out[33]:
In [35]:
plt.figure()
plt.plot(s.data.tsr, s.data.cp, "-o")
plt.xlabel(r"$\lambda$")
plt.ylabel(r"$C_P$")
plt.figure()
plt.plot(s.data.tsr, s.data.cd, "-s")
plt.xlabel(r"$\lambda$")
plt.ylabel(r"$C_D$")
plt.show()