Modelling and simulation of an electromagnetic fuel injector