Modeling acoustic emission by a statistical energy-balance algorithm