Examples of UnivariateRealFunction


Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of solver for the quintic function using solve2().
     */
    public void testQuinticFunction2() throws MathException {
        UnivariateRealFunction f = new QuinticFunction();
        MullerSolver solver = new MullerSolver();
        double min, max, expected, result, tolerance;

        min = -0.4; max = 0.2; expected = 0.0;
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

     * It takes 10 to 15 iterations for the last two tests to converge.
     * In fact, if not for the bisection alternative, the solver would
     * exceed the default maximal iteration of 100.
     */
    public void testExpm1Function() throws MathException {
        UnivariateRealFunction f = new Expm1Function();
        UnivariateRealSolver solver = new MullerSolver();
        double min, max, expected, result, tolerance;

        min = -1.0; max = 2.0; expected = 0.0;
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

     * Test of solver for the exponential function using solve2().
     * <p>
     * It takes 25 to 50 iterations for the last two tests to converge.
     */
    public void testExpm1Function2() throws MathException {
        UnivariateRealFunction f = new Expm1Function();
        MullerSolver solver = new MullerSolver();
        double min, max, expected, result, tolerance;

        min = -1.0; max = 2.0; expected = 0.0;
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of parameters for the solver.
     */
    public void testParameters() throws Exception {
        UnivariateRealFunction f = new SinFunction();
        UnivariateRealSolver solver = new MullerSolver();

        try {
            // bad interval
            solver.solve(f, 1, -1);
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of integrator for the sine function.
     */
    public void testSinFunction() throws MathException {
        UnivariateRealFunction f = new SinFunction();
        UnivariateRealIntegrator integrator = new TrapezoidIntegrator();
        double min, max, expected, result, tolerance;

        min = 0; max = Math.PI; expected = 2;
        tolerance = Math.abs(expected * integrator.getRelativeAccuracy());
 
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of integrator for the quintic function.
     */
    public void testQuinticFunction() throws MathException {
        UnivariateRealFunction f = new QuinticFunction();
        UnivariateRealIntegrator integrator = new TrapezoidIntegrator();
        double min, max, expected, result, tolerance;

        min = 0; max = 1; expected = -1.0/48;
        tolerance = Math.abs(expected * integrator.getRelativeAccuracy());
 
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of parameters for the integrator.
     */
    public void testParameters() throws Exception {
        UnivariateRealFunction f = new SinFunction();
        UnivariateRealIntegrator integrator = new TrapezoidIntegrator();

        try {
            // bad interval
            integrator.integrate(f, 1, -1);
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of integrator for the sine function.
     */
    public void testSinFunction() throws MathException {
        UnivariateRealFunction f = new SinFunction();
        UnivariateRealIntegrator integrator = new SimpsonIntegrator();
        double min, max, expected, result, tolerance;

        min = 0; max = Math.PI; expected = 2;
        tolerance = Math.abs(expected * integrator.getRelativeAccuracy());
 
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of integrator for the quintic function.
     */
    public void testQuinticFunction() throws MathException {
        UnivariateRealFunction f = new QuinticFunction();
        UnivariateRealIntegrator integrator = new SimpsonIntegrator();
        double min, max, expected, result, tolerance;

        min = 0; max = 1; expected = -1.0/48;
        tolerance = Math.abs(expected * integrator.getRelativeAccuracy());
 
View Full Code Here

Examples of org.apache.commons.math.analysis.UnivariateRealFunction

    /**
     * Test of parameters for the integrator.
     */
    public void testParameters() throws Exception {
        UnivariateRealFunction f = new SinFunction();
        UnivariateRealIntegrator integrator = new SimpsonIntegrator();

        try {
            // bad interval
            integrator.integrate(f, 1, -1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.