This paper introduces a new method to study track dynamics and locomotive dynamics as well as track-locomotive interactions. The method uses a two-way co-simulation technique to link a detailed track model that is developed using an in-house software package and a detailed locomotive model that is developed using a commercial software package. The track model has considered the rails, fasteners, sleepers, ballast, subballast, and subgrade. The locomotive model has considered the carbody, bogie frames, wheelsets, traction motors and gear boxes. A detailed wheel-rail contact model with up to three simultaneous contact points for every wheel on each rail is used. In the two-way co-simulation technique, wheel-rail contact forces that are simulated in the commercial software package are sent to the track model and attached to their corresponding positions on the rails. With these attached wheel-rail contact forces, the track model can determine the positions and postures of the rail which are then sent to the commercial software package. The rail profiles in the commercial software package are updated according to the rail positions and rail postures. Compared with conventional methods, this method has the advantages of being able to use both detailed track models and detailed locomotive models. The feasibility of the method has been demonstrated by using two simulations to model a locomotive negotiating a section of track with and without an unsupported sleeper.