Пример #1
0
        private void CalculateW_PL()
        {
            S_land = Double.Parse(txt_Slanding.Text);

            W_S_TO_L_list = new Double[4];

            Clmax_L = Double.Parse(txt_Clmax_L.Text);

            AltitudeCalculator.CalcAtmos(txt_H_landing.Text, cmb_H_landing);

            Wl_Wto = Double.Parse(txt_Wl_Wto.Text);

            if (cmb_Top.Text == "Top23")
            {
                V_sl = Math.Round(Math.Sqrt(S_land / 0.265) * 1.688, 1);
            }
            else
            {
                Double Va = Math.Sqrt(S_land / 0.3);
                V_sl = Va * 1.688 / 1.3;
            }

            for (int i = 0; i < 4; i++)
            {
                W_S_TO_L_list[i] = Math.Round(Math.Pow(V_sl, 2) * Clmax_L * AltitudeCalculator.rho_h * 0.0019412449 * 0.5 / Wl_Wto, 1);
                Clmax_L          = Clmax_L + 0.3;
            }



            listBox1.DataSource = W_S_TO_L_list;

            label5.Text = V_sl.ToString();
        }
Пример #2
0
        private void VmaxEst()
        {
            Vmax1_set = new List <double>();
            AltitudeCalculator.CalcAtmos(txt_Height_cr.Text, cmbHeight_cr);
            CalculateK();
            int i = 0;

            while (i < W_surf.Length)
            {
                Double abc = Vmax_Prop.Perf_Vmax_Prop(W_surf[i], K, CDmin, Wto_guess, 0.75 * MinPow, PropEffi);
                Vmax1_set.Add(Math.Round(abc / 1.688, 0));

                i += 1;
            }
            Max_V = new Double[8, 8];
            for (int j = 0; j < Vmax1_set.Count(); j += 1)
            {
                for (int k = 0; k < Vmax1_set.Count(); k += 1)
                {
                    Max_V[k, j] = Vmax1_set[k];
                }
            }

            for (int m = 0; m < Max_V.GetLength(0); m++)
            {
                string[] row = new string[Max_V.GetLength(1)];

                for (int j = 0; j < Max_V.GetLength(1); j++)
                {
                    row[j] = Max_V[j, m].ToString();
                }

                dataGridView2.Rows.Add(row);
            }
        }
Пример #3
0
        private void CalculateCR_T_W()
        {
            AltitudeCalculator.CalcAtmos(txt_Hcr.Text, cmb_Hcr);

            T_W_TO_Cr_list = new Double[5];

            a_h = AltitudeCalculator.a_h;

            Vcr = Double.Parse(txt_Vcr.Text) * a_h / 0.3048;

            q_cr = Math.Round(Math.Pow(Vcr, 2) * 0.5 * AltitudeCalculator.rho_h * 0.0019412449, 1);

            CalculateCd0();

            Double ab = Math.Round((C_d0 + 0.0005) * q_cr, 2);

            Double cd;

            e_clean = Double.Parse(txt_eClean.Text);

            if (Vcr != 0)
            {
                cd = Math.Round(Math.PI * AR * e_clean * q_cr, 0);
            }
            else
            {
                cd = 1;
            }

            for (int i = 0; i < W_S_list.Length; i++)
            {
                T_W_TO_Cr_list[i] = Math.Round(((ab / W_S_list[i]) + (W_S_list[i] / cd)) / 0.23, 2);
            }
        }
