def plot_CL(P, filename=None):
    alphas = np.linspace(ut.rad_of_deg(-10), ut.rad_of_deg(20), 30)
    dms = np.linspace(ut.rad_of_deg(20), ut.rad_of_deg(-30), 3)
    figure = ut.prepare_fig(None, u'Coefficient de Portance {}'.format(P.name))
    for dm in dms:
        plt.plot(ut.deg_of_rad(alphas), CL(P, alphas, dm))
    ut.decorate(plt.gca(), u'Coefficient de Portance', r'$\alpha$ en degres', '$C_L$')
    plt.legend(['$\delta _{{PHR}} =  ${:.1f}'.format(ut.deg_of_rad(dm)) for dm in dms], loc='best')
    if filename<> None: plt.savefig(filename, dpi=160)
def plot_dphr_e(P, filename=None):
    alphas = np.linspace(ut.rad_of_deg(-10), ut.rad_of_deg(20), 30)
    mss = [-0.1, 0., 0.2, 1.]
    figure = ut.prepare_fig(None, u'Équilibre {}'.format(P.name))
    for ms in mss:
        P.set_mass_and_static_margin(0.5, ms)
        dmes = np.array([dphr_e(P, alpha) for alpha in alphas])
        plt.plot(ut.deg_of_rad(alphas), ut.deg_of_rad(dmes))
    ut.decorate(plt.gca(), r'$\delta_{PHR_e}$', r'$\alpha$ en degres', r'$\delta_{PHR_e}$ en degres',
                ['$ms =  ${: .1f}'.format(ms) for ms in mss])
Exemplo n.º 3
0
def dphre_vt(
    va, q, P, alpha, nb, ms, coeff
):  #dphre en fonction de de l'incidence alpha e ,(idem que precedemment, coefficient pour volume d'empennage Vt)
    angle_alpha = np.linspace(alpha[0], alpha[1], nb)
    P.set_mass_and_static_margin(P.m_k, ms)
    dphre = np.array([
        -(P.Cm0 - ms * P.CLa * (k - P.a0) + P.Cmq * P.lt / va * q) /
        (P.Cmd * coeff) for k in angle_alpha
    ])
    return utils.deg_of_rad(angle_alpha), utils.deg_of_rad(
        dphre)  #angle alpha et dphre en degré
Exemplo n.º 4
0
def plot(time, X, U=None, figure=None, window_title="Trajectory"):
    figure = ut.prepare_fig(figure, window_title, (20.48, 10.24))
    plots = [("$y$", "m", X[:, s_y], None), ("$h$", "m", X[:, s_h], 2.),
             ("$v_a$", "m/s", X[:, s_va], 1.),
             ("$\\alpha$", "deg", ut.deg_of_rad(X[:, s_a]), 2.),
             ("$\\theta$", "deg", ut.deg_of_rad(X[:, s_th]), 2.),
             ("$q$", "deg/s", ut.deg_of_rad(X[:, s_q]), 2.)]
    for i, (title, ylab, data, min_yspan) in enumerate(plots):
        ax = plt.subplot(3, 2, i + 1)
        plt.plot(time, data)
        ut.decorate(ax, title=title, ylab=ylab, min_yspan=min_yspan)
    return figure
Exemplo n.º 5
0
def plot(time, X, U=None, figure=None, window_title="Trajectory"):
    figure = ut.prepare_fig(figure, window_title, (20.48, 10.24))
    plots = [("$y$", "m", X[:, s_y], None),
             ("$h$", "m", X[:, s_h], 2.),
             ("$v_a$", "m/s", X[:, s_va], 1.),
             ("$\\alpha$", "deg", ut.deg_of_rad(X[:, s_a]), 2.),
             ("$\\theta$", "deg", ut.deg_of_rad(X[:, s_th]), 2.),
             ("$q$", "deg/s", ut.deg_of_rad(X[:, s_q]), 2.)]
    for i, (title, ylab, data, min_yspan) in enumerate(plots):
        ax = plt.subplot(3, 2, i + 1)
        plt.plot(time, data)
        ut.decorate(ax, title=title, ylab=ylab, min_yspan=min_yspan)
    return figure
