TL;DR
Train acceleration, speed, and top speed are not functions of properties, but more just set numbers.What?
AFAIK, train speeds are just a basic calculation of the weight of the full train, the air resistance based on the first entity, and the fuel value. My suggestion is that actual physics calculations are used, allowing for more realistic top speeds and acceleration. Train speed is currently a function of air resistance (a set number), weight (a set number), and acceleration (a set number). I recommend that it is a function of air resistance (a function of speed), weight, acceleration, and rolling friction. Air resistance is currently a number, instead of a function of speed. It also doesn't take into account the mass of the train (inertia). Therefore, the top speed of a train is not based on the balancing of acceleration and the counteracting forces, air resistance and friction. This could also interact with new gravity properties of SA, where on higher gravity planets trains are slower. Also, higher air pressures would mean more air resistance for trains, also making them slower.Why?
I believe that the main plus for this change would be I think this would integrate very well with the improvements and additions introduced by SA. This would also give the opporotunity (with some modded integration) for train wagons to have variable weights based on the held items/fluids. Further implementation would allow for friction reduction research, as well as better aerodynamics for locomotives or special aerodynamic railcars for the front of locomotives. There could also be modules/equipment inserted into trains for other improvements.Cons?
There is always a computational cost when adding features. The per-update speed calculation would be slightly inflated, due to the inclusion of rolling friction and the added calculation for air resistance. Air resistance would need to be a per-update calculation, but rolling friction could be either depending on implementation. Acceleration, trian weight, friction coefficient, and some air resistance values could be calculated when the train leaves a station, therefore only updating once per route. I've detailed below some of the required calculations.Calculations
- Acceleration: Constant, based on fuel used. Certain locomotives could have specific fuel efficiency.
NOTE: Could be a function of speed where higher speeds are more fuel efficient. Would need to be updated regularly.
- Weight: Constant (based on train weight) or variable (based on train weight and contents)
NOTE: Would need to be recalculated per-update if locomotive fuel is considered to add to weight
- Friction: A function of mass. The following formula details the natural calculation of this force.
C sub rr is the rolling resistance coefficient. This would be a small value between 0 and 1. For reference, rolling resistance for railroad wheels on steel tracks is between 0.0003 and 0.0020. This would need to be guessed, estimated, or playtested.
N is the normal force, which can be calculated by the following equation. This would calculate the normal force based on the mass, gravitational constant, and the angle of attack. In most cases, cosine(theta) would return 1 due to running on a flat surface, but otherwise could be implemented if elevated track transitions were taken into account.
- Air resistance: A function of speed. The following formula details the natural calculation of this force.
Rho is the density of the fluid/gas, which in this case would be the density of the atmosphere on the planet/body. This would need a special calculation/variable unless you want to include the chemical makeup and mass ratio of the surrounding atmosphere. For reference, the density of air at sea level and 15C is 1.225 kg m/s^2.
v is the velocity relative to the gas, which in this case would just be the speed of the train.
C sub D is the drag coefficient. This is a value that changes based on the 3 dimensional shape of the object. In this case, only the first entity would need to be referenced. The more streamlined the object, the smaller the value. A good bulk of guessing will happen here. For reference, a sphere has a drag coefficient of 0.47 while a cube has a coefficient of 1.05, and a steamlined body has a coefficient of 0.04.
A is the surface area of the object perpendicular to the direction of travel. In this case, it would be the surface area of the front of the first entity.
- Velocity/Speed: A function of all forces. The change in velocity, deltaV, would be the sum of all forces (air resistance, acceleration/braking, and friction) times the time, which for 60 UPS would be 1/60th of a second. That value would then be added to the current speed of the train.

