A Fast, Highly Accurate Means of Modeling Transient Flow in Gas Pipeline Systems by Variational Methods