Modelling the movements of a counterweight trebuchet while firing