using System;
using System.Collections.Generic;
using System.Text;
namespace RungeKutta.ODEs
{
///
/// Damped spring with equation in form y'' = a - b y' - c y
///
class DampedSpring : ODE
{
///
/// Constant force
///
public float A { get; set; }
///
/// Drag coefficient
///
public float B { get; set; }
///
/// Spring coefficient
///
public float C { get; set; }
public float EvaluateForceAtState(State state)
{
return A - state.velocity * B - state.position * C;
}
}
}