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 BesselK1Exact(double x, double expected) { AssertHelpers.AlmostEqualRelative(expected, SpecialFunctions.BesselK1(x), 14); }
public void BesselK1Approx([Range(0.20, 2.0, 0.20)] double x) { // Approx by Abramowitz/Stegun 9.8.7 Assert.AreEqual(Evaluate.Polynomial(x / 2.0, x * Math.Log(x / 2.0) * SpecialFunctions.BesselI1(x) + 1.0, 0.0, 0.15443144, 0.0, -0.67278579, 0.0, -0.18156897, 0.0, -0.01919402, 0.0, -0.00110404, 0.0, -0.00004686), SpecialFunctions.BesselK1(x) * x, 1e-8); }