  We examine the star formation histories (SFHs) of galaxies in smoothed
particle hydrodynamics (SPH) simulations, compare them to parametric models
that are commonly used in fitting observed galaxy spectral energy
distributions, and examine the efficacy of these parametric models as practical
tools for recovering the physical parameters of galaxies. The commonly used
tau-model, with SFR ~ exp(-t/tau), provides a poor match to the SFH of our SPH
galaxies, with a mismatch between early and late star formation that leads to
systematic errors in predicting colours and stellar mass-to-light ratios. A
one-parameter lin-exp model, with SFR ~ t*exp(-t/tau), is much more successful
on average, but it fails to match the late-time behavior of the bluest, most
actively star-forming galaxies and the passive, "red and dead" galaxies. We
introduce a 4-parameter model, which transitions from lin-exp to a linear ramp
after a transition time, which describes our simulated galaxies very well. We
test the ability of these parametrised models to recover (at z=0, 0.5, and 1)
the stellar mass-to-light ratios, specific star formation rates, and stellar
population ages from the galaxy colours, computed from the full SPH star
formation histories using the FSPS code of Conroy et al. (2009). Fits with
tau-models systematically overestimate M/L by ~ 0.2 dex, overestimate
population ages by ~ 1-2 Gyr, and underestimate sSFR by ~ 0.05 dex. Fits with
lin-exp are less biased on average, but the 4-parameter model yields the best
results for the full range of galaxies. Marginalizing over the free parameters
of the 4-parameter model leads to slightly larger statistical errors than
1-parameter fits but essentially removes all systematic biases, so this is our
recommended procedure for fitting real galaxies.
