Modelling harmonic and subharmonic generation using an interaction-box formalism