Example #1
0
def Tracé_en_allure():
    PHI = np.deg2rad(0)
    Vt = fctAnnexes.nds2ms(15)
    Vs = fctAnnexes.nds2ms(5)
    LAMBDA = np.deg2rad(0)
    L_angle_allure_deg = np.linspace(10, 170)
    L_angle_allure = np.deg2rad(L_angle_allure_deg)
    L_Fxtot = []
    L_Fxaero = []
    L_Fxsafran = []
    L_Fxquille = []
    L_Fxstab = []
    L_Fxresistance = []
    for angle in L_angle_allure:
        T_aero = aero.torseur_Faero(Vt, Vs, angle, LAMBDA, PHI, rho_eau,
                                    rho_air, workbookAero)
        Fx_aero = T_aero[0][0]
        L_Fxaero.append(Fx_aero)

    # plt.plot(L_angle_allure_deg, L_Fxtot, label = "Fx_total")
    plt.plot(L_angle_allure_deg, L_Fxaero, label="Fx_aero")
    # plt.plot(L_angle_allure_deg, L_Fxquille, label = "Fx_quille")
    # plt.plot(L_angle_allure_deg, L_Fxsafran, label = "Fx_safran")
    # plt.plot(L_angle_allure_deg, L_Fxstab, label = "Fx_stab")
    # plt.plot(L_angle_allure_deg, L_Fxresistance, label = "Fx_resistance")
    plt.ylabel("Fx (N)")
    plt.xlabel("TWA (deg)")
    plt.legend()
    plt.show()
Example #2
0
def Tracé_en_PHI():
    V = 0.8
    LAMBDA = np.deg2rad(3)
    Vt = fctAnnexes.nds2ms(5)
    angle_allure = 120
    L_phi_deg = np.linspace(-50, 50, 50)
    L_phi = np.deg2rad(L_phi_deg)
    L_Mxtot = []
    L_Mxaero = []
    L_Mxsafran = []
    L_Mxquille = []
    L_Mxstab = []
    L_Mxresistance = []
    for PHI in L_phi:
        print(PHI)
        T_aero = aero.torseur_Faero(Vt, V, angle_allure, LAMBDA, PHI, rho_eau,
                                    rho_air, workbookAero)
        T_safran = safran.torseur_Fhydro_safran(V, LAMBDA, PHI, rho_eau,
                                                workbookSafran)
        T_stab = stab.torseur_Fstab(DELTA, LAMBDA, PHI, theta, workbookStab)
        T_quille = quille.torseur_Fhydro_quille(V, LAMBDA, PHI, rho_eau,
                                                workbookQuille)
        T_resistance = resistance.torseur_Fresistance(V, LAMBDA, workbookDVP)
        Mx_aero = T_aero[0][1]
        Mx_safran = T_safran[0][1]
        Mx_quille = T_quille[0][1]
        Mx_resistance = T_resistance[0][1]
        Mx_stab = T_stab[0][1]
        SommeMx = Mx_aero + Mx_quille + Mx_resistance + Mx_safran + Mx_stab
        L_Mxtot.append(SommeMx)
        L_Mxaero.append(Mx_aero)
        L_Mxsafran.append(Mx_safran)
        L_Mxquille.append(Mx_quille)
        L_Mxstab.append(Mx_stab)
        L_Mxresistance.append(Mx_resistance)

    plt.plot(L_phi_deg, L_Mxtot, label="Mx_total")
    plt.plot(L_phi_deg, L_Mxaero, label="Mx_aero")
    plt.plot(L_phi_deg, L_Mxquille, label="Mx_quille")
    plt.plot(L_phi_deg, L_Mxsafran, label="Mx_safran")
    plt.plot(L_phi_deg, L_Mxstab, label="Mx_stab")
    plt.plot(L_phi_deg, L_Mxresistance, label="Mx_resistance")
    plt.ylabel("Mx (N.m)")
    plt.xlabel("Phi (deg)")
    plt.legend()
    plt.show()
