1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/*
2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more
3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements.  See the NOTICE file distributed with
4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership.
5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0
6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with
7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License.  You may obtain a copy of the License at
8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *      http://www.apache.org/licenses/LICENSE-2.0
10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software
12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS,
13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and
15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License.
16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.ode;
19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.ode.DerivativeException;
21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/** This interface represents a second order differential equations set.
23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>This interface should be implemented by all real second order
25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * differential equation problems before they can be handled by the
26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * integrators {@link SecondOrderIntegrator#integrate} method.</p>
27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>A second order differential equations problem, as seen by an
29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * integrator is the second time derivative <code>d2Y/dt^2</code> of a
30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * state vector <code>Y</code>, both being one dimensional
31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * arrays. From the integrator point of view, this derivative depends
32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * only on the current time <code>t</code>, on the state vector
33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <code>Y</code> and on the first time derivative of the state
34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * vector.</p>
35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>For real problems, the derivative depends also on parameters
37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * that do not belong to the state vector (dynamical model constants
38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * for example). These constants are completely outside of the scope
39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * of this interface, the classes that implement it are allowed to
40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * handle them as they want.</p>
41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see SecondOrderIntegrator
43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see FirstOrderConverter
44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see FirstOrderDifferentialEquations
45dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision: 1073158 $ $Date: 2011-02-21 22:46:52 +0100 (lun. 21 févr. 2011) $
46dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 1.2
47dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
48dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
49dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic interface SecondOrderDifferentialEquations {
50dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
51dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Get the dimension of the problem.
52dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return dimension of the problem
53dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
54dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    int getDimension();
55dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
56dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Get the current time derivative of the state vector.
57dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param t current value of the independent <I>time</I> variable
58dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param y array containing the current value of the state vector
59dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param yDot array containing the current value of the first derivative
60dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * of the state vector
61dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param yDDot placeholder array where to put the second time derivative
62dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * of the state vector
63dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws DerivativeException this user-defined exception should be used if an error is
64dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * is triggered by user code
65dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
66dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    void computeSecondDerivatives(double t, double[] y, double[] yDot, double[] yDDot)
67dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        throws DerivativeException;
68dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
69dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond}
70