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.nonstiff;
019
020
021/**
022 * This class implements a simple Euler integrator for Ordinary
023 * Differential Equations.
024 *
025 * <p>The Euler algorithm is the simplest one that can be used to
026 * integrate ordinary differential equations. It is a simple inversion
027 * of the forward difference expression :
028 * <code>f'=(f(t+h)-f(t))/h</code> which leads to
029 * <code>f(t+h)=f(t)+hf'</code>. The interpolation scheme used for
030 * dense output is the linear scheme already used for integration.</p>
031 *
032 * <p>This algorithm looks cheap because it needs only one function
033 * evaluation per step. However, as it uses linear estimates, it needs
034 * very small steps to achieve high accuracy, and small steps lead to
035 * numerical errors and instabilities.</p>
036 *
037 * <p>This algorithm is almost never used and has been included in
038 * this package only as a comparison reference for more useful
039 * integrators.</p>
040 *
041 * @see MidpointIntegrator
042 * @see ClassicalRungeKuttaIntegrator
043 * @see GillIntegrator
044 * @see ThreeEighthesIntegrator
045 * @see LutherIntegrator
046 * @version $Id: EulerIntegrator.java 1588755 2014-04-20 13:30:16Z luc $
047 * @since 1.2
048 */
049
050public class EulerIntegrator extends RungeKuttaIntegrator {
051
052  /** Time steps Butcher array. */
053  private static final double[] STATIC_C = {
054  };
055
056  /** Internal weights Butcher array. */
057  private static final double[][] STATIC_A = {
058  };
059
060  /** Propagation weights Butcher array. */
061  private static final double[] STATIC_B = {
062    1.0
063  };
064
065  /** Simple constructor.
066   * Build an Euler integrator with the given step.
067   * @param step integration step
068   */
069  public EulerIntegrator(final double step) {
070    super("Euler", STATIC_C, STATIC_A, STATIC_B, new EulerStepInterpolator(), step);
071  }
072
073}