Example #3
0
def Tracé_en_Vs():
    PHI = np.deg2rad(1)
    Vt = fctAnnexes.nds2ms(20)
    angle_allure = np.deg2rad(120)
    LAMBDA = np.deg2rad(1)
    L_Vs_nds = np.linspace(0,10,50)
    L_Vs = [fctAnnexes.nds2ms(x) for x in L_Vs_nds]
    L_Fxtot = []
    L_Fxaero = []
    L_Fxsafran = []
    L_Fxquille = []
    L_Fxstab = []
    L_Fxresistance = []
    for V in L_Vs:
        print(V)
        T_aero = aero.torseur_Faero(Vt, V, angle_allure, LAMBDA, PHI, rho_eau, rho_air)
        T_safran = safran.torseur_Fhydro_safran(V, LAMBDA, PHI, rho_eau)
        T_stab = stab.torseur_Fstab(DELTA, LAMBDA, PHI, theta)
        T_quille = quille.torseur_Fhydro_quille(V, LAMBDA, PHI, rho_eau)
        T_resistance = resistance.torseur_Fresistance(V, LAMBDA)
        Fx_aero = T_aero[0][0]
        Fx_safran = T_safran[0][0]
        Fx_quille = T_quille[0][0]
        Fx_resistance = T_resistance[0][0]
        Fx_stab = T_stab[0][0]
        SommeFx = Fx_aero + Fx_quille + Fx_resistance + Fx_safran + Fx_stab
        L_Fxtot.append(SommeFx)
        L_Fxaero.append(Fx_aero)
        L_Fxsafran.append(Fx_safran)
        L_Fxquille.append(Fx_quille)
        L_Fxstab.append(Fx_stab)
        L_Fxresistance.append(Fx_resistance)

    plt.plot(L_Vs_nds, L_Fxtot, label = "Fx_total")
    plt.plot(L_Vs_nds, L_Fxaero, label = "Fx_aero")
    plt.plot(L_Vs_nds, L_Fxquille, label = "Fx_quille")
    plt.plot(L_Vs_nds, L_Fxsafran, label = "Fx_safran")
    plt.plot(L_Vs_nds, L_Fxstab, label = "Fx_stab")
    plt.plot(L_Vs_nds, L_Fxresistance, label = "Fx_resistance")
    plt.ylabel("Fx (N)")
    plt.xlabel("Vs (kt)")
    plt.legend()
    plt.show()
Example #4
0
def Tracé_en_Lambda():
    V = 0.8
    PHI = -6E-3
    Vt = fctAnnexes.nds2ms(5)
    angle_allure = 120
    L_lambda_deg = np.linspace(-10,10,100)
    L_lambda = np.deg2rad(L_lambda_deg)
    L_Fytot = []
    L_Fyaero = []
    L_Fysafran = []
    L_Fyquille = []
    L_Fystab = []
    L_Fyresistance = []
    for LAMBDA in L_lambda:
        T_aero = aero.torseur_Faero(Vt, V, angle_allure, LAMBDA, PHI, rho_eau, rho_air, workbookAero)
        T_safran = safran.torseur_Fhydro_safran(V, LAMBDA, PHI, rho_eau, workbookSafran)
        T_stab = stab.torseur_Fstab(DELTA, LAMBDA, PHI, theta, workbookStab)
        T_quille = quille.torseur_Fhydro_quille(V, LAMBDA, PHI, rho_eau, workbookQuille)
        T_resistance = resistance.torseur_Fresistance(V, LAMBDA, workbookDVP)
        Fy_aero = T_aero[1][0]
        Fy_safran = T_safran[1][0]
        Fy_quille = T_quille[1][0]
        Fy_resistance = T_resistance[1][0]
        Fy_stab = T_stab[1][0]
        SommeFy = Fy_aero + Fy_quille + Fy_resistance + Fy_safran + Fy_stab
        L_Fytot.append(SommeFy)
        L_Fyaero.append(Fy_aero)
        L_Fysafran.append(Fy_safran)
        L_Fyquille.append(Fy_quille)
        L_Fystab.append(Fy_stab)
        L_Fyresistance.append(Fy_resistance)

    plt.plot(L_lambda_deg, L_Fytot, label = "Fy_total")
    plt.plot(L_lambda_deg, L_Fyaero, label = "Fy_aero")
    plt.plot(L_lambda_deg, L_Fyquille, label = "Fy_quille")
    plt.plot(L_lambda_deg, L_Fysafran, label = "Fy_safran")
    plt.plot(L_lambda_deg, L_Fystab, label = "Fy_stab")
    plt.plot(L_lambda_deg, L_Fyresistance, label = "Fy_resistance")
    plt.ylabel("Fy (N.m)")
    plt.xlabel("Lambda (deg)")
    plt.legend()
    plt.show()
