Esempio n. 1
0
        public void IntegrateOverRealPlane()
        {
            Func <double, double, double> integrand = (x, y) => Math.Exp(-x * x - y * y) / Math.PI;
            double result = ImproperQuadrature.IntegrateOverRealPlane(integrand, 1, 32);

            AssertHelper.AssertApproximatelyEqual(1, result, 4);
        }
        public double CalculateLongitudinalElectricComponent(
            double effectiveTime_fm,
            double radialDistance_fm,
            double conductivity_MeV
            )
        {
            Func <double, double, double> integrand = (x_fm, y_fm) =>
            {
                SpatialVector pointChargePosition = new SpatialVector(radialDistance_fm - x_fm, -y_fm, 0);

                return(Nucleus.GetProtonNumberColumnDensity_per_fm3(x_fm, y_fm)
                       * PointChargeEMF.CalculateElectromagneticField(
                           EMFComponent.LongitudinalElectricComponent,
                           effectiveTime_fm,
                           pointChargePosition.Norm,
                           conductivity_MeV)
                       * pointChargePosition.Direction.X);
            };

            double integral = ImproperQuadrature.IntegrateOverRealPlane(
                integrand,
                2 * Nucleus.NuclearRadius_fm,
                QuadratureOrder);

            return(integral);
        }