Пример #4
0
        private void ThrustToWeightCeiling()
        {
            try
            {
                Pbhp_ceiling_set = new List <double>();
                Double ROc_cl = 100 / 60;
                AltitudeCalculator.CalcAtmos(txt_Height_cl.Text, cmbHeight_cl);
                CalculateK();
                Double rho = Math.Round(AltitudeCalculator.rho_h * 0.00194122449, 6);
                Double i   = 5;
                while (i <= 60)
                {
                    Double Vy = Math.Sqrt((2 / rho) * i * Math.Sqrt(K / (3 * CDmin)));
                    T_W_ceiling = Math.Round((ROc_cl / Vy) + 4 * Math.Sqrt(K * CDmin / 3), 5);
                    Double P_cr = Double.Parse(txt_Wto_est.Text) * Vy * T_W_ceiling / (550 * Double.Parse(txt_PropEff.Text));
                    Pbhp_ceiling = Math.Round(P_cr / (1.132 * rho / rho_sl - 0.132), 1);
                    if (Double.IsInfinity(Pbhp_ceiling))
                    {
                        Pbhp_ceiling = 0;
                    }
                    Pbhp_ceiling_set.Add(Pbhp_ceiling);

                    i = i + 5;
                }
                LoadGraph();
            }
            catch
            {
                return;
            }
        }
Пример #5
0
        private void CalculateLD_T_W()
        {
            T_W_TO_L_list = new Double[5];

            Clmax_L = Double.Parse(txt_Clmax_L.Text);

            S_land = Double.Parse(txt_Slanding.Text);

            V_sl = Math.Round(Math.Sqrt(S_land / (0.3 * 1.69)), 1);

            AltitudeCalculator.CalcAtmos(txt_H_landing.Text, cmb_H_landing);

            Wl_Wto = Double.Parse(txt_Wl_Wto.Text);

            rhoh = AltitudeCalculator.rho_h;

            GetTempRatio();

            Double abc = Math.Round(Math.Pow(V_sl * 1.688, 2) * 0.5 * rhoh * 0.0019412449 / Temp_Ratio, 1);

            for (int i = 0; i < 4; i++)
            {
                T_W_TO_L_list[i] = Math.Round(abc * Clmax_L / Wl_Wto, 1);
                Clmax_L          = Clmax_L + 0.4;
            }

            listBox1.DataSource = T_W_TO_L_list;
            label1.Text         = abc.ToString();

            LoadCarpetPlot();
        }
Пример #6
0
 private void txt_ROC_TextChanged(object sender, EventArgs e)
 {
     try
     {
         AltitudeCalculator.CalcAtmos(txt_Height_cr.Text, cmbHeight_cr);
         ThrustToWeightClimb();
     }
     catch
     {
         return;
     }
 }
Пример #7
0
        private void CalculateW_P_TO()
        {
            //dataGridView1.Rows.Clear();
            W_P_TO = new double[5, 5];

            List <Double> xlist = new List <double>();

            Sto = Double.Parse(txt_Sto.Text);
            Hto = Double.Parse(txt_H_to.Text);
            AltitudeCalculator.CalcAtmos(txt_H_to.Text, cmb_Hto);

            Double rhorel = AltitudeCalculator.rho_h * 0.0019412449 / rho0;


            Double a1 = 0.009;
            Double b1 = 4.9;
            Double c1 = -Sto;

            Double inner = Math.Sqrt(Math.Pow(b1, 2) - 4 * a1 * c1);
            Double x1    = Math.Round((-b1 - inner) / (2 * a1), 1);
            Double Top23 = Math.Round((-b1 + inner) / (2 * a1), 1);

            Double ans = Top23 * AltitudeCalculator.rel_rho_h;

            label1.Text = "Top23 is " + ans.ToString();

            for (int i = 0; i < W_S_list.Length; i++)
            {
                for (int j = 0; j < ClmaxTO_list.Length; j++)
                {
                    WpTO         = Top23 * rhorel * ClmaxTO_list[j] / W_S_list[i];
                    W_P_TO[i, j] = Math.Round(WpTO, 1);
                }
            }

            label1.Text = Top23.ToString();

            for (int i = 0; i < W_P_TO.GetLength(0); i++)
            {
                string[] row = new string[W_P_TO.GetLength(1)];

                for (int j = 0; j < W_P_TO.GetLength(1); j++)
                {
                    row[j] = W_P_TO[j, i].ToString();
                }

                //dataGridView1.Rows.Add(row);
            }

            LoadCarpetPlot();
        }
