public void NaturalFitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void NaturalFitsAtArbitraryPointsWithMaple( [Values(-2.4, -0.9, -0.5, -0.1, 0.1, 0.4, 1.2, 10.0, -10.0)] double t, [Values(.144, 1.7906428571428571429, .47321428571428571431, -.80992857142857142857, -1.1089285714285714286, -1.0285714285714285714, .30285714285714285716, 189, 677)] double x, [Values(1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-12)] double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void NaturalFitsAtSamplePoints() { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x); for (int i = 0; i < _x.Length; i++) { Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); double interpolatedValue; double secondDerivative; interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); } }
public void FixedSecondDerivativeFitsAtSamplePoints() { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.SecondDerivative, -5.0, SplineBoundaryCondition.SecondDerivative, -1.0); for (int i = 0; i < _x.Length; i++) { Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); double interpolatedValue; double secondDerivative; interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); } }
public void NaturalFitsAtSamplePoints() { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x); for (int i = 0; i < _x.Length; i++) { Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); double interpolatedValue; double secondDerivative; interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); } }
public void FixedFirstDerivativeFitsAtArbitraryPointsWithMaple( [Values(-2.4, -0.9, -0.5, -0.1, 0.1, 0.4, 1.2, 10.0, -10.0)] double t, [Values(1.12, 1.8243928571428571428, .54910714285714285715, -.78903571428571428572, -1.1304642857142857143, -1.1040000000000000000, .4148571428571428571, -608.14285714285714286, 1330.1428571428571429)] double x, [Values(1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-12, 1e-12)] double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.FirstDerivative, 1.0, SplineBoundaryCondition.FirstDerivative, -1.0); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void NaturalFitsAtArbitraryPointsWithMaple( [Values(-2.4, -0.9, -0.5, -0.1, 0.1, 0.4, 1.2, 10.0, -10.0)] double t, [Values(.144, 1.7906428571428571429, .47321428571428571431, -.80992857142857142857, -1.1089285714285714286, -1.0285714285714285714, .30285714285714285716, 189, 677)] double x, [Values(1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-12)] double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void FixedSecondDerivativeFitsAtArbitraryPointsWithMaple( [Values(-2.4, -0.9, -0.5, -0.1, 0.1, 0.4, 1.2, 10.0, -10.0)] double t, [Values(-.8999999999999999993, 1.7590357142857142857, .41517857142857142854, -.82010714285714285714, -1.1026071428571428572, -1.0211428571428571429, .31771428571428571421, 39, -37)] double x, [Values(1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-13, 1e-12)] double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.SecondDerivative, -5.0, SplineBoundaryCondition.SecondDerivative, -1.0); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void FixedFirstDerivativeFitsAtArbitraryPointsWithMaple( [Values(-2.4, -0.9, -0.5, -0.1, 0.1, 0.4, 1.2, 10.0, -10.0)] double t, [Values(1.12, 1.8243928571428571428, .54910714285714285715, -.78903571428571428572, -1.1304642857142857143, -1.1040000000000000000, .4148571428571428571, -608.14285714285714286, 1330.1428571428571429)] double x, [Values(1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-12, 1e-12)] double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.FirstDerivative, 1.0, SplineBoundaryCondition.FirstDerivative, -1.0); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void FixedFirstDerivativeFitsAtSamplePoints() { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.FirstDerivative, 1.0, SplineBoundaryCondition.FirstDerivative, -1.0); for (int i = 0; i < _x.Length; i++) { Assert.AreEqual(_x[i], interpolation.Interpolate(_t[i]), "A Exact Point " + i); double interpolatedValue; double secondDerivative; interpolation.Differentiate(_t[i], out interpolatedValue, out secondDerivative); Assert.AreEqual(_x[i], interpolatedValue, "B Exact Point " + i); } }
public void FixedSecondDerivativeFitsAtArbitraryPointsWithMaple( [Values(-2.4, -0.9, -0.5, -0.1, 0.1, 0.4, 1.2, 10.0, -10.0)] double t, [Values(-.8999999999999999993, 1.7590357142857142857, .41517857142857142854, -.82010714285714285714, -1.1026071428571428572, -1.0211428571428571429, .31771428571428571421, 39, -37)] double x, [Values(1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-15, 1e-13, 1e-12)] double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.SecondDerivative, -5.0, SplineBoundaryCondition.SecondDerivative, -1.0); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }
public void FixedFirstDerivativeFitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError) { IInterpolation interpolation = new CubicSplineInterpolation(_t, _x, SplineBoundaryCondition.FirstDerivative, 1.0, SplineBoundaryCondition.FirstDerivative, -1.0); Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t); double interpolatedValue; double secondDerivative; interpolation.Differentiate(t, out interpolatedValue, out secondDerivative); Assert.AreEqual(x, interpolatedValue, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t); }