001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.apache.commons.math3.ode;
019
020import org.apache.commons.math3.exception.MathIllegalArgumentException;
021import org.apache.commons.math3.exception.MathIllegalStateException;
022
023
024/** This interface represents a second order integrator for
025 * differential equations.
026 *
027 * <p>The classes which are devoted to solve second order differential
028 * equations should implement this interface. The problems which can
029 * be handled should implement the {@link
030 * SecondOrderDifferentialEquations} interface.</p>
031 *
032 * @see SecondOrderDifferentialEquations
033 * @version $Id: SecondOrderIntegrator.java 1416643 2012-12-03 19:37:14Z tn $
034 * @since 1.2
035 */
036
037public interface SecondOrderIntegrator extends ODEIntegrator {
038
039  /** Integrate the differential equations up to the given time
040   * @param equations differential equations to integrate
041   * @param t0 initial time
042   * @param y0 initial value of the state vector at t0
043   * @param yDot0 initial value of the first derivative of the state
044   * vector at t0
045   * @param t target time for the integration
046   * (can be set to a value smaller thant <code>t0</code> for backward integration)
047   * @param y placeholder where to put the state vector at each
048   * successful step (and hence at the end of integration), can be the
049   * same object as y0
050   * @param yDot placeholder where to put the first derivative of
051   * the state vector at time t, can be the same object as yDot0
052   * @throws MathIllegalStateException if the integrator cannot perform integration
053   * @throws MathIllegalArgumentException if integration parameters are wrong (typically
054   * too small integration span)
055   */
056  void integrate(SecondOrderDifferentialEquations equations,
057                 double t0, double[] y0, double[] yDot0,
058                 double t, double[] y, double[] yDot)
059      throws MathIllegalStateException, MathIllegalArgumentException;
060
061}