ODESolver


package ode1d;

/**
 * solves a given 1d ODE by giving the "next" value for x <br>
 * generic version
 */
abstract public class ODESolver {

  /** ODE to be solved */
  protected ODE ode;

  /** current time value */
  public double t;

  /** current position value */
  public double x;

  /** sets ode and initial values */
  public ODESolver(ODE ode) {
    this.ode = ode;
    t = ode.t0;
    x = ode.x0;
  }

  /** computes x(t+dt)<br>
   * updates x, t accordingly
   */
  public abstract void nextStep(double dt);
}

previous    contents     next

Peter Junglas 20.12.1999