Пример #8
0
        private void CalculateLopt()
        {
            GetParameters();

            L_opt = Math.Round(K_c * Math.Sqrt((4 * MAC_w * S_w * V_h) / (Math.PI * Df_max)), 3);

            S_h = Math.Round(MAC_w * S_w * V_h / L_opt, 3);

            AltitudeCalculator.CalcAtmos(txt_Hcr.Text, cmb_Hcr);

            Cl = Math.Round(2 * W_to * 9.81 / (AltitudeCalculator.rho_h * Math.Pow(V_c, 2) * S_w), 3);

            Cm_0_wf = Math.Round((Cm_0 * (AR * Math.Pow(Math.Cos(sw_angle_w / 57.3), 2)) / (AR + 2 * Math.Cos(sw_angle_w / 57.3))) + 0.01 * alpha_twist, 3);

            L_f = Math.Round(L_opt / l_L, 3);

            X_cg = Math.Round(X_ac_wf * MAC_w - cg_ac_distance, 3);

            X_cg_w = Math.Round(X_cg / MAC_w, 3);

            Cl_h = Math.Round((Cm_0_wf + Cl * (X_cg - X_ac_wf)) / V_h, 3);

            Cl_ah_3D = Math.Round(Cl_ah_2D / (1 + (Cl_ah_2D / (3.14 * AR_h))), 2);

            //a_h = Math.Round((Cl_h / Cl_ah_3D)*57.3,2);

            AR_h = Math.Round(2 * AR / 3, 1);

            txt_Lopt.Text  = L_opt.ToString();
            txt_Sh.Text    = S_h.ToString();
            txt_Cl.Text    = Cl.ToString();
            txt_Cm0wf.Text = Cm_0_wf.ToString();
            txt_Lf.Text    = L_f.ToString();

            txt_Xcg.Text    = X_cg.ToString();
            txt_X_cg_h.Text = X_cg_w.ToString();
            txt_Cl_h.Text   = Cl_h.ToString();
            txt_Cla3D.Text  = Cl_ah_3D.ToString();
            //txt_ah.Text = a_h.ToString();

            a_h = Double.Parse(txt_ah.Text);
        }
Пример #9
0
        private void CalculateTO_T_W()
        {
            dataGridView1.Rows.Clear();

            T_W_TO = new double[5, 5];

            GetTempRatio();

            Sto = Double.Parse(txt_H_to.Text);

            AltitudeCalculator.CalcAtmos(txt_H_to.Text, cmb_Hto);

            P_h = AltitudeCalculator.P_h;

            Pressrel = P_h / P_0;

            Double abc = Math.Round(37.5 / (Press_Ratio * Sto), 5);

            for (int i = 0; i < W_S_list.Length; i++)
            {
                for (int j = 0; j < ClmaxTO_list.Length; j++)
                {
                    TWTO         = abc * 1.17 * W_S_list[i] / ClmaxTO_list[j];
                    T_W_TO[i, j] = Math.Round(TWTO, 2);
                }
            }

            for (int i = 0; i < T_W_TO.GetLength(0); i++)
            {
                string[] row = new string[T_W_TO.GetLength(1)];

                for (int j = 0; j < T_W_TO.GetLength(1); j++)
                {
                    row[j] = T_W_TO[j, i].ToString();
                }

                dataGridView1.Rows.Add(row);
            }

            label1.Text = ClmaxTO_list[0].ToString();
        }
Пример #10
0
        private void CalculateW_P_cr()
        {
            Ip  = Double.Parse(txt_PwIndex.Text);
            Hcr = Double.Parse(txt_Hcr.Text);

            W_P_cr = new List <double>();

            AltitudeCalculator.CalcAtmos(txt_Hcr.Text, cmb_Hcr);

            Double rhorel = AltitudeCalculator.rho_h * 0.0019412449 / rho0;

            for (int i = 0; i < W_S_list.Length; i++)
            {
                W_P_cr.Add(Math.Round(W_S_list[i] * 0.7 / (Math.Pow(Ip, 3) * rhorel), 1));
            }

            //label1.Text = (Math.Pow(Ip, 3) * rhorel).ToString();
            //listBox1.DataSource = W_P_cr;

            LoadCarpetPlot();
        }
