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  
18  package org.hipparchus.ode;
19  
20  import org.hipparchus.complex.Complex;
21  
22  /** This interface represents a first order differential equations set for {@link Complex complex state}.
23   *
24   * @see OrdinaryDifferentialEquation
25   * @see ComplexODEConverter
26   * @since 1.4
27   *
28   */
29  public interface ComplexOrdinaryDifferentialEquation {
30  
31      /** Get the dimension of the problem.
32       * @return dimension of the problem
33       */
34      int getDimension();
35  
36      /** Initialize equations at the start of an ODE integration.
37       * <p>
38       * This method is called once at the start of the integration. It
39       * may be used by the equations to initialize some internal data
40       * if needed.
41       * </p>
42       * <p>
43       * The default implementation does nothing.
44       * </p>
45       * @param t0 value of the independent <I>time</I> variable at integration start
46       * @param y0 array containing the value of the state vector at integration start
47       * @param finalTime target time for the integration
48       */
49      default void init(double t0, Complex[] y0, double finalTime) {
50          // do nothing by default
51      }
52  
53      /** Get the current time derivative of the state vector.
54       * @param t current value of the independent <I>time</I> variable
55       * @param y array containing the current value of the state vector
56       * @return time derivative of the state vector
57       */
58      Complex[] computeDerivatives(double t, Complex[] y);
59  
60  }