diff --git a/src/plot.py b/src/plot.py index 485d7b9..52016f9 100644 --- a/src/plot.py +++ b/src/plot.py @@ -1,9 +1,15 @@ import matplotlib.pyplot as plt +import numpy as np +import math + +def rpmtorads(rpm): + return rpm/60*2*math.pi scale = 1000 x_lim = 5200 y_lim = 600 -ratio = 5 +ratio = 14 +r_eff = 0.7 T_1a = [27.590625] * x_lim T_1b = [47.278125] * x_lim @@ -11,34 +17,87 @@ T_1c = [13.528125] * x_lim T_2 = [68.544375] * x_lim #Absolute waarde, is eig. negatief T_3 = [120.080625] * x_lim -w = range(0,x_lim) +# w = range(0,x_lim) +w = np.linspace(0,5050,x_lim) -plt.plot(w,T_1a,label="T_1a") -plt.plot(w,T_1b,label="T_1b") -plt.plot(w,T_1c,label="T_1c") -plt.plot(w,T_2,label="T_2") -plt.plot(w,T_3,label="T_3") +fig, (ax1,ax2,ax3)= plt.subplots(1,3,figsize=(18,6)) -RE25_57 = [[129,0],[0,5050]] -RE25_57r = [[129*ratio,0],[0,5050/ratio]] +ax1.plot(w,T_1a,label="T_1a",linestyle=(0,(3,1,1,1))) +ax1.plot(w,T_1b,label="T_1b",linestyle=(0,(3,1,1,1))) +ax1.plot(w,T_1c,label="T_1c",linestyle=(0,(3,1,1,1))) +ax1.plot(w,T_2,label="T_2",linestyle=(0,(3,1,1,1))) +ax1.plot(w,T_3,label="T_3",linestyle=(0,(3,1,1,1))) +ax2.plot(w,T_1a,label="T_1a",linestyle=(0,(3,1,1,1))) +ax2.plot(w,T_1b,label="T_1b",linestyle=(0,(3,1,1,1))) +ax2.plot(w,T_1c,label="T_1c",linestyle=(0,(3,1,1,1))) +ax2.plot(w,T_2,label="T_2",linestyle=(0,(3,1,1,1))) +ax2.plot(w,T_3,label="T_3",linestyle=(0,(3,1,1,1))) + +RE25_57_Kem = 89.6 +RE25_57_Ksp = 107 +RE25_57_Unom = 48 + +RE25_57T = np.linspace(129,0,x_lim) +RE25_57I = np.linspace(129/RE25_57_Kem,.00852,x_lim) +# RE25_57r = [[129*ratio,0],[0,5050/ratio]] RE25_57nom = [30] * x_lim -RE25_57nomr = [30*ratio] * x_lim -RE25_49 = [[232,0],[0,10000]] -RE25_49r = [[232*ratio,0],[0,10000/ratio]] +RE25_57nomr = [30*ratio*r_eff] * x_lim +# RE25_57P = [[(RE25_57[0][0]/RE25_57_Kem)*1000,0],[0,RE25_57[1][1]/RE25_57_Ksp]] +RE25_57Pel = RE25_57I*RE25_57_Unom +RE25_57Pas = RE25_57T/1000*rpmtorads(w) +RE25_57Ploss = RE25_57Pel-RE25_57Pas +RE25_57Eff = (RE25_57Pas/RE25_57Pel)*100 +# RE25_49 = [[232,0],[0,10000]] +# RE25_49r = [[232*ratio,0],[0,10000/ratio]] -plt.plot(RE25_57[1],RE25_57[0],label="xx57") -plt.plot(RE25_57r[1],RE25_57r[0],label="xx57r") -plt.plot(w,RE25_57nom,label="xx57nom",linestyle='dashed') -plt.plot(w,RE25_57nomr,label="xx57nomr",linestyle='dashed') -plt.plot(RE25_49[1],RE25_49[0],label="xx49") -plt.plot(RE25_49r[1],RE25_49r[0],label="xx49r") +ax1.plot(w,RE25_57T,label="xx57") +ax2.plot(w/ratio,RE25_57T*ratio*r_eff,label="xx57r") +ax1.plot(w,RE25_57nom,label="xx57nom") +ax2.plot(w,RE25_57nomr,label="xx57nomr") +# plt.plot(RE25_49[1],RE25_49[0],label="xx49") +# plt.plot(RE25_49r[1],RE25_49r[0],label="xx49r") +ax3.plot(w,RE25_57Pel,label="P electrical") +ax3.plot(w,RE25_57Pas,label="P mechanical") +ax3.plot(w,RE25_57Ploss,label="P loss") -plt.xlim(0,x_lim) -plt.ylim(0,y_lim) +ax4 = ax1.twinx() +ax4.plot(w,RE25_57Eff,label="Efficiency",color='C9') -plt.xlabel('n[rpm]') -plt.ylabel('T_as[mNm]') -plt.legend() +ax5 = ax2.twinx() +ax5.plot(w/ratio,RE25_57Eff,label="Efficiency ratio'd",color='C8') -plt.show() \ No newline at end of file +ax6 = ax3.twinx() +ax6.plot(w,RE25_57Eff,label="Efficiency",color='C9') + + +ax1.set_xlim(0,x_lim) +ax1.set_ylim(0,150) +ax2.set_xlim(0,400) +ax2.set_ylim(0,1200) +ax3.set_xlim(0,x_lim) +ax3.set_ylim(0,80) +ax4.set_ylim(0,100) +ax5.set_ylim(0,100) +ax6.set_ylim(0,100) + +ax1.set_xlabel('n[rpm]') +ax1.set_ylabel('T_as[mNm]') +ax2.set_xlabel('n[rpm]') +ax2.set_ylabel('T_as[mNm]') +ax3.set_xlabel('n[rpm]') +ax3.set_ylabel('P[W]') +ax4.set_ylabel('%') +ax5.set_ylabel('%') +ax6.set_ylabel('%') + +fig.tight_layout() + +ax1.legend(loc='upper left') +ax2.legend(loc='upper left') +ax3.legend(loc='upper left') +ax4.legend(loc='upper right') +ax5.legend(loc='upper right') + + +plt.show()