Using the well-known analogy between the space and time domains we derive a
temporal master equation (ME) operator which can be applied to any cavity
containing dispersive and filtering elements, phase or amplitude modulators
, and one nonlinear element. The cavity properties are described in terms o
f 2 x 2 'KIJL' matrices. We show that this ME correctly reproduces the cavi
ty mode structure in the linear limit. Numerical simulation of an actively
mode-locked Fabry-Perot laser with the nonlinear medium at an end mirror gi
ves results in excellent agreement with those found using the more conventi
onal Huygens' integral method. Using a simple perturbation approach based o
n the nonlinear Schrodinger equation (NLS) we also show that the field in t
his laser is soliton-like, and give analytic expressions for the soliton pa
rameters.