Piecewise-quadratic Lyapunov functions for systems with deadzones or saturations