use setSolver function instead of manually set the solver in NonlinearProgram