### transfo ## Rendement en fonction de la puissance dissipée dans la charge import numpy as np import matplotlib.pyplot as plt import scipy.optimize as spo # données expérimentales # tension et courant au primaire U1 = np.array([]) calU1 = np.array([]) u_U1 = 0.001*U1 + 0.001*calU1 I1 = np.array([]) calI1 = np.array([]) u_I1 = 0.001*I1 + 0.001*calI1 # tension et courant au secondaire U2 = np.array([]) calU2 = np.array([]) u_U2 = 0.001*U2 + 0.001*calU2 I2 = np.array([]) calI2 = np.array([]) u_I2 = 0.001*I2 + 0.001*calI2 # puissance au primaire et au secondaire P1 = U1*I1 u_P1 = P1*np.sqrt((u_U1/U1)**2+(u_I1/I1)**2) P2 = U2*I2 u_P2 = P2*np.sqrt((u_U2/U2)**2+(u_I2/I2)**2) x = P2 # puissance dissipée dans la charge y = P2/P1 # rendement ux = u_P2 uy = y*np.sqrt((u_P1/P1)**2+(u_P2/P2)**2) # point en direct # tension et courant au primaire U1l = np.array([]) calU1l = np.array([]) u_U1l = 0.001*U1l + 0.001*calU1l I1l = np.array([]) calI1l = np.array([]) u_I1l = 0.001*I1l + 0.001*calI1l # tension et courant au secondaire U2l = np.array([]) calU2l = np.array([]) u_U2l = 0.001*U2l + 0.001*calU2l I2l = np.array([]) calI2l = np.array([]) u_I2l = 0.001*I2l + 0.001*calI2l # puissance au primaire et au secondaire P1l = U1l*I1l u_P1l = P1l*np.sqrt((u_U1l/U1l)**2+(u_I1l/I1l)**2) P2l = U2l*I2l u_P2l = P2l*np.sqrt((u_U2l/U2l)**2+(u_I2l/I2l)**2) xl = P2l # puissance dissipée dans la charge yl = P2l/P1l # rendement uxl = u_P2l uyl = yl*np.sqrt((u_P1l/P1l)**2+(u_P2l/P2l)**2) # données complètes : 1 inclure le point en live, 2 sinon live = 1 if live == 1 : xdata = np.concatenate((x,xl)) ydata = np.concatenate((y,yl)) u_xdata = np.concatenate((ux,uxl)) u_ydata = np.concatenate((uy,uyl)) else : xdata = x ydata = y u_xdata = ux u_ydata = uy # Représentation graphique fig = plt.figure() ax = fig.add_subplot(111) ax.tick_params(labelsize=18) plt.grid() # points en préparation plt.errorbar(x, y, xerr=ux, yerr=uy, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label='rendement du transformateur') # point en live if live == 1 : plt.errorbar(xl, yl, xerr=uxl, yerr=uyl,fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, color='red') # légendes des axes plt.xlabel(r'puissance dissipée à la charge', fontsize=18) plt.ylabel(r'rendement', fontsize=18) plt.legend(fontsize=18) plt.show() ## Décomposition des pertes import numpy as np import matplotlib.pyplot as plt import scipy.optimize as spo # Données expérimentales # résistance d'enroulement r1 = 1 u_r1 = 0.1 r2 = 1 u_r2 = 0.1 # pertes joules Pjoule = r1*I1**2 + r2*I2**2 u_Pjoule = np.sqrt((u_r1*I1**2)**2 + (u_r2*I2**2)**2 + (2*r1*I1*u_I1)**2 + (2*r2*I2*u_I2)**2) # pertes fer U1vide = np.array([2 for a in P2]) u_U1vide = np.array([0.2 for a in P2]) I1vide = np.array([2 for a in P2]) u_I1vide = np.array([0.2 for a in P2]) Pfer = U1vide*I1vide - r1*I1 u_Pfer = np.sqrt((u_U1vide*I1vide)**2 + (U1vide*u_I1vide)**2 + (u_r1*I1)**2 + (r1*u_I1)**2) # pertes totales calculées Pcalc = Pfer + Pjoule # pertes totales mesurées Pmes = P1 - P2 u_Pmes = np.sqrt(u_P1**2 + u_P2**2) # Représentation graphique fig = plt.figure() ax = fig.add_subplot(111) ax.tick_params(labelsize=18) plt.grid() plt.errorbar(P2, Pmes, xerr=u_P2, yerr=u_Pmes, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label="pertes mesurées") plt.errorbar(P2, Pcalc, xerr=u_P2, yerr=u_Pcalc, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label="pertes fer + pertes joules") plt.errorbar(P2, Pfer, xerr=u_P2, yerr=u_Pfer, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label="pertes fer") plt.errorbar(P2, Pjoules, xerr=u_P2, yerr=u_Pjoules, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label="pertes joules") # légendes des axes plt.xlabel(r'puissance disponible à la charge (W)', fontsize=18) plt.ylabel(r'différentes pertes (W)', fontsize=18) plt.legend(fontsize=18) plt.show() ### génératrice synchrone ## Loi de Faraday import numpy as np import matplotlib.pyplot as plt import scipy.optimize as spo # Données expérimentales v_tachy = np.array([0.99,2.02,3.04,4.03,5.02,6.05,7.02,8.02,9.03]) u_vtachy = np.array([0.002,0.002,0.002,0.002,0.002,0.003,0.003,0.003,0.003]) x = v_tachy*(1000/6)*2*np.pi/60 y = np.array([219,438,651,862,1080,1299,1495,1711,1930])/10 #tension RMS d'induit en V # incertitudes-types sur les données ux = u_vtachy*(1000/6)*2*np.pi/60 uy = np.array([3,3,3,3,3,4,4,4,7])/10 # point en live v_tachyl = np.array([6.63]) u_vtachyl = np.array([0.003]) xl = v_tachyl*(1000/6)*2*np.pi/60 yl = np.array([1420])/10 # incertitudes-types sur le point en live uxl = u_vtachyl*(1000/6)*2*np.pi/60 uyl = np.array([0.003])/10 # données complètes : 1 inclure le point en live, 2 sinon live = 1 if live == 1 : xdata = np.concatenate((x,xl)) ydata = np.concatenate((y,yl)) u_xdata = np.concatenate((ux,uxl)) u_ydata = np.concatenate((uy,uyl)) else : xdata = x ydata = y u_xdata = ux u_ydata = uy # Ajustement # fonction f décrivant la courbe à ajuster aux données def f(x,a,b): return a*x+b # estimation initiale des paramètres params0 = np.array([0,0]) # routine Python réalisant l'ajustement result = spo.curve_fit(f, xdata, ydata, sigma=u_ydata) # on obtient : # les paramètres d'ajustement optimaux a,b = result[0]; # la matrice de variance-covariance estimée des paramètres pcov = result[1]; # les incertitudes-types sur ces paramètres ua,ub = np.sqrt(np.abs(np.diagonal(pcov))) # Représentation graphique fig = plt.figure() ax = fig.add_subplot(111) ax.tick_params(labelsize=18) plt.grid() lx=np.linspace(min(xdata),max(xdata),1000) plt.errorbar(x, y, xerr=ux, yerr=uy, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label = 'I(inducteur) = 0.3 A') plt.plot(lx,f(lx,a,b),linewidth=2,color='green', label='ajustement $f(x) = ax+b$ \n $a$ = {:.3e} $\pm$ {:.3e} \n $b$ = {:.3e} $\pm$ {:.3e}'.format(a, ua, b, ub)) #point en live if live == 1 : plt.errorbar(xl, yl, xerr=uxl, yerr=uyl,fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, color='red') # légendes des axes plt.xlabel(r'vitesse de rotation en rad/s', fontsize=18) plt.ylabel(r"tension RMS d'induit en V", fontsize=18) plt.legend(fontsize=18) plt.show() ## Rendement à 1500 tr/min import numpy as np import matplotlib.pyplot as plt import scipy.optimize as spo # Données expérimentales omega = 1000*2*np.pi/60 # rad/s Uabs = np.array([23.6, 24, 24.2, 24.7, 25.1, 25.6, 25.96, 26.4]) # V Iabs = np.array([3.63, 4.04, 4.46, 5.15, 5.78, 6.66, 7.24, 7.95]) # A Uind = np.array([220, 222, 223, 224, 225, 227, 226, 227]) # V Iind = np.array([0.368, 0.368, 0.368, 0.367, 0.367, 0.368, 0.366, 0.366]) # A Ucharge = np.array([135, 134, 132, 130, 128.5, 125, 122.5, 120]) # V Icharge = np.array([0.270, 0.328, 0.387, 0.483, 0.572, 0.695, 0.781, 0.887]) # A Pu = Uabs*Iabs - 0.089*omega -7.4e-5*omega**2 - 0.98*Iabs**2 # W Pind = Uind*Iind # W Ps = Ucharge*Icharge # W eta = Ps/(Pu + Pind) x = Ps ux = np.array([0 for e in Ps]) y = eta uy = np.array([0 for e in eta]) # Point en direct Uabsl = np.array([]) # V Iabsl = np.array([]) # A Uindl = np.array([]) # V Iindl = np.array([]) # A Uchargel = np.array([]) # V Ichargel = np.array([]) # A Pul = Uabsl*Iabsl - 0.089*omega -7.4e-5*omega**2 - 0.85*Iabsl**2 # W Pindl = Uindl*Iindl # W Psl = Uchargel*Ichargel # W etal = Psl/(Pul + Pindl) xl = Psl uxl = np.array([0 for e in Psl]) yl = etal uyl = np.array([0 for e in etal]) # données complètes : 1 inclure le point en live, 2 sinon live = 1 if live == 1 : xdata = np.concatenate((x,xl)) ydata = np.concatenate((y,yl)) u_xdata = np.concatenate((ux,uxl)) u_ydata = np.concatenate((uy,uyl)) else : xdata = x ydata = y u_xdata = ux u_ydata = uy # Représentation graphique fig = plt.figure() ax = fig.add_subplot(111) ax.tick_params(labelsize=18) plt.grid() plt.errorbar(x, y, xerr=ux, yerr=uy, fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, label = 'omega = 1000 tour/min') #point en live if live == 1 : plt.errorbar(xl, yl, xerr=uxl, yerr=uyl,fmt='o', ms=5, capsize=2, capthick=2, linewidth=2, color='red') # légendes des axes plt.xlabel(r'puissance à la charge en W', fontsize=18) plt.ylabel(r"rendement", fontsize=18) plt.legend(fontsize=18) plt.show() ## Pertes à 1500 tr/min # Pertes mécanique Uabs1 = 21.03 # V Iabs1 = 0.6 # A Pmeca = np.array([Uabs1*Iabs1 - 0.089*omega -7.4e-5*omega**2 - 0.98*Iabs1**2 for e in xdata]) # Pertes fer dans l'induit (pas de pertes fer dans l'inducteur) Uabs2 = 22.310 # V Iabs2 = 1.59 # A Pfer = np.array([Uabs2*Iabs2 - Uabs1*Iabs1 for e in xdata]) # Pertes joules dans l'inducteur Rinducteur = 644 PJinducteur = Rinducteur*Iind**2 # Pertes joules dans l'induit Rinduit = 13.2 # Ohm PJinduit = Rinduit*Icharge**2 # Pertes totales mesurées Pmes = Pu + Pind - Ps # Pertes totales calculées Pcalc = Pmeca + Pfer + Pinducteur + Pinduit # Représentation graphique fig = plt.figure() ax = fig.add_subplot(111) ax.tick_params(labelsize=18) plt.grid() plt.plot(xdata, Pmeca,'o-', label='pertes méca') plt.plot(xdata, Pfer,'o-', label='pertes fer') plt.plot(xdata, PJinducteur,'o-', label="pertes joules dans l'inducteur") plt.plot(xdata, PJinduit,'o-', label="pertes joules dans l'induit") plt.plot(xdata, Pmes,'o-', label="pertes totales mesurées") plt.plot(xdata, Pcalc,'o-', label = "pertes joules + fer + méca") # légendes des axes plt.xlabel(r'puissance disponible à la charge à la charge (W)', fontsize=18) plt.ylabel(r"différentes pertes (W)", fontsize=18) plt.title("décomposition des pertes à 1500 tr/min", fontsize=18) plt.legend(fontsize=18) plt.show()