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.DimensionMismatchException; 021import org.apache.commons.math3.exception.MaxCountExceededException; 022 023 024 025/** This interface represents a first order differential equations set. 026 * 027 * <p>This interface should be implemented by all real first order 028 * differential equation problems before they can be handled by the 029 * integrators {@link FirstOrderIntegrator#integrate} method.</p> 030 * 031 * <p>A first order differential equations problem, as seen by an 032 * integrator is the time derivative <code>dY/dt</code> of a state 033 * vector <code>Y</code>, both being one dimensional arrays. From the 034 * integrator point of view, this derivative depends only on the 035 * current time <code>t</code> and on the state vector 036 * <code>Y</code>.</p> 037 * 038 * <p>For real problems, the derivative depends also on parameters 039 * that do not belong to the state vector (dynamical model constants 040 * for example). These constants are completely outside of the scope 041 * of this interface, the classes that implement it are allowed to 042 * handle them as they want.</p> 043 * 044 * @see FirstOrderIntegrator 045 * @see FirstOrderConverter 046 * @see SecondOrderDifferentialEquations 047 * 048 * @since 1.2 049 */ 050 051public interface FirstOrderDifferentialEquations { 052 053 /** Get the dimension of the problem. 054 * @return dimension of the problem 055 */ 056 int getDimension(); 057 058 /** Get the current time derivative of the state vector. 059 * @param t current value of the independent <I>time</I> variable 060 * @param y array containing the current value of the state vector 061 * @param yDot placeholder array where to put the time derivative of the state vector 062 * @exception MaxCountExceededException if the number of functions evaluations is exceeded 063 * @exception DimensionMismatchException if arrays dimensions do not match equations settings 064 */ 065 void computeDerivatives(double t, double[] y, double[] yDot) 066 throws MaxCountExceededException, DimensionMismatchException; 067 068}