Mathematical models of a pneumatic system consisting of a tube closed on one side and open on the other side are under consideration. The tube has the piston that limits a certain volume of compressed gas. To find the parameters of the piston motion under pressure of the expanding gas, the mathematical model of the system is constructed in several ways: using ordinary differential equations and using partial differential equations (the equations of gas dynamics). In addition, the corresponding boundary conditions are determined. All the equations that make up the mathematical model are reduced to a dimensionless form. To perform calculations, methods of finite differences and characteristics are used. Calculations are carried out until the piston reaches the open end of the pipe or until the piston begins to slow down. Then, the results obtained with the help of the methods under consideration are compared according to the criteria of speed and accuracy. Recommendations are given on the appropriateness of using each method of constructing a mathematical model.