Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 * @exception NumberIsTooSmallException if number of steps is smaller than 2
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance)
    throws NumberIsTooSmallException {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps < 2) {
        throw new NumberIsTooSmallException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              nSteps, 2, true);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 2
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 * @exception NumberIsTooSmallException if number of steps is smaller than 2
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance)
    throws NumberIsTooSmallException {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps < 2) {
        throw new NumberIsTooSmallException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              nSteps, 2, true);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 3
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance) {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps <= 1) {
        throw new MathIllegalArgumentException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              name);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 4
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 * @exception NumberIsTooSmallException if number of steps is smaller than 2
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance)
    throws NumberIsTooSmallException {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps < 2) {
        throw new NumberIsTooSmallException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              nSteps, 2, true);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 5
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance) {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps <= 1) {
        throw new MathIllegalArgumentException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              name);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 6
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 * @exception NumberIsTooSmallException if number of steps is smaller than 2
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance)
    throws NumberIsTooSmallException {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps < 2) {
        throw new NumberIsTooSmallException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              nSteps, 2, true);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 7
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 * @exception NumberIsTooSmallException if number of steps is smaller than 2
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance)
    throws NumberIsTooSmallException {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps < 2) {
        throw new NumberIsTooSmallException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              nSteps, 2, true);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}
 
Example 8
Source File: MultistepIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Build a multistep integrator with the given stepsize bounds.
 * <p>The default starter integrator is set to the {@link
 * DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
 * some defaults settings.</p>
 * <p>
 * The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
 * </p>
 * @param name name of the method
 * @param nSteps number of steps of the multistep method
 * (excluding the one being computed)
 * @param order order of the method
 * @param minStep minimal step (must be positive even for backward
 * integration), the last step can be smaller than this
 * @param maxStep maximal step (must be positive even for backward
 * integration)
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 * @exception NumberIsTooSmallException if number of steps is smaller than 2
 */
protected MultistepIntegrator(final String name, final int nSteps,
                              final int order,
                              final double minStep, final double maxStep,
                              final double scalAbsoluteTolerance,
                              final double scalRelativeTolerance)
    throws NumberIsTooSmallException {

    super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);

    if (nSteps < 2) {
        throw new NumberIsTooSmallException(
              LocalizedFormats.INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS,
              nSteps, 2, true);
    }

    starter = new DormandPrince853Integrator(minStep, maxStep,
                                             scalAbsoluteTolerance,
                                             scalRelativeTolerance);
    this.nSteps = nSteps;

    exp = -1.0 / order;

    // set the default values of the algorithm control parameters
    setSafety(0.9);
    setMinReduction(0.2);
    setMaxGrowth(FastMath.pow(2.0, -exp));

}