def MotorAmpP2P(RPM=1200, CF=None, W=139, Wu=20, e=4):
    """Calculates the motor amplitude Peak to Peak
    RPM = Rotations Per Minute
    CF = Centifugal Force (lbs)
    k= spring constant (lbs/in)
    W = weight on springs (lbs)
    Wu=unbalanced weigth (lbs)
    e=eccentric distance from ctr mass to ctr rotation (inches)
    
    example:
    MotorAmpP2P(RPM=1200,CF=1621,W=139)#out=0.570 
    MotorAmpP2P(W=139,Wu=19.8125,e=4)#out=.570
    
    Derivation using Centrifugal Force
    this comes from standard spring-mass damper formula
    X=(F0/k)*(1/sqrt((1-r**2)**2+(2*gamma*r)*2))
    r=radial freq / natural freq
    F0=centrifugal force, k=spring const,gamma=damping ratio
    assuming negligible damping, gamma=0, X simplifies to
    X=(F0/k)*(1/abs(1-W*(pi*RPM)**2/(g*k*900)))
    for high RPM, the W*(pi*RPM)**2/(g*k*900) term is much larger than 1.
    therefore we can simplify further:
    X=(F0*g*900)/(W*(RPM*pi)**2)
    
    Derivation using eccentrics/weight plates
    start with equation where gamma=0 (no damping)
    X=(F0/k)*(1/abs(1-W*(pi*RPM)**2/(g*k*900)))
    F0=Wu*e*(pi*RPM)**2/(g*900)
    combining and simplifying we get:
    X=Wu*e/W
    
    """
    from math import pi
    if not CF:
        P2P = Wu * e / W
        return P2P
    P2P = 2 * CF * 900 * 386.04 / (W * (pi * RPM) ** 2)
    return P2P
