  Coherent synchrotron radiation (CSR) occurs when short bunches travel on
strongly bent trajectories. Its effects on high-quality beams can be severe and
are well understood qualitatively. For quantitative results, however, one has
to rely on numerical methods. There exist several simulation codes utilizing
different approaches. We describe in some detail the code TraFiC4 developed at
DESY for design and analysis purposes, which approaches the problem from first
principles and solves the equations of motion either perturbatively or
self-consistently. We present some calculational results and comparison with
experimental data. Also, we give examples of how the code can be used to design
beamlines with minimal emittance growth due to CSR.
