Linearising discrete time hybrid systems