Algorithms for modeling and optimization of discretized differential algebraic equations with application to chemical looping combustion