Non-linear least squares refinement with constraints. Evaluation through curve fitting on emulated XPS-like spectra and application to the analysis of carbon fibres