net.java.dev.joode.stepper
Class MidPointMethodStepper

java.lang.Object
  extended by net.java.dev.joode.stepper.MidPointMethodStepper
All Implemented Interfaces:
StepperFunction

public class MidPointMethodStepper
extends java.lang.Object
implements StepperFunction

Performs stepping using the mid point method. This requires two numerical evaluations, but is more accurate. Eulers method:- x(t+h) = x(t) + h*x'() where x'=f(x(t)) i.e. our kinimatic equations Midpoint method:- x(t+h) = x(t) + h*(f(x(t) + 0.5hf(x(t)))) So to compute this we need to first compute f(x(t)), like Euler. But not multiply it by h, instead h/2 (the midpoint)

Author:
Tom Larkworthy

Field Summary
static MidPointMethodStepper INSTANCE
           
static Joint.Info2 Jinfo
           
static boolean REPORT_ERROR
           
 
Fields inherited from interface net.java.dev.joode.stepper.StepperFunction
EULER, RK4
 
Method Summary
 void step(World world, Body[] body, int nb, Joint[] joint, int nj, float stepsize)
          steps the ISLAND of bodies one step using the mid point method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPORT_ERROR

public static final boolean REPORT_ERROR
See Also:
Constant Field Values

INSTANCE

public static final MidPointMethodStepper INSTANCE

Jinfo

public static final Joint.Info2 Jinfo
Method Detail

step

public void step(World world,
                 Body[] body,
                 int nb,
                 Joint[] joint,
                 int nj,
                 float stepsize)
steps the ISLAND of bodies one step using the mid point method

Specified by:
step in interface StepperFunction