Model of thermo-optic nonlinear dynamics of photonic crystal cavities