def polaire_equi(P):
    q = 0
    mss = [0.2, 1]
    alphas = np.arange(ut.rad_of_deg(-10), ut.rad_of_deg(20), ut.rad_of_deg(1))
    km = 0.1
    for ms in mss:
        P.set_mass_and_static_margin(km, ms)
        dphrs = []
        dphrs = np.array([(P.ms * P.CLa * (alpha - P.a0) - P.Cm0) / P.Cmd
                          for alpha in alphas])
        CLe = []
        CLe = [
            dyn.get_aero_coefs(dyn.va_of_mach(0.7, 7000), alpha, q, dphr, P)[0]
            for alpha, dphr in zip(alphas, dphrs)
        ]
        Cxe = [
            dyn.get_aero_coefs(dyn.va_of_mach(0.7, 7000), alpha, q, dphr, P)[1]
            for alpha, dphr in zip(alphas, dphrs)
        ]
        finesse = [CL / Cx for Cx, CL in zip(Cxe, CLe)]
        fmax = np.max(finesse)
        idmax = np.argmax(finesse)
        print(fmax)
        plt.plot([0, Cxe[idmax]], [0, CLe[idmax]])
        plt.plot(Cxe, CLe)
    label1 = patches.Patch(color='blue', label='fmax (ms = 0.2)')
    label2 = patches.Patch(color='green', label='Polaire (ms = 0.2)')
    label3 = patches.Patch(color='red', label='fmax (ms = 1)')
    label4 = patches.Patch(color='cyan', label='Polaire (ms = 1)')
    plt.legend(loc='upper left', handles=[label1, label2, label3, label4])
    ut.decorate(plt.gca(), "Evolution de la polaire équilibrée",
                'Coefficient de trainée équilibrée',
                'Coefficient de portance équilibrée')
    plt.show
Пример #2
0
def get_CL_alpha(
    va, q, dphr, P, alpha, nb
):  # calcule CL en fonction de l'angle d'incidence alpha , (vitesse m/s,vitesse de tangage rad/sec, angle de braquage de l'empennage horozontal en rad, intervalle d'incidnce alpha  rad, nombre de points)
    angle_alpha = np.linspace(alpha[0], alpha[1], nb)
    CL = np.array([
        dynamic.get_aero_coefs(va, alpha, q, dphr, P)[0]
        for alpha in angle_alpha
    ])
    return utils.deg_of_rad(angle_alpha), CL  #angle_alpha en degré
Пример #3
0
def CLE_alpha(va, q, P, alpha, nb, ms):
    angle_alpha = np.linspace(interv_alpha[0], interv_alpha[1], nb)
    dphr = np.array([
        -(P.Cm0 - ms * P.CLa * (k - P.a0) + P.Cmq * P.lt / va * q) / P.Cmd
        for k in angle_alpha
    ])
    CLE = np.array([
        dynamic.get_aero_coefs(va, alpha, q, dphr[i], P)[0]
        for i, alpha in enumerate(angle_alpha)
    ])
    return utils.deg_of_rad(angle_alpha), CLE
Пример #4
0
def CLE_alpha(
        va, q, P, alpha, nb, ms
):  #coefficident de portance equilibrée Cle lorsque dphr=dphre, (idem)
    angle_alpha = np.linspace(alpha[0], alpha[1], nb)
    dphr = np.array([
        -(P.Cm0 - ms * P.CLa * (k - P.a0) + P.Cmq * P.lt / va * q) / P.Cmd
        for k in angle_alpha
    ])
    CLE = np.array([
        dynamic.get_aero_coefs(va, alpha, q, dphr[i], P)[0]
        for i, alpha in enumerate(angle_alpha)
    ])
    return utils.deg_of_rad(angle_alpha), CLE
def evol_coeff_portance(P):
    alphas = np.arange(ut.rad_of_deg(-10), ut.rad_of_deg(20), ut.rad_of_deg(1))
    dphrs = [ut.rad_of_deg(-30), ut.rad_of_deg(20)]
    q = 0
    Cz_tab1 = []
    Cz_tab2 = []
    for alpha in alphas:
        coeff_portance1 = dyn.get_aero_coefs(dyn.va_of_mach(0.7, 7000), alpha,
                                             q, dphrs[0], P)
        Cz_tab1.append(coeff_portance1[0])
        coeff_portance2 = dyn.get_aero_coefs(dyn.va_of_mach(0.7, 7000), alpha,
                                             q, dphrs[1], P)
        Cz_tab2.append(coeff_portance2[0])
    plt.plot(ut.deg_of_rad(alphas), Cz_tab1, 'r')
    plt.plot(ut.deg_of_rad(alphas), Cz_tab2, 'b')
    label1 = patches.Patch(color='red', label='dPHR1 = -30°')
    label2 = patches.Patch(color='blue', label='dPHR2 = 20°')
    plt.legend(loc='upper left', handles=[label1, label2])
    ut.decorate(plt.gca(),
                title="Evolution du Cz en fonction de l'incidence",
                xlab='Incidence',
                ylab='Cz')
    plt.show()
