Package org.apache.commons.math.ode

Examples of org.apache.commons.math.ode.DerivativeException


          super(y, new double[y.length], forward);
      }
      @Override
      protected void doFinalize()
      throws DerivativeException {
          throw new DerivativeException(null);
      }
View Full Code Here


          new FirstOrderDifferentialEquations() {
            private static final long serialVersionUID = -1157081786301178032L;
            public void computeDerivatives(double t, double[] y, double[] dot)
            throws DerivativeException {
            if (t < -0.5) {
                throw new DerivativeException("{0}", "oops");
            } else {
                throw new DerivativeException(new RuntimeException("oops"));
           }
          }
          public int getDimension() {
              return 1;
          }
View Full Code Here

                        for (int k = 0; (k < 4) && (ga * gb > 0); ++k) {
                            ta += epsilon;
                            try {
                                ga = f.value(ta);
                            } catch (FunctionEvaluationException ex) {
                                throw new DerivativeException(ex);
                            }
                        }
                        if (ga * gb > 0) {
                            // this should never happen
                            throw new MathInternalError();
                        }
                    }

                    final double root;
                    try {
                        root = (ta <= tb) ?
                                solver.solve(maxIterationCount, f, ta, tb) :
                                    solver.solve(maxIterationCount, f, tb, ta);
                    } catch (FunctionEvaluationException ex) {
                        throw new DerivativeException(ex);
                    }

                    if ((!Double.isNaN(previousEventTime)) &&
                        (FastMath.abs(root - ta) <= convergence) &&
                        (FastMath.abs(root - previousEventTime) <= convergence)) {
View Full Code Here

            final int k = dFdP[0].length;

            // compute raw ODE and its jacobians: dy/dt, d[dy/dt]/dy0 and d[dy/dt]/dp
            System.arraycopy(z,    0, y,    0, n);
            if (++evaluations > maxEvaluations) {
                throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
            }
            ode.computeDerivatives(t, y, yDot);
            ode.computeJacobians(t, y, yDot, dFdY, dFdP);

            // state part of the compound equations
View Full Code Here

            final int n = hY.length;
            final int k = hP.length;

            evaluations += n + k;
            if (evaluations > maxEvaluations) {
                throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
            }

            // compute df/dy where f is the ODE and y is the state array
            for (int j = 0; j < n; ++j) {
                final double savedYj = y[j];
View Full Code Here

          new FirstOrderDifferentialEquations() {
            private static final long serialVersionUID = -1157081786301178032L;
            public void computeDerivatives(double t, double[] y, double[] dot)
            throws DerivativeException {
            if (t < -0.5) {
                throw new DerivativeException(LocalizedFormats.SIMPLE_MESSAGE, "oops");
            } else {
                throw new DerivativeException(new RuntimeException("oops"));
           }
          }
          public int getDimension() {
              return 1;
          }
View Full Code Here

      public BadStepInterpolator(double[] y, boolean forward) {
          super(y, new double[y.length], forward);
      }
      @Override
      protected void doFinalize() throws DerivativeException {
          throw new DerivativeException((Localizable) null, LocalizedFormats.SIMPLE_MESSAGE, "");
      }
View Full Code Here

      super(y, forward);
    }
    @Override
    protected void doFinalize()
    throws DerivativeException {
          throw new DerivativeException(null);
      }
View Full Code Here

          new FirstOrderDifferentialEquations() {
            private static final long serialVersionUID = -1157081786301178032L;
            public void computeDerivatives(double t, double[] y, double[] dot)
            throws DerivativeException {
            if (t < -0.5) {
                throw new DerivativeException("{0}", "oops");
            } else {
                throw new DerivativeException(new RuntimeException("oops"));
           }
          }
          public int getDimension() {
              return 1;
          }
View Full Code Here

            final int k = dFdP[0].length;

            // compute raw ODE and its jacobians: dy/dt, d[dy/dt]/dy0 and d[dy/dt]/dp
            System.arraycopy(z,    0, y,    0, n);
            if (++evaluations > maxEvaluations) {
                throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
            }
            ode.computeDerivatives(t, y, yDot);
            ode.computeJacobians(t, y, yDot, dFdY, dFdP);

            // state part of the compound equations
View Full Code Here

TOP

Related Classes of org.apache.commons.math.ode.DerivativeException

Copyright © 2018 www.massapicom. 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.