View Javadoc
1   /*
2    * Licensed to the Hipparchus project under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The Hipparchus project licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.hipparchus.ode;
18  
19  import java.util.Collections;
20  import java.util.List;
21  
22  import org.hipparchus.exception.MathIllegalArgumentException;
23  import org.hipparchus.exception.MathIllegalStateException;
24  
25  /** Interface expanding {@link OrdinaryDifferentialEquation first order
26   *  differential equations} in order to compute exactly the Jacobian
27   *  matrices for {@link VariationalEquation partial derivatives equations}.
28   */
29  public interface ODEJacobiansProvider
30      extends OrdinaryDifferentialEquation, NamedParameterJacobianProvider {
31  
32      /** Compute the Jacobian matrix of ODE with respect to state.
33       * @param t current value of the independent <I>time</I> variable
34       * @param y array containing the current value of the main state vector
35       * @param yDot array containing the current value of the time derivative of the main state vector
36       * @return Jacobian matrix of the ODE w.r.t. the main state vector
37       * @exception MathIllegalStateException if the number of functions evaluations is exceeded
38       * @exception MathIllegalArgumentException if arrays dimensions do not match equations settings
39       */
40      double[][] computeMainStateJacobian(double t, double[] y, double[] yDot)
41          throws MathIllegalArgumentException, MathIllegalStateException;
42  
43      /** {@inheritDoc}
44       * <p>
45       * The default implementation has no parameters at all.
46       * </p>
47       */
48      @Override
49      default List<String> getParametersNames() {
50          return Collections.emptyList();
51      }
52  
53      /** {@inheritDoc}
54       * <p>
55       * The default implementation supports no parameters at all.
56       * </p>
57       */
58      @Override
59      default boolean isSupported(String name) {
60          return false;
61      }
62  
63      /** {@inheritDoc}
64       * <p>
65       * The default implementation supports no parameters at all.
66       * </p>
67       */
68      @Override
69      default double[] computeParameterJacobian(double t, double[] y, double[] yDot,
70                                                String paramName)
71          throws MathIllegalArgumentException {
72          throw new MathIllegalArgumentException(LocalizedODEFormats.UNKNOWN_PARAMETER,
73                                                 paramName);
74      }
75  
76  }