How would I calculate the torque needed from a motor to turn a flywheel which is connected to a piston via a rod? I know the force that the piston needs to produce, and can determine the mass of the piston, rod, wheel, etc.
Suggestion: The electromechanical dynamic model of the rotating parts needs to be created. Suitable software can be found useful. Reference:
Schaum's Outline Series that includes Mechanics.