Finding Optimal Value of State and Lagrangian Multiplier