# Train Physics Simulation

It's my first time asking here so bear with me.

I'm a computer scientist, and I'm working on a train simulator project. I'm having quite a difficult time understanding all the physics and formulas behind the behavior of a train, and knowing that I'm not that good with physics, I decided to start with the basic stuff: for the meantime I implemented just the necessary forces to get the train's acceleration depending on Newton's second law (Rolling Resistance, Curve Resistance, Gradient Resistance), and with the traction force.

I just need to calculate : F_trac - Sum(F_rolling + F_curve + F_grad ), and divide everything by the train's weight to get the acceleration.

So my questions are:

• Am I on a good track for the meantime? I should just elaborate, this is a simple simulator and not a very complicated one.

• Is there anything I should add / know in relation with a train's behavior to simulate its movement?

Thank you kindly.

• Isn't Sum(A+B) superfluous? Either state A+B, or Sum(A,B). – ja72 May 17 at 21:40
• Is this a 2D simulation (top down, side scrolling) or full 3D? – ja72 May 17 at 21:44

(1) divide by mass, not weight.

(2) It's hard to answer a question like "am I on the right track?" (Pun intended?).

What part of the equations, or procedure, would you like checked? The forces, the use of Newton's laws?

I can relate a little to this as I've written code to flight simulations. There are generally two basic categories of questions one wants to answer. (1) Given the forces acting on the objects what is its trajectory? and (2) Given a trajectory what are the forces acting on the object?

There is a significant difference but both use Newton's laws. In the first case we invest a lot of effort analyzing the airfoil to get the correct lift, we model drag which can be very difficult, gravity etc. This makes sense for a missile or other object that does not have a pilot or some control mechanisms. The second case is usually appropriate for air planes with a pilot. Here you have control over the trajectory (within the laws of physics) and you are interested in what type of stress the aircraft feels under certain actions or activities. For example assuming a 2g turn what forces will the wing experience and will this cause damage. Etc.

As I read your simulation approach I wonder what your end game it. Are you trying to see under what conditions a train will derail? Or simply estimate the power consumption required to keep it at constant speed along the track.

I don't mean to be condescending with this comment/question but be sure everything is done with 3-dim vectors. I would think that there is a chance of having some vertical oscillations due to height deviations in the track/terrain. To get a realistic model of the this you would want a train model in terms of its pieces, not just a mass load, but N-cars connected by links, spring loads on each car. I have no idea if such things exist on trains (like shock absorbers). In the flight dynamics case we are sometimes interested in buffeting due to turbulence, which can be brought on by the flight itself. In this case the conditions for our aero-force model change and this can lead to instability. Are you interested in such things? Typically if you are you will need to write the code to check for such conditions and decide what action to take since your model will cease to be valid. Do you just stop and exit? Do you try to determine how the state changes and continue to propagate the state using a different set of equations and conditions? That is up to you.

So, the short answer to your question is yes, in principle you are on the right track. But there is a lot more detail to consider and it would help if you add a description of what your endgame is.