using System; using System.Collections.Generic; using System.Text; using RungeKutta.Integrators; namespace RungeKutta.SimStep { /// /// Exactly the same thing as Verlet, except it takes a smaller window to sample velocity /// class VerletTweak : SimStepper { public State Integrate(State oldState, float timeStep, ODEs.ODE ode) { return Integrate(oldState, timeStep, ode.EvaluateForceAtState(oldState)); } public State Integrate(State oldState, float timeStep, float acceleration) { oldState = new Verlet().Integrate(oldState, timeStep, acceleration); oldState.velocity = Derivator.MeanValueTheoremStep.Derivate(oldState.prevPos, -timeStep, oldState.position, 0); return oldState; } public int ForceEvaluations { get { return 1; } } public override string ToString() { return "Verlet Tweak"; } } }