Пример #6
0
 def coeff_CLe(a, m_s):
     alpha = np.linspace(a[0], a[1], 100)
     alpha0 = PLANE.a0 * 180 / pi
     plt.figure(5)
     for m in m_s:
         PLANE.set_mass_and_static_margin(km, m)
         dphre = (PLANE.Cm0 - PLANE.ms * PLANE.CLa * ((alpha - alpha0)*pi/180)) / (Vt * PLANE.CLat)
         CL = dynamic.get_aero_coefs(va, alpha*pi/180, 0, dphre, PLANE)[0]
         plt.plot(alpha, CL, label='$m_s={}$'.format(m))
     plt.xlabel("$\\alpha_{eq}$")
     plt.ylabel("$C_{L_e}$")
     plt.title('$\\alpha_e\\mapsto C_L$')
     plt.legend()
     plt.savefig(file + "q5" + format)
     plt.show()
Пример #7
0
 def coeff_Cm(a, m_s):
     dphr = 0
     alpha = np.linspace(a[0], a[1], 100)
     m_s_original = PLANE.ms
     plt.figure(2)
     for m in m_s:
         PLANE.set_mass_and_static_margin(km, m)
         Cm = dynamic.get_aero_coefs(va, alpha*pi/180, 0, dphr, PLANE)[2]
         plt.plot(alpha, Cm, label="$m_s={}$".format(m))
     plt.xlabel("$\\alpha$")
     plt.ylabel("$C_m$")
     plt.title("$\\alpha \\mapsto C_m$")
     plt.legend()
     plt.savefig(file + "q3" + format)
     plt.show()
     PLANE.set_mass_and_static_margin(km, m_s_original)
Пример #8
0
 def polaire(a, m_s):
     alpha = np.linspace(a[0], a[1], 100)
     plt.figure(6)
     fmax = np.zeros(len(m_s))
     for i, m in enumerate(m_s):
         PLANE.set_mass_and_static_margin(km, m)
         dphre = (PLANE.Cm0 - PLANE.ms * PLANE.CLa * (alpha*pi/180)) / (Vt * PLANE.CLat)
         CL, CD = dynamic.get_aero_coefs(va, alpha*pi/180, 0,dphre, PLANE)[0:2]
         plt.plot(CD, CL, label='$m_s={}$'.format(m))
         fmax[i] = max(CL / CD)
     plt.title('Polaire équilibrée')
     plt.xlabel('$C_D$')
     plt.ylabel('$C_L$')
     plt.legend()
     plt.savefig(file + "polaire" + format)
     plt.show()
     return fmax
Пример #9
0
    def coeff_Cl(a, delta_PHR):
        """

        :param a: a list of two angles (min an max) in degree !
        :param delta_PHR: degree !
        :return:
        """
        alpha = np.linspace(a[0], a[1], 100)
        plt.figure(1)
        for d in delta_PHR:
            Cl = dynamic.get_aero_coefs(va, alpha*pi/180, 0, d*pi/180, PLANE)[0]
            plt.plot(alpha, Cl, label="$\delta_{{PHR}}={:.0f}$".format(d))
        plt.xlabel("$\\alpha$")
        plt.ylabel("$C_L$")
        plt.title("$\\alpha\\mapsto C_l$")
        plt.legend()
        plt.savefig(file + "q2" + format)
        plt.show()
def evol_CLe(P):
    q = 0
    mss = [0.2, 1]
    alphas = np.arange(ut.rad_of_deg(-10), ut.rad_of_deg(20), ut.rad_of_deg(1))
    km = 0.1
    for ms in mss:
        P.set_mass_and_static_margin(km, ms)
        dphrs = []
        dphrs = np.array([(P.ms * P.CLa * (alpha - P.a0) - P.Cm0) / P.Cmd
                          for alpha in alphas])
        CLe = []
        CLe = [
            dyn.get_aero_coefs(dyn.va_of_mach(0.7, 7000), alpha, q, dphr, P)[0]
            for alpha, dphr in zip(alphas, dphrs)
        ]
        plt.plot(ut.deg_of_rad(alphas), CLe)
    label1 = patches.Patch(color='blue', label='ms = 0.2')
    label2 = patches.Patch(color='green', label='ms = 1')
    plt.legend(loc='upper left', handles=[label1, label2])
    ut.decorate(plt.gca(), "Evolution de CLe en fonction de l'incidence",
                'Incidence', 'Coefficient de portance équilibrée')
    plt.show