Example #1
0
        public bool Calc()
        {
            MPAMaterial Mat;
            double      IncAngleStart;
            double      IncAngleEnd;
            int         IncAngleCount;
            int         k;

            RigidBacking.Clear();
            AnechoicTermination.Clear();
            TransmissionLoss.Clear();

            TotalThickness = this.CalcThickness();

            if (Incidence == 1)
            {
                IncAngleStart = 0.1 * Math.Pow(10, -10);
                IncAngleEnd   = IncAngleStart;
                IncAngleCount = 1;
            }
            else
            {
                IncAngleStart = 2;
                IncAngleEnd   = IncAngle;
                IncAngleCount = (int)(IncAngle / IncAngleStart);
            }

            setInitialData();
            setFrequency();

            double[,] Rigid    = new double[limitfreq, IncAngleCount];
            double[,] Anechoic = new double[limitfreq, IncAngleCount];
            double[,] TL       = new double[limitfreq, IncAngleCount];

            for (int i = 0; i < limitfreq; i++)
            {
                double freq = Frequency.GetData(i);
                k = 0;

                for (double IncAngleTemp = IncAngleStart; IncAngleTemp <= IncAngleEnd; IncAngleTemp = IncAngleTemp + IncAngleStart)
                {
                    m_tempOut = TMCalc.TMInit();
                    m_TM      = m_tempOut[1];
                    m_Result  = m_tempOut[2];
                    // 임시 루틴.
                    //m_TM = TMCalc.TMCheck();
                    double theta = IncAngleTemp * Math.PI / 180;

                    for (int jj = 0; jj < MatCollection.Count; jj++)
                    {
                        Mat = (MPAMaterial)MatCollection[jj];
                        switch (Mat.MID)
                        {
                        case 1:
                            m_TM = TMCalc.TMAir(m_c, m_Densityo, freq, Mat.Thick, theta);
                            break;

                        case 2:
                            m_TM = TMCalc.TMPanel(m_c, Mat.BulkDens, Mat.Ymodulus, freq, Mat.Thick, Mat.PoissionR, theta);
                            break;

                        case 3:
                            m_TM = TMCalc.TMImperMemb(m_c, Mat.BulkDens, freq, Mat.Thick, theta);
                            break;

                        case 4:
                            m_TM = TMCalc.TMImperMemb(m_c, Mat.BulkDens, freq, Mat.Thick, theta);
                            break;

                        case 5:
                            m_TM = TMCalc.TMLimp(Mat.BulkDens, m_c, m_Densityo, Mat.FlowRes, freq, Mat.Porosity, m_HeatRatio, m_ItaAir, Mat.Thick, m_Npr, m_P0, Mat.SFactor, Mat.ThermalCL / 1000000, theta, Mat.ViscousCL / 1000000);
                            break;

                        case 6:
                            m_TM = TMCalc.TMRigid(Mat.BulkDens, m_c, m_Densityo, Mat.FlowRes, freq, Mat.Porosity, m_HeatRatio, m_ItaAir, Mat.Thick, m_Npr, m_P0, Mat.SFactor, Mat.ThermalCL / 1000000, theta, Mat.ViscousCL / 1000000);
                            break;

                        case 7:
                            m_TM = TMCalc.TMElastic(Mat.BulkDens, m_c, m_Densityo, Mat.Ymodulus, Mat.FlowRes, freq, Mat.Porosity, m_HeatRatio, m_ItaAir, Mat.Thick, Mat.LossFactor, m_Npr, Mat.PoissionR, Mat.SFactor, Mat.ThermalCL / 1000000, theta, Mat.ViscousCL / 1000000);
                            break;

                        case 8:
                            m_TM = TMCalc.TMPanelElastic(Mat.BulkDens, m_c, m_Densityo, Mat.DensityP1, Mat.Ymodulus, Mat.EmP1, Mat.FlowRes, freq, Mat.Porosity, m_HeatRatio, Mat.HP1, m_ItaAir, Mat.Thick, Mat.LossFactor, m_Npr, Mat.PoissionR, Mat.PRatioP1, Mat.SFactor, Mat.ThermalCL / 1000000, theta, Mat.ViscousCL / 1000000);
                            break;

                        case 9:
                            m_TM = TMCalc.TMElasticPanel(Mat.BulkDens, m_c, m_Densityo, Mat.DensityP2, Mat.Ymodulus, Mat.EmP2, Mat.FlowRes, freq, Mat.Porosity, m_HeatRatio, Mat.HP2 / 1000, Mat.Thick, Mat.LossFactor, m_Npr, Mat.PoissionR, Mat.PRatioP2, Mat.SFactor, Mat.ThermalCL / 1000000, theta, Mat.ViscousCL / 1000000);
                            break;

                        default:
                            m_TM = TMCalc.TMPanelElasticPanel(Mat.BulkDens, m_c, m_Densityo, Mat.DensityP1, Mat.DensityP2, Mat.Ymodulus, Mat.EmP1, Mat.EmP2, Mat.FlowRes, freq, Mat.Porosity, m_HeatRatio, Mat.HP1, Mat.HP2, m_ItaAir, Mat.Thick, Mat.LossFactor, m_Npr, Mat.PoissionR, Mat.PRatioP1, Mat.PRatioP2, Mat.SFactor, Mat.ThermalCL / 1000000, theta, Mat.ViscousCL / 1000000);
                            break;
                        }
                        // 임시 루틴.
                        //TMCalc.TMCheck();
                        m_Result = TMCalc.TMMul(m_TM, m_Result);
                        // 임시 루틴.
                        //TMCalc.TMCheck();
                    }
                    m_Out = TMCalc.TMCalc(freq, theta, TotalThickness);
                    // 임시 루틴.
                    //TMCalc.TMCheck();

                    if (Incidence == 1)
                    {
                        RigidBacking.AddData(double.Parse(m_Out[1].ToString()));
                        AnechoicTermination.AddData(double.Parse(m_Out[2].ToString()));
                        TransmissionLoss.AddData(10 * Math.Log10(1 / double.Parse(m_Out[3].ToString())));
                    }
                    else
                    {
                        Rigid[i, k]    = 2 * double.Parse(m_Out[1].ToString()) * Math.Sin(theta) * Math.Cos(theta);
                        Anechoic[i, k] = 2 * double.Parse(m_Out[2].ToString()) * Math.Sin(theta) * Math.Cos(theta);
                        TL[i, k]       = 2 * double.Parse(m_Out[3].ToString()) * Math.Sin(theta) * Math.Cos(theta);
                    }
                    k = k + 1;
                }
            }

            if (Incidence != 1)
            {
                double width = IncAngleStart * Math.PI / 180;

                for (int i = 0; i < limitfreq; i++)
                {
                    double freq = Frequency.GetData(i);

                    double RigidLast    = 0;
                    double AnechoicLast = 0;
                    double TLLast       = 0;

                    for (int j = 0; j < (IncAngleCount - 2); j = j + 2)
                    {
                        RigidLast    = RigidLast + (width / 3) * (Rigid[i, j] + 4 * Rigid[i, j + 1] + Rigid[i, j + 2]);
                        AnechoicLast = AnechoicLast + (width / 3) * (Anechoic[i, j] + 4 * Anechoic[i, j + 1] + Anechoic[i, j + 2]);
                        TLLast       = TLLast + (width / 3) * (TL[i, j] + 4 * TL[i, j + 1] + TL[i, j + 2]);
                    }

                    RigidBacking.AddData(RigidLast);
                    AnechoicTermination.AddData(AnechoicLast);
                    TransmissionLoss.AddData(10 * Math.Log10(1 / TLLast));
                }
            }

            return(true);
        }
