  Galaxy spectral energy distribution (SED) modelling is a powerful tool, but
constraining how well it is able to infer the true values for galaxy properties
(e.g. the star formation rate, SFR) is difficult because independent
determinations are often not available. However, galaxy simulations can provide
a means of testing SED modelling techniques. Here, we present a numerical
experiment in which we apply the SED modelling code MAGPHYS to ultraviolet
(UV)--millimetre (mm) synthetic photometry generated from hydrodynamical
simulations of an isolated disc galaxy and a major galaxy merger by performing
three-dimensional dust radiative transfer. We compare the properties inferred
from the SED modelling with the true values and find that MAGPHYS recovers most
physical parameters of the simulated galaxies well. In particular, it recovers
consistent parameters irrespective of the viewing angle, with smoothly varying
results for neighbouring time steps of the simulation, even though each viewing
angle and time step is modelled independently. The notable exception to this
rule occurs when we use an SMC-type intrinsic dust extinction curve in the
radiative transfer calculations. In this case, the two-component dust model
used by MAGPHYS is unable to effectively correct for the attenuation of the
simulated galaxies, which leads to potentially significant errors (although we
obtain only marginally acceptable fits in this case). Overall, our results give
confidence in the ability of SED modelling to infer physical properties of
galaxies, albeit with some caveats.
