  An accurate modeling of a Josephson junction that is embedded in an arbitrary
environment is of crucial importance for qubit design. We present a formalism
to obtain a Lindblad master equation that describes the evolution of the
system. As the qubit degrees of freedom oscillate with a well-defined frequency
$\omega_q$, the environment only has to be modeled close to this frequency.
Different from alternative approaches, we show that this goal can be achieved
by modeling the environment with only few degrees of freedom. We treat the
example of a transmon qubit coupled to a stripline resonator. We derive the
parameters of a dissipative single-mode Jaynes-Cummings model starting from
first principles. We show that the leading contribution of the off-resonant
modes is a correlated decay process involving both the qubit and the resonator
mode. In particular, our results show that the effect of the off-resonant modes
in the multi-mode Jaynes-Cummings model is perturbative in $1/ \omega_q$.