Example #2
0
        public bool Calc()
        {
            double IncAngleStart;
            double IncAngleEnd;
            int    IncAngleCount;
            int    k;

            Rgraph_RB = new ClsData();
            Rgraph_AT = new ClsData();
            Rgraph_TL = new ClsData();

            if (Incidence == 1)
            {
                IncAngleStart = 0.1 * Math.Pow(10, -10);
                IncAngleEnd   = IncAngleStart;
                IncAngleCount = 1;
            }
            else
            {
                IncAngleStart = 0.5;
                IncAngleEnd   = IncAngle;
                IncAngleCount = (int)(IncAngle / IncAngleStart);
            }

            setInitialData();
            setFrequency();

            double[,] Rigid    = new double[limitfreq, IncAngleCount];
            double[,] Anechoic = new double[limitfreq, IncAngleCount];
            double[,] TL       = new double[limitfreq, IncAngleCount];

            for (int i = 0; i < limitfreq; i++)
            {
                double freq = Frequency.GetData(i);
                k = 0;

                for (double IncAngleTemp = IncAngleStart; IncAngleTemp <= IncAngleEnd; IncAngleTemp = IncAngleTemp + IncAngleStart)
                {
                    m_tempOut = TMCalc.TMInit();
                    m_TM      = m_tempOut[1];
                    m_Result  = m_tempOut[2];
                    double theta = IncAngleTemp * Math.PI / 180;

                    switch (MID)
                    {
                    case 5:
                        m_TM = TMCalc.TMLimp(BulkDens, m_c, m_Densityo, FlowRes, freq, Porosity, m_HeatRatio, m_ItaAir, Thick, m_Npr, m_P0, SFactor, ThermalCL * 0.000001, theta, ViscousCL * 0.000001);
                        break;

                    case 6:
                        m_TM = TMCalc.TMRigid(BulkDens, m_c, m_Densityo, FlowRes, freq, Porosity, m_HeatRatio, m_ItaAir, Thick, m_Npr, m_P0, SFactor, ThermalCL * 0.000001, theta, ViscousCL * 0.000001);
                        break;

                    case 7:
                        m_TM = TMCalc.TMElastic(BulkDens, m_c, m_Densityo, Ymodulus, FlowRes, freq, Porosity, m_HeatRatio, m_ItaAir, Thick, LossFactor, m_Npr, PoissionR, SFactor, ThermalCL * 0.000001, theta, ViscousCL * 0.000001);
                        break;
                    }

                    m_Result = TMCalc.TMMul(m_TM, m_Result);
                    m_Out    = TMCalc.TMCalc(freq, theta, Thick);
                    if (Incidence == 1)
                    {
                        Rgraph_RB.AddData(double.Parse(m_Out[1].ToString()));
                        Rgraph_AT.AddData(double.Parse(m_Out[2].ToString()));
                        Rgraph_TL.AddData(10 * Math.Log10(1 / double.Parse(m_Out[3].ToString())));
                    }
                    else
                    {
                        Rigid[i, k]    = 2 * double.Parse(m_Out[1].ToString()) * Math.Sin(theta) * Math.Cos(theta);
                        Anechoic[i, k] = 2 * double.Parse(m_Out[2].ToString()) * Math.Sin(theta) * Math.Cos(theta);
                        TL[i, k]       = 2 * double.Parse(m_Out[3].ToString()) * Math.Sin(theta) * Math.Cos(theta);
                    }
                    k = k + 1;
                }
            }

            if (Incidence != 1)
            {
                double width = IncAngleStart * Math.PI / 180;

                for (int i = 0; i < limitfreq; i++)
                {
                    double freq = Frequency.GetData(i);

                    double RigidLast    = 0;
                    double AnechoicLast = 0;
                    double TLLast       = 0;

                    for (int j = 0; j < (IncAngleCount - 2); j = j + 2)
                    {
                        RigidLast    = RigidLast + (width / 3) * (Rigid[i, j] + 4 * Rigid[i, j + 1] + Rigid[i, j + 2]);
                        AnechoicLast = AnechoicLast + (width / 3) * (Anechoic[i, j] + 4 * Anechoic[i, j + 1] + Anechoic[i, j + 2]);
                        TLLast       = TLLast + (width / 3) * (TL[i, j] + 4 * TL[i, j + 1] + TL[i, j + 2]);
                    }

                    Rgraph_RB.AddData(RigidLast);
                    Rgraph_AT.AddData(AnechoicLast);
                    Rgraph_TL.AddData(10 * Math.Log10(1 / TLLast));
                }
            }

            return(true);
        }