Basically, the pressure inside the cylinder creates force on the piston which pushes the piston against load and inertia. Using the second law of Newton you can calculate the acceleration, speed and displacement. The problem is to calculate the pressure changes with time inside the cylinder. This is quite complicated because you have to solve the mass flow rate into the cylinder, the resulting pressure change, the volume change (due to the piston movement), gas temerature change, etc.
The only way is to create a set of differential equation which are non-linear and solve them numerically.
I've already seen a kind of formula taking in acount the length of the tube, the rate flow, the bore diameter of the cylinder and other things... but can't put my hands on it.
That's why I posted here to see if someone knows about it.