function calcImpulse