def plot_Cm(P, filename=None):
    alphas = np.linspace(ut.rad_of_deg(-10), ut.rad_of_deg(20), 30)
    mss = np.array([-0.1, 0, 0.2, 1])
    figure = ut.prepare_fig(None, u'Coefficient du moment de tangage {}'.format(P.name))
    for ms1 in mss:
        plt.plot(ut.deg_of_rad(alphas), Cm(P, alphas, ms1))
    ut.decorate(plt.gca(), u'Coefficient du moment de tangage', r'$\alpha$ en degres', '$C_m$')
    plt.legend(['ms =  {}'.format(ms) for ms in mss], loc='best')
    if filename<> None: plt.savefig(filename, dpi=160)
Exemplo n.º 7
0
def plot_all(time, X, U, Yc=None, figure=None, window_title="trajectory"):
    margins = (0.04, 0.05, 0.98, 0.96, 0.20, 0.34)
    figure = utils.prepare_fig(figure,
                               window_title,
                               figsize=(0.75 * 20.48, 0.75 * 10.24),
                               margins=margins)
    plots = [("x", "m", X[:, Plant.s_x]), ("xd", "m/s", X[:, Plant.s_xd]),
             ("$\\theta$", "deg", utils.deg_of_rad(X[:, Plant.s_theta])),
             ("$\\theta d$", "deg/s", utils.deg_of_rad(X[:, Plant.s_thetad])),
             ("$\\tau$", "N.m", U[:, Plant.i_t])]
    for i, (title, ylab, data) in enumerate(plots):
        ax = plt.subplot(len(plots), 1, i + 1)
        plt.plot(time, data, linewidth=2)
        utils.decorate(ax, title=title, ylab=ylab)
    if Yc is not None:
        plt.subplot(len(plots), 1, 1)
        plt.plot(time, Yc, linewidth=2)
    return figure
Exemplo n.º 8
0
def get_Cm_alpha(
    va, q, dphr, P, alpha, nb, ms
):  # calcule Cm en fonction de l'angle d'incidence alpha, (vitesse m/s, vitesse de tangage rad/sec, angle de braquage de l'empennage horizontal en rad, intervalle d'incidnce alpha  rad, nombre de points)
    angle_alpha = np.linspace(alpha[0], alpha[1], nb)
    Cm = np.array([
        P.Cm0 - ms * P.CLa * (k - P.a0) + P.Cmq * P.lt / va * q + P.Cmd * dphr
        for k in angle_alpha
    ])
    return utils.deg_of_rad(angle_alpha), Cm  #angle alpha en degré
Exemplo n.º 9
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é
Exemplo n.º 10
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
Exemplo n.º 11
0
def plot_CLe(P):
    alphas = np.linspace(ut.rad_of_deg(-10), ut.rad_of_deg(20), 30)
    figure = ut.prepare_fig(None, u'Coefficient de portance équilibrée {}'.format(P.name))
    sms = [0.2, 1]
    for sm in sms:
        P.set_mass_and_static_margin(0.5, sm)
        dphres = [dphr_e(P, alpha) for alpha in alphas]
        CLes = [CL(P, alpha, dphr) for alpha, dphr in zip(alphas, dphres)]
        plt.plot(ut.deg_of_rad(alphas), CLes)
    ut.decorate(plt.gca(), u'Coefficient de portance équilibrée', r'$\alpha$ en degres', r'$CL_e$',
                ['$ms =  ${: .1f}'.format(sm) for sm in sms])
