An implicit function formulation for optimization of discretized index-1 differential algebraic systems. (December 2022)