A kind of Matlab-ATP integrated automation call method
Technical field
The present invention relates to a kind of Matlab-ATP integrated automation call method.
Background technology
In relay protection of power system, after fault, electric parameters is subject to the many factors such as fault type, abort situation, fault initial angle, transition resistance value, power system operating mode.For the checking of the design of protection philosophy and verification, range measurement principle, and the Digital Simulation verification of the device such as protective device, distance measuring equipment, wave recording device, all need various failure conditions and the lower Temporal Data of method of operation combination, and data processing accordingly.Calculating and verification comprehensively and effectively needs thousands of emulation, if the setting of each emulation, startup all need manual intervention, need to expend a large amount of time and manpower, and can not ensure zero error rate, the automatic simulation therefore changing for realistic model multiparameter at present has eager demand.
Authority's electromagnetic transient simulation software EMTP possesses more complete mathematical model and high simulation accuracy, but its range of application is subject to its commerciality restriction all the time.ATP is the most widely used light version of EMTP, and owing to having hidden interior details, user need complete artificial tasks one time successively by modeling-setting-operation, does not possess the ability that automatically performs of magnanimity emulation.
In traditional method, each simulation process all needs artificial participation, when emulation enormous amount, and complex operation, time, manpower expend huge, and efficiency and operation accuracy rate are lower.
Summary of the invention
The present invention is in order to address the above problem, a kind of Matlab-ATP integrated automation call method has been proposed, the operating mechanism of the method based on Matlab and ATP, with complete patterned user's mode of operation, multiple failure condition can be set, travel through emulation fault model taking ATP as instrument robotization, its simulation result can centralization processing, realizes the combination of emulation robotization and data processing high efficiency.
To achieve these goals, the present invention adopts following technical scheme:
A kind of Matlab-ATP integrated automation call method, comprises the following steps:
(1) in ATPDraw software interface, carry out conventional graphical modeling, set up realistic model to be studied, and generate corresponding * .atp file;
(2) under the work path of Matlab from ATP installation directory, derive the * .atp file for the treatment of realistic model, this file is imported under the atpmingw path of ATP installation directory;
(3) Matlab receives the variation range of each fault parameter of inputting in gui interface, becomes multilayer circulation nested the change process of multiple parameters;
(4) in innermost loop, Matlab switches current path to the atpmingw path under ATP installation directory, in * .atp file corresponding to realistic model, in written document mode, the new value of each fault parameter is write to each self-corresponding position, preserve simulation result with * .mat file;
(5) Matlab reads failure message corresponding to end-around carry now, and is integrated into character string; * .mat file is imported in its work space Workspace, with this character string to the rename of * .mat file;
(6) Matlab completes the emulation of all failure scenarios under each fault parameter variation combination by nested circulation.
In described step (3), the variation of every layer of nested corresponding parameter, variation range is to initial value, final value that should setting parameter, and circulation step-length is to step-length that should setting parameter; To nested not requirement of inside and outside order;
The concrete grammar of described step (4) is: innermost loop, Matlab switches current path to the atpmingw path under ATP installation directory, in * .atp file corresponding to realistic model, in written document mode, the new value of each fault parameter is write to each self-corresponding position; Matlab calls executable program Tpbig.exe, carries out the emulation to amended * .atp file, and after emulation finishes, Matlab calls executable program Pl42mat.exe, and the * .pl4 file that emulation is generated is converted into the * .mat file of the same name with * .atp file.
In described step (5), its concrete grammar is: Matlab reads failure message corresponding to end-around carry now, and is integrated into character string; * .mat file is imported in its work space Workspace, and with this character string, to the rename of * .mat file, Matlab receives the data storage location of the setting in gui interface, and the * .mat file after rename is imported to this position.
The concrete grammar of described step (6) is: for whole nested circulation corresponding to all parameters, circulate and successively enter interior loop by skin, after interior loop stops, then carry out outer, entered in interior loop by skin circulation again, in the time that outermost loop is complete, all emulation completes.
Beneficial effect of the present invention is: can make Matlab organically blend in the authority aspect power system transient simulation in the advantage aspect programming, computing, data processing, graphics process and ATP, and then can utilize the complete mathematical model of ATP to carry out flexibly, efficiently electric system simulation calculating, study multiple parameter and change the impact on system, with emulation degree of accuracy of other simulation softwares of accuracy verification of ATP etc.; Possess higher using value and open application prospect.
Brief description of the drawings
Fig. 1 is traditional method flow schematic diagram that utilizes ATP emulation;
Fig. 2 is the schematic diagram of realizing of parameter modification, emulation and result store in innermost loop;
Fig. 3 be in the present invention with the gui interface of user interactions;
Fig. 4 is fundamental diagram of the present invention, and IAIM kernel is wherein Fig. 2 schematic diagram.
Embodiment:
Below in conjunction with accompanying drawing and embodiment, the invention will be further described.
As shown in Figure 1, a kind of traditional call method that utilizes ATP emulation is revised parameter in ATPDraw interface, manually start ATP emulation, carry out P142mat.exe file, simulation result is converted into .mat file, manually Matlab is imported to .mat file, carry out data analysis; Circulation N time, in traditional method, each simulation process all needs artificial participation, emulation enormous amount, N can reach at 103 o'clock, complex operation, time, manpower expend huge, and efficiency and operation accuracy rate are lower.
As shown in Fig. 2-Fig. 4, a kind of realization flow of Matlab-ATP integrated automation call method is:
1) under the work path of Matlab from ATP installation directory, derive the * .atp file for the treatment of realistic model, this file is imported under atpmingw path.
2) Matlab receives the variation range of each fault parameter of inputting in gui interface.Become multilayer circulation nested the change process of multiple parameters, the variation range of every layer of nested corresponding parameter; Step 3), 4) all for innermost loop.
3), in innermost loop, Matlab switches current path to the atpmingw path under ATP installation directory, in * .atp file corresponding to realistic model, in written document mode, the new value of each fault parameter is write to each self-corresponding position.Matlab calls executable program Tpbig.exe, carries out the emulation to amended * .atp file.After emulation finishes, Matlab calls executable program Pl42mat.exe, and the * .pl4 file that emulation is generated is converted into the * .mat file of the same name with * .atp file.
4) Matlab reads failure message corresponding to end-around carry now, and is integrated into character string; * .mat file is imported in its work space Workspace, with this character string to the rename of * .mat file.Matlab receives the data storage location of the setting in gui interface, and the * .mat file after rename is imported to this position.
5) Matlab completes the emulation of all failure scenarios under each fault parameter variation combination by nested circulation.
Compare with classic method, the method makes ATP in function, become an embedded module of Matlab, artificial mutual with gui interface, need once arrange, and other all operations complete automatically by background program.Because the mat file of simulation result is the failure message name representing separately with it, therefore all mat file designation has regularity, can unify to analyze data result by batch system.Robotization, simulation efficiency and the data-handling efficiency of simulation process are greatly improved.
By reference to the accompanying drawings the specific embodiment of the present invention is described although above-mentioned; but not limiting the scope of the invention; one of ordinary skill in the art should be understood that; on the basis of technical scheme of the present invention, those skilled in the art do not need to pay various amendments that creative work can make or distortion still in protection scope of the present invention.