implement trust-region method for non-linear solver
The code in solve1.m to deal with the case where the Jacobian is near singular is unsatisfactory. We need to implement a trust region method as discussed in Nocedal and Wright (2006. This could also be done for the non-linear solver of bytecode