Modelling and Simulation of External Gear Pumps and Motors