Esempio n. 1
0
        private InnerResult CalculateForE(AuxContainerFast c, ICalculatorU u)
        {
            var e    = new ResultE();
            var zeta = _model.Section1D.GetAllSection1DZeta();

            c.Eta = CalculateEta(_planItem.Lambdas);
            c.Exp = CalculateExp(c.Eta);

            c.P = CalculateP1(c.Eta, c.Exp);
            c.Q = CalculateQ1(c.Eta, c.Exp);
            c.A = CalculateA1(c);

            u.PreCalculate();

            e.U1 = _planItem.CalculateI1 ? u.CalculateU1() : new Complex[0];

            c.P = CalculatePSigma(zeta, c.Eta, c.Exp);
            c.Q = CalculateQSigma(c.Eta, c.Exp);

            c.A = CalculateASigma(c);

            e.U2 = _planItem.CalculateI2 ? u.CalculateU2() : new Complex[0];
            e.U3 = _planItem.CalculateI3 ? u.CalculateU3() : new Complex[0];
            e.U4 = _planItem.CalculateI4 ? u.CalculateU4() : new Complex[0];
            e.U5 = _planItem.CalculateI5 ? u.CalculateU5(_planItem.Lambdas) : new Complex[0];

            var result = ScalarMathUtils.NormalizeAndPerformHankelFast(e, _planItem, _model, c.CorrBackgroundRc);

            return(result);
        }
Esempio n. 2
0
        public static InnerResult NormalizeAndPerformHankel(ResultE e, ScalarPlanItem planItem, OmegaModel model, int corrBackgroundRc)
        {
            NormalizeBeforeHankelForE(model, corrBackgroundRc, e, planItem);
            var r = CalculateHankelForE(planItem, e);

            NormalizeAfterHankelForE(planItem, r);

            return(r);
        }
Esempio n. 3
0
        private static ResultE InitResultE(ScalarPlanItem planItem)
        {
            var length = planItem.Lambdas.Length;

            var r = new ResultE
            {
                U1 = planItem.CalculateI1 ? new Complex[length] : new Complex[0],
                U2 = planItem.CalculateI2 ? new Complex[length] : new Complex[0],
                U3 = planItem.CalculateI3 ? new Complex[length] : new Complex[0],
                U4 = planItem.CalculateI4 ? new Complex[length] : new Complex[0],
                U5 = planItem.CalculateI5 ? new Complex[length] : new Complex[0],
            };

            return(r);
        }
Esempio n. 4
0
        private static InnerResult CalculateHankelForEFast(ScalarPlanItem item, ResultE r)
        {
            var hankel = item.HankelCoefficients;
            var length = item.Rho.Length;

            return(new InnerResult
            {
                Rho = item.Rho,

                I1 = item.CalculateI1 ? hankel.ConvoluteWithHank1Fast(r.U1, length) : new Complex[0],
                I2 = item.CalculateI2 ? hankel.ConvoluteWithHank1Fast(r.U2, length) : new Complex[0],
                I3 = item.CalculateI3 ? hankel.ConvoluteWithHank0Fast(r.U3, length) : new Complex[0],
                I4 = item.CalculateI4 ? hankel.ConvoluteWithHank0Fast(r.U4, length) : new Complex[0],
                I5 = item.CalculateI5 ? hankel.ConvoluteWithHank1Fast(r.U5, length) : new Complex[0],
            });
        }
Esempio n. 5
0
        private static void NormalizeBeforeHankelForE(OmegaModel model, int corrBackgroundRc, ResultE r, ScalarPlanItem item)
        {
            var lambdas   = item.Lambdas;
            var zetaRc2   = 2 * model.Section1D[corrBackgroundRc].Zeta;
            var iOmegaMu0 = Complex.ImaginaryOne * model.Omega * Mu0;

            for (int i = 0; i < r.U1.Length; i++)
            {
                r.U1[i] *= (iOmegaMu0 / 2);
            }

            for (int i = 0; i < r.U2.Length; i++)
            {
                r.U2[i] /= zetaRc2;
            }

            for (int i = 0; i < r.U3.Length; i++)
            {
                r.U3[i] *= lambdas[i] / zetaRc2;
            }

            for (int i = 0; i < r.U4.Length; i++)
            {
                r.U4[i] *= -lambdas[i] / zetaRc2;
            }

            for (int i = 0; i < r.U5.Length; i++)
            {
                r.U5[i] *= (lambdas[i] * lambdas[i]) / zetaRc2;
            }
        }