Пример #11
0
        private void CalculateW_PL()
        {
            S_land = Double.Parse(txt_Slanding.Text);

            W_S_TO_L_list = new Double[4];

            Clmax_L = Double.Parse(txt_Clmax_L.Text);

            AltitudeCalculator.CalcAtmos(txt_H_landing.Text, cmb_H_landing);

            Wl_Wto = Double.Parse(txt_Wl_Wto.Text);

            V_sl = Math.Round(Math.Sqrt(S_land / 0.265) * 1.688, 1);

            for (int i = 0; i < 4; i++)
            {
                W_S_TO_L_list[i] = Math.Round(Math.Pow(V_sl, 2) * Clmax_L * AltitudeCalculator.rho_h * 0.0019412449 * 0.5 / Wl_Wto, 1);
                Clmax_L          = Clmax_L + 0.3;
            }

            LoadCarpetPlot();
        }
Пример #12
0
        private void CalculateCL_T_W()
        {
            RC = 8.33;

            CalculateCd0();
            CalculateCR_T_W();

            AltitudeCalculator.CalcAtmos(txt_Hcr.Text, cmb_Hcr);

            Vcr_cl = Math.Round(Double.Parse(txt_Vcr.Text) * AltitudeCalculator.a_h / 0.3048, 0);

            Double Cl_cl = Math.Round(W_to / (q_cr * Sw), 2);

            Double CD_cl = Math.Round(C_d0 + Math.Pow(Cl_cl, 2) / (AR * Math.PI * 0.8), 4);

            Double LD_cl = Math.Round(Cl_cl / CD_cl, 1);

            T_W_cl = Math.Round(((RC / Vcr_cl) + (1 / LD_cl)) / 0.23, 2);

            LoadCarpetPlot();

            label1.Text = T_W_cl.ToString();
        }
Пример #13
0
        //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

        private void Calculate_RCP()
        {
            Vso_fps   = new List <double>();
            Vso_knots = new List <double>();
            RCP_list  = new List <double>();
            RC_list   = new List <double>();

            AltitudeCalculator.CalcAtmos(txt_H_to.Text, cmb_Hto);

            rhoh = AltitudeCalculator.rho_h * 0.0019412449;

            for (int i = 0; i < W_S_list.Length; i++)
            {
                Double Vso = Math.Round(Math.Sqrt(2 * W_S_list[i] / (rhoh * Clmax)), 0);
                Vso_fps.Add(Vso);
                Vso_knots.Add(Math.Round(Vso / 1.688, 0));
                FAR_2367 = Math.Round(0.027 * Math.Pow(Vso / 1.688, 2), 0);
                RC_list.Add(FAR_2367);
                RCP_list.Add(Math.Round(FAR_2367 / 33000, 4));
            }

            //listBox1.DataSource = RCP_list;
        }
Пример #14
0
        public void txt_Height_cr_TextChanged(object sender, EventArgs e)
        {
            try
            {
                AltitudeCalculator.CalcAtmos(txt_Height_cr.Text, cmbHeight_cr);
                ThrustToWeightCruise();

                ThrustToWeight();
                ThrustToWeightMin();
                txt_MinBHP.Text     = MinPow.ToString();
                txt_MinBHP_W_S.Text = W_S.ToString();

                txt_ROC_TextChanged(sender, e);
                txt_Vto_TextChanged(sender, e);
                txt_Height_cl_TextChanged(sender, e);

                //label33.Text = (rho/rho_sl).ToString();
            }
            catch
            {
                return;
            }
        }
