Text this: Piecewise methods and applications to power systems