Stability and optimal control of polytopic time-inhomogeneous Markov jump linear system