The article is devoted to the development of an adaptive algorithm for the synthesis of the emergency control law in order to ensure dynamic stability and its testing on a multi-machine model of the IEEE 39 test power system. The developed algorithm is aimed at ensuring the dynamic stability of a particular power plant. In the presented study, the emergency control law synthesis is understood as the choice of the minimum position of the steam turbine shut-off valve based on the area rule in "Synchronous generator moment - load angle" space and synchronized vector measurements. The adaptability of the algorithm is ensured by using a minimum number of a priori power system elements specified parameters and the emergency control law synthesis alongside the initial phase of the post-emergency transient process. In case of dynamic stability ensuring impossibility, the synchronous generator is disconnected from the electrical network. To apply the proposed algorithm in a multi-machine power system, a polynomial approximating the angular characteristic of a synchronous generator of a post-emergency mode was modified by adding a sinusoidal term of the load double angle. The IEEE 39 test model used in this study contained 39 nodes, 10 synchronous generators with automatic strong-acting excitation regulators, system stabilizers, single-shaft steam turbines as primary drives and fast turbine valving control models. The proposed method has been tested and evaluated for 20 different emergency processes including self-clearing short circuits in test model various nodes. Simulation was carried out using Matlab/Simulink environment with a constant numerical differentiation step magnitude that was equal to the initial data sampling frequency of 30 kHz.