calcualted W,gradW and gradV