Bar formation in simulations of interacting galaxies