Numerical solution of nonlinear equations in chemical speciation calculations