Example #5
0
def Tracé_en_Lambda():
    V = fctAnnexes.nds2ms(3.94)
    PHI = np.deg2rad(-1.77)
    Vt = fctAnnexes.nds2ms(20)
    angle_allure = np.deg2rad(120)
    L_lambda_deg = np.linspace(-10,10,100)
    L_lambda = np.deg2rad(L_lambda_deg)
    L_Fxtot = []
    L_Fxaero = []
    L_Fxsafran = []
    L_Fxquille = []
    L_Fxstab = []
    L_Fxresistance = []
    for LAMBDA in L_lambda:
        T_aero = aero.torseur_Faero(Vt, V, angle_allure, LAMBDA, PHI, rho_eau, rho_air, workbookAero)
        T_safran = safran.torseur_Fhydro_safran(V, LAMBDA, PHI, rho_eau, workbookSafran)
        T_stab = stab.torseur_Fstab(DELTA, LAMBDA, PHI, theta, workbookStab)
        T_quille = quille.torseur_Fhydro_quille(V, LAMBDA, PHI, rho_eau, workbookQuille)
        T_resistance = resistance.torseur_Fresistance(V, LAMBDA, workbookDVP)
        Fx_aero = T_aero[0][0]
        Fx_safran = T_safran[0][0]
        Fx_quille = T_quille[0][0]
        Fx_resistance = T_resistance[0][0]
        Fx_stab = T_stab[0][0]
        SommeFx = Fx_aero + Fx_quille + Fx_resistance + Fx_safran + Fx_stab
        L_Fxtot.append(SommeFx)
        L_Fxaero.append(Fx_aero)
        L_Fxsafran.append(Fx_safran)
        L_Fxquille.append(Fx_quille)
        L_Fxstab.append(Fx_stab)
        L_Fxresistance.append(Fx_resistance)

    plt.plot(L_lambda_deg, L_Fxtot, label = "Fx_total")
    plt.plot(L_lambda_deg, L_Fxaero, label = "Fx_aero")
    plt.plot(L_lambda_deg, L_Fxquille, label = "Fx_quille")
    plt.plot(L_lambda_deg, L_Fxsafran, label = "Fx_safran")
    plt.plot(L_lambda_deg, L_Fxstab, label = "Fx_stab")
    plt.plot(L_lambda_deg, L_Fxresistance, label = "Fx_resistance")
    plt.ylabel("Fx (N)")
    plt.xlabel("Lambda (deg)")
    plt.legend()
    plt.show()
Example #6
0
def PFS(X, Vt, angle_allure):
    V = float(X[0])
    PHI = float(X[1])
    LAMBDA = float(X[2])
    # print("VALEURS EN DEBUT DE BOUCLE")
    if V > fctAnnexes.nds2ms(
            10
    ):  #Polaires de safran et de quille ne sont plus prises en compte
        V = fctAnnexes.nds2ms(10)
        warnings.warn("Speed was above 10 kts and was reset to 10 kts.")
    if PHI > np.deg2rad(90):  #On empeche une gite trop importante
        PHI = np.deg2rad(60)
        warnings.warn(
            "Heeling angle was above 90 degrees and was reset to 60 degrees")
    if PHI < np.deg2rad(-90):  #On empeche une contre gite trop importante
        PHI = np.deg2rad(-60)
        warnings.warn(
            "Heeling angle was below -90 degrees and was reset to -60 degrees")

    # print("V=", ms2nds(V), "noeuds", "              PHI=", np.rad2deg(PHI), "degrés", "              LAMBDA=",
    # np.rad2deg(LAMBDA), "degrés")

    T_aero = aero.torseur_Faero(Vt, V, angle_allure, LAMBDA, PHI, rho_eau,
                                rho_air, workbookAero)
    T_safran = safran.torseur_Fhydro_safran(V, LAMBDA, PHI, rho_eau,
                                            workbookSafran)
    T_stab = stab.torseur_Fstab(DELTA, LAMBDA, PHI, theta, workbookStab)
    T_quille = quille.torseur_Fhydro_quille(V, LAMBDA, PHI, rho_eau,
                                            workbookQuille)
    T_resistance = resistance.torseur_Fresistance(V, LAMBDA, workbookDVP)
    # print("T_aero","\n",T_aero,"___________","\n","T_safran","\n",T_safran,"___________","\n","T_stab","\n",T_stab,
    # "___________","\n","T_quille","\n",T_quille,"___________","\n","T_resistance","\n",T_resistance)

    SommeTorseurs = np.array([0., 0., 0.]).reshape((-1, ))
    Fx_aero = T_aero[0][0]
    Fx_safran = T_safran[0][0]
    Fx_quille = T_quille[0][0]
    Fx_resistance = T_resistance[0][0]
    Fx_stab = T_stab[0][0]
    SommeTorseurs[
        0] = Fx_stab + Fx_safran + Fx_quille + Fx_resistance + Fx_aero

    Fy_aero = T_aero[1][0]
    Fy_safran = T_safran[1][0]
    Fy_quille = T_quille[1][0]
    Fy_resistance = T_resistance[1][0]
    Fy_stab = T_stab[1][0]
    SommeTorseurs[
        2] = Fy_stab + Fy_aero + Fy_resistance + Fy_safran + Fy_quille

    Mx_aero = T_aero[0][1]
    Mx_safran = T_safran[0][1]
    Mx_quille = T_quille[0][1]
    Mx_resistance = T_resistance[0][1]
    Mx_stab = T_stab[0][1]
    SommeTorseurs[
        1] = Mx_aero + Mx_quille + Mx_resistance + Mx_safran + Mx_stab

    # print("PFS=", SommeTorseurs)
    if V > fctAnnexes.nds2ms(
            10
    ):  #Polaires de safran et de quille ne sont plus prises en compte
        V = fctAnnexes.nds2ms(10)

    LISTEV.append(V)
    LISTEPHI.append(PHI)
    LISTELAMBDA.append(LAMBDA)
    LISTE_Fx.append(SommeTorseurs[0])
    LISTE_Fy.append(SommeTorseurs[2])
    LISTE_Mx.append(SommeTorseurs[1])
    return 10 * SommeTorseurs