def evol_Cm(P):
    ms = [-0.1, 0, 0.2, 1]
    dphr = 0
    alphas = np.arange(ut.rad_of_deg(-10), ut.rad_of_deg(20), ut.rad_of_deg(1))
    Cm_tab1 = []
    Cm_tab2 = []
    Cm_tab3 = []
    Cm_tab4 = []
    q = 0
    for alpha in alphas:
        Cm1 = P.Cm0 - ms[0] * P.CLa * (alpha -
                                       P.a0) + P.Cmq * P.lt / dyn.va_of_mach(
                                           0.7, 7000) * q + P.Cmd * dphr
        Cm_tab1.append(Cm1)
        Cm2 = P.Cm0 - ms[1] * P.CLa * (alpha -
                                       P.a0) + P.Cmq * P.lt / dyn.va_of_mach(
                                           0.7, 7000) * q + P.Cmd * dphr
        Cm_tab2.append(Cm2)
        Cm3 = P.Cm0 - ms[2] * P.CLa * (alpha -
                                       P.a0) + P.Cmq * P.lt / dyn.va_of_mach(
                                           0.7, 7000) * q + P.Cmd * dphr
        Cm_tab3.append(Cm3)
        Cm4 = P.Cm0 - ms[3] * P.CLa * (alpha -
                                       P.a0) + P.Cmq * P.lt / dyn.va_of_mach(
                                           0.7, 7000) * q + P.Cmd * dphr
        Cm_tab4.append(Cm4)
    plt.plot(ut.deg_of_rad(alphas), Cm_tab1)
    plt.plot(ut.deg_of_rad(alphas), Cm_tab2)
    plt.plot(ut.deg_of_rad(alphas), Cm_tab3)
    plt.plot(ut.deg_of_rad(alphas), Cm_tab4)
    label1 = patches.Patch(color='blue', label='ms = -0.1')
    label2 = patches.Patch(color='green', label='ms = 0')
    label3 = patches.Patch(color='red', label='ms = 0.2')
    label4 = patches.Patch(color='cyan', label='ms = 1')
    plt.legend(loc='upper right', handles=[label1, label2, label3, label4])
    ut.decorate(plt.gca(),
                title="Evolution du Cm en fonction de l'incidence",
                xlab='Incidence',
                ylab='Cm')
    plt.show()
def plot_all_trims(aircraft, hs, Mas, sms, kms, trims, filename=None):
    '''
    Affichage graphique des valeurs de trim
    '''
    margins = (0.03, 0.05, 0.98, 0.95, 0.15, 0.46)
    fig = ut.prepare_fig(window_title='Trims {}'.format(aircraft.name), figsize=(20.48, 10.24), margins=margins)
    
    m=0
    for k, sm in enumerate(sms):
        for l,km in enumerate(kms):
            for i, h in enumerate(hs):
                for j, Ma in enumerate(Mas):
                    alpha, dphr, dth = trims[i, j, k, l]
                    fmt = 'alt {:5.0f} Ma {:.1f} sm {:.1f} km {:.1f} -> alpha {:5.2f} deg phr {:-5.1f} deg throttle {:.1f} %'
                    print fmt.format(h, Ma, sm, km, ut.deg_of_rad(alpha), ut.deg_of_rad(dphr), 100*dth)
            legend, params = ['Mach {}'.format(Ma) for Ma in Mas], r'\quad sm={} \quad km={}'.format(sm, km)
            ax = plt.subplot(4, 3, 3*m+1)
            plt.plot(hs, ut.deg_of_rad(trims[:, 0, k, l, 0]))
            plt.plot(hs, ut.deg_of_rad(trims[:, 1, k, l, 0]))
            ut.decorate(ax, r'$\alpha {}$'.format(params), r'altitude', '$deg$', legend=legend)
            ax = plt.subplot(4, 3, 3*m+2)
            plt.plot(hs, ut.deg_of_rad(trims[:, 0, k, l, 1]))
            plt.plot(hs, ut.deg_of_rad(trims[:, 1, k, l, 1]))
            ut.decorate(ax, r'$\delta_{{PHR}} {}$'.format(params), r'altitude', '$deg$', legend=legend)
            ax = plt.subplot(4, 3, 3*m+3)
            plt.plot(hs, trims[:, 0, k, l, 2]*100)
            plt.plot(hs, trims[:, 1, k, l, 2]*100)
            ut.decorate(ax, r'$\delta_{{th}} {}$'.format(params), r'altitude', '$\%$', legend=legend)
            m = m+1
    if filename<> None: plt.savefig(filename, dpi=160)
