The gas force in a cylinder of a combustion engine is computed as function of the relative distance of the two flanges. It is required that s_rel = flange_b.s - flange_a.s is in the range
0 ≤ s_rel ≤ L,
where the parameter L is the length of the cylinder. If this assumption is not fulfilled, an error occurs. The resulting approximation of the gas pressure is shown in the following figure and depends on both s_rel and the relative velocity v_rel = der(s_rel).