예제 #1
0
        /// <summary>
        /// Processing step
        /// </summary>
        private void sim(ref double t, double dt)
        {
            //if(S.Vx < s.VtakeOff)
            //{
            //    Y = modeling.GetIntegratedValues(S, modelDimention);
            //    modeling.takeOff(d, S, F, M, del, s);
            //    X = modeling.GetDiffValues(d, modelDimention);
            //    X0 = integ.RungeKytt_withCor_step1(modelDimention, dt, X0, Y);
            //    integ.RungeKytt_withCor_step1(modelDimention, dt, X0, Y);
            //    modeling.ReturnIntegratedValues(S, Y);

            //    Y = modeling.GetIntegratedValues(S, modelDimention);
            //    modeling.takeOff(d, S, F, M, del, s);
            //    X = modeling.GetDiffValues(d, modelDimention);
            //    integ.RungeKytt_withCor_step2(modelDimention, dt, X, Y, X0);
            //    modeling.ReturnIntegratedValues(S, Y);
            //}

            if (this.toolStripComboBox1_IntegMeth.Text == "Runge Kutti with corr")
            {
                Y = modeling.getIntegratedValuesIncrements(S, modelDimention);
                modeling.dynLinear(d, S, c, del, s);
                X  = modeling.getDiffValuesIncrements(d, modelDimention);
                X0 = integ.rungeKytti_withCor_step1(modelDimention, dt, X0, Y);
                integ.rungeKytti_withCor_step1(modelDimention, dt, X0, Y);
                modeling.returnIntegratedValuesIncrements(S, Y);

                Y = modeling.getIntegratedValuesIncrements(S, modelDimention);
                modeling.dynLinear(d, S, c, del, s);
                X = modeling.getDiffValuesIncrements(d, modelDimention);
                integ.rungeKytti_withCor_step2(modelDimention, dt, X, Y, X0);
                modeling.returnIntegratedValuesIncrements(S, Y);
                modeling.setRealParamValuesFromIncrements(S, d, del);
            }
            else if (this.toolStripComboBox1_IntegMeth.Text == "Runge Kutti")
            {
                Y = modeling.getIntegratedValuesIncrements(S, modelDimention);
                modeling.dynLinear(d, S, c, del, s);
                X  = modeling.getDiffValuesIncrements(d, modelDimention);
                X0 = integ.rungeKytti_step1(modelDimention, dt, X, Y, X0);
                integ.rungeKytti_step1(modelDimention, dt, X, Y, X0);
                modeling.returnIntegratedValuesIncrements(S, Y);

                Y = modeling.getIntegratedValuesIncrements(S, modelDimention);
                modeling.dynLinear(d, S, c, del, s);
                X = modeling.getDiffValuesIncrements(d, modelDimention);
                integ.rungeKytti_step2(modelDimention, dt, X, Y, X0);
                modeling.returnIntegratedValuesIncrements(S, Y);
                modeling.setRealParamValuesFromIncrements(S, d, del);
            }
            else
            {
                Y = modeling.getIntegratedValuesIncrements(S, modelDimention);
                modeling.dynLinear(d, S, c, del, s);
                X = modeling.getDiffValuesIncrements(d, modelDimention);
                integ.eiler(modelDimention, dt, X, Y);
                modeling.returnIntegratedValuesIncrements(S, Y);
                modeling.setRealParamValuesFromIncrements(S, d, del);
            }

            dataGridFill();
            initilizeGrapg();

            t += s.dt;
        }