Пример #1
0
        private static double PwdRinLaplaceSpace(double s, double cd, double skinFactor)
        {
            var rz = Math.Sqrt(s);
            var p1 = SpecialFunctions.BesselK0(rz) + skinFactor * rz * SpecialFunctions.BesselK1(rz);
            var p2 = s * (rz * SpecialFunctions.BesselK1(rz) + cd * s * p1);

            return(p1 / p2);
        }
 public void BesselK0Exact(double x, double expected)
 {
     AssertHelpers.AlmostEqualRelative(expected, SpecialFunctions.BesselK0(x), 14);
 }
 public void BesselK0Approx([Range(0.20, 2.0, 0.20)] double x)
 {
     // Approx by Abramowitz/Stegun 9.8.5
     Assert.AreEqual(Evaluate.Polynomial(x / 2.0, -Math.Log(x / 2.0) * SpecialFunctions.BesselI0(x) - 0.57721566, 0.0, 0.42278420, 0.0, 0.23069756, 0.0, 0.03488590, 0.0, 0.00262698, 0.0, 0.00010750, 0.0, 0.00000740), SpecialFunctions.BesselK0(x), 1e-8);
 }