Corrected the MathematicalModel again and attempted to implement the optimize function in the front-end.