Train System Modeling

For simplicity, we will consider a toy train consisting of an engine and a wagon with mass $M1$ and $M2$ respectively. They are held together by a spring (see the picture) with stiffness coefficient of $k$. $F$ represents the force applied by the engine, and $μ$ represents the coefficient of rolling friction. Our aim is to obtain the precise information on its velocity and position under different values of the parameters such as its mass, input force, spring stiffness coefficient, and friction. Continue...

..