Пример #15
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


        //                                       DYNAMIC ENTRY FUNCTIONS
        //==========================================================================================================

        private void txt_Height_cl_TextChanged(object sender, EventArgs e)
        {
            try
            {
                dataGridView1.Rows.Clear();
                dataGridView2.Rows.Clear();
                ThrustToWeightCeiling();
                ClmaxGraph();
                ClmaxGraph2();

                AltitudeCalculator.CalcAtmos(txt_Height_cr.Text, cmbHeight_cr);
                PropEfficiency.PropEff(MinPow, Vcr, Math.Round(AltitudeCalculator.rho_h * 0.00194122449, 6), 78 / 12, 0.85);
                txt_PropEfficiency.Text = PropEffi.ToString();

                VmaxEst();
                CarpetPlot();
                LoadCarpetPlot();
            }
            catch
            {
                return;
            }
        }
Пример #16
0
        private void CalculateCd0()
        {
            try
            {
                CalculateWetArea();
                Double sum = 0;
                for (int i = 0; i < W_S_list.Length; i++)
                {
                    sum = sum + W_S_list[i];
                }
                Double avg = sum / W_S_list.Length;
                C_d0 = Math.Round(f * avg / W_to, 4);

                label1.Text = "Cd0 is " + C_d0.ToString();

                AR = Double.Parse(txt_AR.Text);
                e  = Double.Parse(txt_e.Text);
                np = Double.Parse(txt_np.Text);

                Double Cd_0_TO_flaps  = Double.Parse(txt_TOflaps.Text);
                Double Cd_0_L_flaps   = Double.Parse(txt_Lflaps.Text);
                Double Cd_0_L_gears   = Double.Parse(txt_Lgears.Text);
                Double Cd_0_Stop_prop = Double.Parse(txt_Stop_prop.Text);

                Cl_climb = ClmaxTO - 0.2;

                Double CD = C_d0 + Cd_0_TO_flaps + Math.Pow(Cl_climb, 2) / (Math.PI * AR * e);

                L_D = Math.Round(Cl_climb / CD, 1);

                W_P_TO_2365_RC  = new List <double>();
                W_P_TO_2365_CGR = new List <double>();
                W_P_TO_2367     = new List <double>();
                W_P_TO_2377     = new List <double>();

                CL32_CD = Math.Round(1.345 * Math.Pow(AR * e, 0.75) / Math.Pow(C_d0 + Cd_0_TO_flaps, 0.25), 1);

                Double CL32_CD_stop = Math.Round(1.345 * Math.Pow(AR * e, 0.75) / Math.Pow(C_d0 + Cd_0_Stop_prop, 0.25), 1);

                Double CGR = 0.0833;

                Double CGR_2377 = 0.0333;

                Double Clmax_L = 2;

                Double Cl_Land = Clmax_L - 0.2;

                Double CD_Land = C_d0 + Cd_0_L_flaps + Cd_0_L_gears + Math.Pow(Cl_Land, 2) / (Math.PI * AR * e);

                Double L_D_land = Cl_Land / CD_Land;

                Double CGRP = Math.Round((CGR + 1 / L_D) / Math.Sqrt(Cl_climb), 4);

                Double CGRP_2377 = Math.Round((CGR_2377 + 1 / L_D_land) / Math.Sqrt(Cl_Land), 4);

                AltitudeCalculator.CalcAtmos(txt_H_to.Text, cmb_Hto);

                for (int i = 0; i < W_S_list.Length; i++)
                {
                    Double right = FAR_2365 + Math.Sqrt(W_S_list[i]) / (19 * CL32_CD * 1);
                    W_P_TO_2365_RC.Add(Math.Round(np / (right * 1.1), 1));

                    Double right2 = RCP_list[i] + Math.Sqrt(W_S_list[i]) / (19 * CL32_CD_stop * Math.Sqrt(AltitudeCalculator.rel_rho_h));
                    W_P_TO_2367.Add(Math.Round(np / (right2), 1));

                    Double right3 = 18.97 * np / (CGRP * Math.Sqrt(W_S_list[i]));
                    W_P_TO_2365_CGR.Add(Math.Round(right3 * 0.85, 1));

                    Double right4 = 18.97 * np / (CGRP_2377 * Math.Sqrt(W_S_list[i]));
                    W_P_TO_2377.Add(Math.Round(right4, 1));
                }
                LoadCarpetPlot();
                //listBox1.DataSource = W_P_TO_2377;
                //label1.Text = CGRP_2377.ToString();
            }
            catch
            {
                return;
            }
        }
