test velocity function