In 1904 Baldwin published a series of tables for the estimation of locomotive horsepower using the following formula;
HP = (cylinder diameter^2 * stroke * Mean Eff Pressure factor * Speed mph) / (driver diameter * 375)
Baldwin developed a table for the mean effective cylinder pressure based on driver revolutions per min. The higher the driver RPM the lower the pressure in the cylinders. Note that the formula does not work for superheated locomotives. The formula will underestimate the HP generated by a superheated locomotive The Baldwin table also assumes that the steaming capacity of the boiler is able to fully utilize the cylinder capacity.
The attached file illustrates how the HP changes with road speed for several classes of NG locomotives using the Baldwin table for pressure losses through the throttle, dry pipe, valves and cylinders. I did not include calculations for the superheated K-27, K-28, K-36 or K-37 classes of engine.
Locomotive HP.pdf