A numerical model for the analysis of unsteady train braking and releasing manoeuvres