Modelling the dynamics of ultrashort mid-IR laser pulses in optical systems with CO2 amplifiers