The Yakubovich quadratic criterion, F-stability and multi-agent consensus