Linear and nonlinear perturbations in dark energy models