Numerical solutions of linear and nonlinear singular perturbation problems