Implemented nonlinear formulation.