Exemple #1
0
        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);

            var actual = interpolation.DifferentiateAll(t);

            Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t);
        }
Exemple #2
0
        public void FixedSecondDerivativeFitsAtArbitraryPointsWithMaple(double t, double x, 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);

            var actual = interpolation.DifferentiateAll(t);

            Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t);
        }
Exemple #3
0
        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);

                var actual = interpolation.DifferentiateAll(_t[i]);
                Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i);
            }
        }
Exemple #4
0
        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);

                var actual = interpolation.DifferentiateAll(_t[i]);
                Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i);
            }
        }
        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);

            var actual = interpolation.DifferentiateAll(t);
            Assert.AreEqual(x, actual.Item1, 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);

                var actual = interpolation.DifferentiateAll(_t[i]);
                Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i);
            }
        }
        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);

            var actual = interpolation.DifferentiateAll(t);
            Assert.AreEqual(x, actual.Item1, maxAbsoluteError, "Interpolation as by-product of differentiation at {0}", t);
        }
        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);

                var actual = interpolation.DifferentiateAll(_t[i]);
                Assert.AreEqual(_x[i], actual.Item1, "B Exact Point " + i);
            }
        }