Esempio n. 1
0
        public void ImprovedEulersTests(double expected, double step, double iterations, string function, double x, params double[] y)
        {
            Queue <Element> calculated = RPN.SYA(function);
            double          value      = DiffEquations.ImprovedEulers(calculated, step, x, y.ToList(), (int)iterations);

            Assert.AreEqual(expected, value, 1e-3);
        }
Esempio n. 2
0
        public void EulersTests(double expected, double step, double x, double y, double iterations, string function)
        {
            Queue <Element> calculated = RPN.SYA(function);
            double          value      = DiffEquations.Eulers(calculated, step, x, y, (int)iterations);

            Assert.AreEqual(expected, value, 1e-3);
        }
Esempio n. 3
0
        public void SimpsonsTests(double?expected, double lowerBound, double upperBound, double numOrdinates, string function)
        {
            Queue <Element> calculated = RPN.SYA(function);
            double?         value      = Integration.Simpsons(calculated, lowerBound, upperBound, numOrdinates);

            if (expected.HasValue)
            {
                Assert.AreEqual(expected.Value, value.Value, 1e-3);
            }
            else
            {
                Assert.AreEqual(expected, value);
            }
        }
        public void RPNIntegrationTests(double expected, string input, double xValue = 0)
        {
            Queue <Element> calculated = RPN.SYA(input);

            Assert.AreEqual(expected, RPN.Compute(calculated, ("x", xValue)), 1e-6);
        }
        public void SYATests(string expected, string input)
        {
            Queue <Element> calculated = RPN.SYA(input);

            Assert.AreEqual(expected, RPN.ToString(calculated));
        }