Dynamics of magma ascent and fragmentation in trachytic versus rhyolitic eruptions