Hamilton-Jacobi-Bellman Equation for Control Systems with Friction