ComplexOrdinaryDifferentialEquation.java

  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. import org.hipparchus.complex.Complex;

  19. /** This interface represents a first order differential equations set for {@link Complex complex state}.
  20.  *
  21.  * @see OrdinaryDifferentialEquation
  22.  * @see ComplexODEConverter
  23.  * @since 1.4
  24.  *
  25.  */
  26. public interface ComplexOrdinaryDifferentialEquation {

  27.     /** Get the dimension of the problem.
  28.      * @return dimension of the problem
  29.      */
  30.     int getDimension();

  31.     /** Initialize equations at the start of an ODE integration.
  32.      * <p>
  33.      * This method is called once at the start of the integration. It
  34.      * may be used by the equations to initialize some internal data
  35.      * if needed.
  36.      * </p>
  37.      * <p>
  38.      * The default implementation does nothing.
  39.      * </p>
  40.      * @param t0 value of the independent <I>time</I> variable at integration start
  41.      * @param y0 array containing the value of the state vector at integration start
  42.      * @param finalTime target time for the integration
  43.      */
  44.     default void init(double t0, Complex[] y0, double finalTime) {
  45.         // do nothing by default
  46.     }

  47.     /** Get the current time derivative of the state vector.
  48.      * @param t current value of the independent <I>time</I> variable
  49.      * @param y array containing the current value of the state vector
  50.      * @return time derivative of the state vector
  51.      */
  52.     Complex[] computeDerivatives(double t, Complex[] y);

  53. }