I am writing a MATLAB script that generates a dynamic simulation of a piston being driven by compressed air. My starting values for pressure and volume are as follows: P0 = 14000000; %nm-2 or 140 Bar V0 = 0.005; %m3 or 500cc The simulation needs to be quite detailed and must take into account the following factors: 1. Force required to open the valve (assume hammer type) 2. Duration valve will remain open 3. Flow rate from valve and change over time 4. Expansion into transfer port over time 5. Force imparted to piston 6. Account for inertia and friction to move piston 7. Expansion into cylinder over time 8. Velocity, mass and force of air over time I am looking for the necessary formulas to achieve the above goals.