Text this: The singular optimal control of switched systems