This functions is used internally by essR to evaluate the objective function when solnp is invoked as local solver
For internal use of MEIGOR.