State Discontinuity Analysis of Linear Switched Systems via Energy Function Optimization