Star formation in a filamentary infrared dark cloud ( IRDC ) is simulated over a dynamic range of 4.2 pc to 28 au for a period of 3.5 \times 10 ^ { 5 } yr , including magnetic fields and both radiative and outflow feedback from the protostars . At the end of the simulation , the star formation efficiency is 4.3 per cent and the star formation rate per free fall time is \epsilon _ { ff } \simeq 0.04 , within the range of observed values \citep kru12a . The total stellar mass increases as \sim t ^ { 2 } , whereas the number of protostars increases as \sim t ^ { 1.5 } . We find that the density profile around most of the simulated protostars is \sim \rho \propto r ^ { -1.5 } , as predicted by \citet mur15 . At the end of the simulation , the protostellar mass function approaches the \citet chab05 stellar initial mass function . We infer that the time to form a star of median mass 0.2 M _ { \odot } is about 1.4 \times 10 ^ { 5 } yr from the median mass accretion rate . We find good agreement among the protostellar luminosities observed in the large sample of \citet dun13 , our simulation , and a theoretical estimate , and conclude that the classical protostellar luminosity problem \citep ken90 is resolved . The multiplicity of the stellar systems in the simulation agrees to within a factor 2 of observations of Class I young stellar objects ; most of the simulated multiple systems are unbound . Bipolar protostellar outflows are launched using a sub-grid model , and extend up to 1 pc from their host star . The mass-velocity relation of the simulated outflows is consistent with both observation and theory .