Modelling nonlinear optics phenomena using delay differential equations