In this article, the mathematical modeling of a high pressure regulator with its safety valve is presented. In the first step, the performance of regulator and safety valve are investigated, separately. After that, the safety valve is connected to the output port of air regulator and the output pressure's variation is investigated. For analyzing of air regulator and safety valve's operation, the equation of motion of internal parts, continuity equations for chamber and the equations related to mass flow rate which passing from diverse ducts in regulator are derived, respectively. The motion's equation consists of inertia, controlling spring force, pressurized air force and coulombs friction terms. Because of nonlinearity and coupling, these equations are solved by using numerical methods and the results are presented. Finally, the results obtained in steady state are validated by testing.