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 018 package org.apache.commons.math.ode; 019 020 import org.apache.commons.math.ode.DerivativeException; 021 022 /** This interface represents a second order differential equations set. 023 024 * <p>This interface should be implemented by all real second order 025 * differential equation problems before they can be handled by the 026 * integrators {@link SecondOrderIntegrator#integrate} method.</p> 027 * 028 * <p>A second order differential equations problem, as seen by an 029 * integrator is the second time derivative <code>d2Y/dt^2</code> of a 030 * state vector <code>Y</code>, both being one dimensional 031 * arrays. From the integrator point of view, this derivative depends 032 * only on the current time <code>t</code>, on the state vector 033 * <code>Y</code> and on the first time derivative of the state 034 * vector.</p> 035 * 036 * <p>For real problems, the derivative depends also on parameters 037 * that do not belong to the state vector (dynamical model constants 038 * for example). These constants are completely outside of the scope 039 * of this interface, the classes that implement it are allowed to 040 * handle them as they want.</p> 041 * 042 * @see SecondOrderIntegrator 043 * @see FirstOrderConverter 044 * @see FirstOrderDifferentialEquations 045 * @version $Revision: 1073158 $ $Date: 2011-02-21 22:46:52 +0100 (lun. 21 f??vr. 2011) $ 046 * @since 1.2 047 */ 048 049 public interface SecondOrderDifferentialEquations { 050 051 /** Get the dimension of the problem. 052 * @return dimension of the problem 053 */ 054 int getDimension(); 055 056 /** Get the current time derivative of the state vector. 057 * @param t current value of the independent <I>time</I> variable 058 * @param y array containing the current value of the state vector 059 * @param yDot array containing the current value of the first derivative 060 * of the state vector 061 * @param yDDot placeholder array where to put the second time derivative 062 * of the state vector 063 * @throws DerivativeException this user-defined exception should be used if an error is 064 * is triggered by user code 065 */ 066 void computeSecondDerivatives(double t, double[] y, double[] yDot, double[] yDDot) 067 throws DerivativeException; 068 069 }