Exemplo n.º 14
0
def affiche():
    for i in range(len(ms)):
        for j in range(len(km)):
            for k in range(len(Ma)):
                plt.suptitle('ms=' + str(ms[i]) + ', km=' + str((km[j])))
                plt.subplot(1, 4, 1)
                plt.title("alpha")
                plt.plot(h1,
                         utils.deg_of_rad(alphatrim[i, j, k, :]),
                         label="Mach = " + str(Ma[k]) + "")
                plt.ylabel('alpha en degre')
                plt.xlabel('altitude en m')
                plt.legend()
                plt.subplot(1, 4, 2)
                plt.title("dphr")
                plt.plot(h1,
                         utils.deg_of_rad(dphrtrim[i, j, k, :]),
                         label="Mach = " + str(Ma[k]) + "")
                plt.ylabel('dphr en degre')
                plt.xlabel('altitude en m')
                plt.legend()
                plt.subplot(1, 4, 3)
                plt.title("dth")
                plt.plot(h1,
                         dthtrim[i, j, k, :],
                         label="Mach = " + str(Ma[k]) + "")
                plt.ylabel('dth')
                plt.xlabel('altitude en m')
                plt.legend()
            for l in range(len(h)):
                plt.subplot(1, 4, 4)
                plt.title("poussee")
                plt.plot(Ma1,
                         prop[i, j, :, l],
                         label="altitude = " + str(h[l]) + "")
                plt.ylabel('poussee en N')
                plt.xlabel('Mach')
                plt.legend()
            plt.show()
Exemplo n.º 15
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()
Exemplo n.º 17
0
def plot_trims(aircraft, gamma=0., saturate=True):
    '''
    Affichage de trims sous forme de surfaces colorées
    '''
    vs = np.linspace(60, 350, 21, endpoint=True)
    hs = np.linspace(1000, 14000, 21, endpoint=True)
    trims = np.zeros((len(hs), len(vs), 2))
    for i,v in enumerate(vs):
        for j,h in enumerate(hs):
            Xe, Ue = dyn.trim(aircraft, args = {'va': v, 'h': h, 'gamma': gamma})
            trims[j, i] = Xe[dyn.s_a], tons_of_newton(dyn.propulsion_model([0, h, v, 0, 0, 0], [0, Ue[dyn.i_dth], 0, 0], aircraft))
            
            if saturate:
                alpha_c, T_c = trims[j,i][0], trims[j,i,1]
                alpha_max = ut.rad_of_deg(15)
                if alpha_c > alpha_max: 
                    trims[j,i][0] = 1e16
                    trims[j,i][1] = 1e16
                Tmax = tons_of_newton(dyn.propulsion_model([0, h, v, 0, 0, 0], [0, 1, 0, 0], aircraft))
                if T_c > Tmax: 
                    trims[j,i, 0] = 1e16
                    trims[j,i, 1] = 1e16

    fig = plt.figure(figsize=(0.75*20.48, 0.5*10.24))

    ax = plt.subplot(1,2,1)
    thetas_deg = ut.deg_of_rad(trims[:, :, 0])
    v = np.linspace(0, 15, 16, endpoint=True)
    plt.contour(vs, hs, thetas_deg, v, linewidths=0.5, colors='k')
    plt.contourf(vs, hs, thetas_deg, v, cmap=plt.cm.jet)
    ax.set_title(u'$\\alpha$ (degrés)')
    ax.xaxis.set_label_text('vitesse (m/s)')
    ax.yaxis.set_label_text('altitude (m)')
    plt.colorbar(ticks=v)

    ax = plt.subplot(1,2,2)
    T_tons = trims[:, :, 1] #/9.81/1000.
    v = np.linspace(2, 10, 17, endpoint=True)
    plt.contour(vs, hs, T_tons, v, linewidths=0.5, colors='k')
    plt.contourf(vs, hs, T_tons, v, cmap=plt.cm.jet)
    ax.set_title('thrust (tons)')   
    ax.xaxis.set_label_text('vitesse (m/s)')
    ax.yaxis.set_label_text('altitude (m)')
    plt.colorbar(ticks=v)
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
Exemplo n.º 19
0
        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é


interv_alpha = [-10 * math.pi / 180,
                20 * math.pi / 180]  #intervalle d'incidence alpha en rad