Пример #17
0
        public void CalculateJetWeight()
        {
            if (cmb_Range.Text == "nm" || cmb_Atndist.Text == "nm")
            {
                R = Double.Parse(txt_Range.Text);
            }
            else if (cmb_Range.Text == "ft" || cmb_Atndist.Text == "ft")
            {
                R = Double.Parse(txt_Range.Text) * 0.000164579;
            }
            else if (cmb_Range.Text == "m" || cmb_Atndist.Text == "m")
            {
                R = Double.Parse(txt_Range.Text) * 0.000539957349081371537;
            }
            else if (cmb_Range.Text == "km" || cmb_Atndist.Text == "km")
            {
                R = Double.Parse(txt_Range.Text) * 0.539957349081371537;
            }
            else if (cmb_Range.Text == "miles" || cmb_Atndist.Text == "miles")
            {
                R = Double.Parse(txt_Range.Text) * 0.86897712000001081645;
            }

            Hcr = Double.Parse(txt_Hcr.Text);

            Vclimb = Double.Parse(txt_ClimbSpeed.Text);

            ROC = Double.Parse(txt_ROC.Text);

            ClimbDistance = Math.Round((Hcr / ROC) * Vclimb / 60, 1);

            AltitudeCalculator.CalcAtmos(txt_Hcr.Text, cmb_Hcr);

            Vcr = Double.Parse(txt_Vcr.Text);

            W5 = Math.Round(1 / (Math.Exp((R - ClimbDistance) * cp / (L_D * AltitudeCalculator.a_h * Vcr * 1.943844))), 3);

            L_D_ltr = Double.Parse(txt_LD_ltr.Text);
            Endr    = Double.Parse(txt_LtrTime.Text);
            cj      = Double.Parse(txt_LtrFuelEff.Text);

            W_ltr = Math.Round(1 / Math.Exp(Endr * cj / L_D_ltr), 3);

            R_atn   = Double.Parse(txt_Atndist.Text);
            L_D_atn = Double.Parse(txt_LDatn.Text);
            cj_atn  = Double.Parse(txt_LtrFuelEff_atn.Text);
            V_atn   = Double.Parse(txt_Vatn.Text);

            W_atn = Math.Round(1 / (Math.Exp(R_atn * cj_atn / (L_D_atn * V_atn))), 3);

            Mff = Math.Round(W1 * W2 * W3 * W4 * W5 * W6 * W7 * W_ltr * W_atn, 3);

            Mres = 0;

            W_f = (1 - Mff);

            C = 1 - (1 + Mres) * (1 - Mff) - Mtfo;

            C2 = Mff * (1 + Mres) - Mtfo - Mres;

            F = Math.Round(-B * Math.Pow(Wto, 2) * (1 + Mres) * Mff / (C * Wto * (1 - B) - D), 2);

            Wto_Rng = Math.Round(F * cp / (L_D * AltitudeCalculator.a_h * Vcr * 1.943844), 1);

            Wto_Endr = Math.Round(F * cp / L_D, 1);

            Wto_V = Math.Round(-F * R * cp / (Math.Pow(AltitudeCalculator.a_h * Vcr * 1.943844, 2) * L_D), 1);

            Wto_cp = Math.Round(F * R / (L_D * AltitudeCalculator.a_h * Vcr * 1.943844), 1);

            Wto_LD = Math.Round(-F * R * cp / (Math.Pow(L_D, 2) * AltitudeCalculator.a_h * Vcr * 1.943844), 1);

            Wto_Ecp = Math.Round(F * Endr / (L_D), 1);

            Wto_ELD = Math.Round(-F * Endr * cj / Math.Pow(L_D_ltr, 2), 1);
        }