dphr = [-30 * math.pi / 180, +20 * math.pi / 180]  #valeurs de dphr en rad

cl = plt.figure()
for i in dphr:
    alpha, CL = get_CL_alpha(va, q, i, avion, interv_alpha, nb_points)
    plt.plot(alpha,
             CL,
             label="dphr=" + str(utils.deg_of_rad(i)) + " degre",
             figure=cl)
    plt.xlabel("Angle d'incidence alpha en degre")
    plt.ylabel("Coefficient de portance CL")
    plt.title("CL en fonction \n d'alpha ")
    plt.legend()
plt.show()
'''''' ''


def get_Cm_alpha(
    va, q, dphr, P, alpha, nb, ms
):  # calcule Cm en fonction de l'angle d'incidence alpha, (vitesse m/s, vitesse de tangage rad/sec, angle de braquage de l'empennage horizontal en rad, intervalle d'incidnce alpha  rad, nombre de points)
    angle_alpha = np.linspace(alpha[0], alpha[1], nb)
    Cm = np.array([
        P.Cm0 - ms * P.CLa * (k - P.a0) + P.Cmq * P.lt / va * q + P.Cmd * dphr
Exemplo n.º 20
0
    ut.decorate(plt.gca(), u'Coefficient de portance équilibrée', r'$\alpha$ en degres', r'$CL_e$',
                ['$ms =  ${: .1f}'.format(sm) for sm in sms])

def plot_polar(P):
    alphas = np.linspace(ut.rad_of_deg(-10), ut.rad_of_deg(20), 30)
    figure = ut.prepare_fig(None, u'Polaire équilibrée{}'.format(P.name))
    sms = [0.2, 1]
    for sm in sms:
        P.set_mass_and_static_margin(0.5, sm)
        dphres = [dphr_e(P, alpha) for alpha in alphas]
        CLes = [CL(P, alpha, dphr) for alpha, dphr in zip(alphas, dphres)]
        CDes = [P.CD0 + P.ki * CL1**2 for CL1 in CLes]
        plt.plot(CDes, CLes)
    ut.decorate(plt.gca(), u'Polaire équilibrée', r'$CD_e$', r'$CL_e$',
                ['$ms =  ${: .1f}'.format(sm) for sm in sms])



aircraft = dyn.Param_737_300() # use assigned aircraft
# plot_thrust(aircraft)
# plot_CL(aircraft)
# plot_Cm(aircraft)
#plot_dphr_e(aircraft)
#plot_CLe(aircraft)
#plot_polar(aircraft)
#plt.show()

print(dphr_e(aircraft, 0))
print(CL(aircraft,0.06, dphr_e(aircraft,0)))
print(ut.deg_of_rad(0.06))
Exemplo n.º 21
0
    valeur_trim = alphatrim[0, 0, 0, 0], dphrtrim[0, 0, 0, 0], dthtrim[0, 0, 0,
                                                                       0]
    point_trim = [3000.0, 0.4, -0.2, 0.1]

    h_trim, Ma_trim, ms_trim, km_trim = point_trim
    p_trim, rho_trim, T_trim = utils.isa(h_trim)
    avion.set_mass_and_static_margin(km_trim, ms_trim)
    va_trim = dynamic.va_of_mach(Ma_trim, h_trim, k=1.4, Rs=287.05)

    Cl = 2 * avion.m * avion.g / (rho_trim * avion.S * va_trim**2)
    interv_alpha = [-10 * math.pi / 180, 20 * math.pi / 180]

    alpha, CLE = CLE_alpha(va_trim, 0, avion, interv_alpha, 100, ms_trim)
    alphatrim_0 = valeur_trim[0]
    alphatrim_0 = float(int(utils.deg_of_rad(alphatrim_0 * 1000 + 0.5)) / 1000)
    Cl = float(int(Cl * 1000 + 0.5)) / 1000

    alpha, dphr = dpha_alpha(va_trim, 0, avion, interv_alpha, 100, ms_trim)
    dphrtrim_1 = valeur_trim[1]
    dphrtrim_1 = float(int(utils.deg_of_rad(dphrtrim_1 * 1000 + 0.5))) / 1000

    # CLE function of alpha

    plt = plot(
        alpha, CLE, "CLE en fonction \n d'alphae", "ms = " + str(ms_trim) +
        ", km = " + str(km_trim) + ", Ma = " + str(Ma_trim), "Alphae (deg)",
        "CLE", (alpha[0], alpha[nb - 1]), (CLE[0], CLE[nb - 1]))

    row_cl = [Cl] * nb
    idx = np.argwhere(np.diff(np.sign(CLE - row_cl)) != 0).reshape(-1)
def evol_trym(P):
    for couple in couples:
        P.set_mass_and_static_margin(couple[1], couple[0])
        alpha1, alpha2, dphr1, dphr2, dth1, dth2 = [], [], [], [], [], []
        for h in hs:
            arg1 = {
                'va': dyn.va_of_mach(machs[0], h, k=1.4, Rs=287.05),
                'h': h
            }
            alpha1.append(ut.deg_of_rad(dyn.trim(P, arg1)[0][3]))
            dphr1.append(ut.deg_of_rad(dyn.trim(P, arg1)[1][0]))
            dth1.append(dyn.trim(P, arg1)[1][1] * 100)
            arg2 = {
                'va': dyn.va_of_mach(machs[1], h, k=1.4, Rs=287.05),
                'h': h
            }
            alpha2.append(ut.deg_of_rad(dyn.trim(P, arg2)[0][3]))
            dphr2.append(ut.deg_of_rad(dyn.trim(P, arg2)[1][0]))
            dth2.append(dyn.trim(P, arg2)[1][1] * 100)
        alphatab1.append(alpha1)
        alphatab2.append(alpha2)
        dthtab1.append(dth1)
        dthtab2.append(dth2)
        dphrtab1.append(dphr1)
        dphrtab2.append(dphr2)
    al1 = np.array(alphatab1)
    al2 = np.array(alphatab2)
    f, axarr = plt.subplots(4, 3)
    axarr[0, 0].plot(x, al1[0], 'b')
    axarr[0, 0].set_title('Alpha')
    axarr[1, 0].plot(x, al1[1], 'b')
    axarr[2, 0].plot(x, al1[2], 'b')
    axarr[3, 0].plot(x, al1[3], 'b')
    axarr[0, 0].plot(x, al2[0], 'r')
    axarr[1, 0].plot(x, al2[1], 'r')
    axarr[2, 0].plot(x, al2[2], 'r')
    axarr[3, 0].plot(x, al2[3], 'r')
    dp1 = np.array(dphrtab1)
    dp2 = np.array(dphrtab2)
    axarr[0, 1].plot(x, dp1[0], 'b')
    axarr[0, 1].set_title('Dphr')
    axarr[1, 1].plot(x, dp1[1], 'b')
    axarr[2, 1].plot(x, dp1[2], 'b')
    axarr[3, 1].plot(x, dp1[3], 'b')
    axarr[0, 1].plot(x, dp2[0], 'r')
    axarr[1, 1].plot(x, dp2[1], 'r')
    axarr[2, 1].plot(x, dp2[2], 'r')
    axarr[3, 1].plot(x, dp2[3], 'r')
    dt1 = np.array(dthtab1)
    dt2 = np.array(dthtab2)
    axarr[0, 2].plot(x, dt1[0], 'b')
    axarr[0, 2].set_title('Dth')
    axarr[1, 2].plot(x, dt1[1], 'b')
    axarr[2, 2].plot(x, dt1[2], 'b')
    axarr[3, 2].plot(x, dt1[3], 'b')
    axarr[0, 2].plot(x, dt2[0], 'r')
    axarr[1, 2].plot(x, dt2[1], 'r')
    axarr[2, 2].plot(x, dt2[2], 'r')
    axarr[3, 2].plot(x, dt2[3], 'r')
    f.suptitle(
        "Valeur de Alpha, Dphr et Dth pour un vol en palier en fonction de l'Altitude pour les couples \n [ms, km] suivants : [0.2, 0.1], [0.2, 0.9], [1., 0.1], [1., 0.9].      En bleu pour Mach = 0.5 et en rouge pour Mach = 0.8"
    )
    plt.show()