Method and system for constructing electromagnetic transient user-defined model based on ADPSS
By establishing the mapping relationship and parameter conversion rules of the PSASP electromechanical transient user-defined model in the ADPSS electromagnetic transient simulation environment, the input and output adaptation and topological structure analysis of the model are completed, and the automated modeling of the electromagnetic transient user-defined model of the power system is realized, which solves the problem that the model cannot be directly applied in the existing technology and improves the modeling efficiency.
Patent Information
- Application Number
- CN202411716003.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-28
AI Technical Summary
The existing PSASP electromechanical transient user-defined model cannot be directly applied in the ADPSS electromagnetic transient simulation environment. It requires manual modeling, the process is complicated and the modeling efficiency is low.
By determining the mapping relationship and parameter conversion rules between the PSASP electromechanical transient user-defined model to the ADPSS electromagnetic transient user-defined model, an initial electromagnetic transient custom model is established, and the adaptation of input and output amounts is completed by supplementing the conversion module and introducing intermediate variables. The topology is analyzed using width-first search and backtracking, and the position coordinates of the basic functional box are assigned, and the electromagnetic transient user-defined model is drawn through the ADPSS application program interface.
The automatic modeling of PSASP electromechanical transient user-defined model in the ADPSS electromagnetic transient simulation environment is realized, which improves the efficiency of electromagnetic transient modeling of the power system and avoids the cumbersome process of manual modeling.
Smart Images

Figure CN119720916A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electromagnetic transient modeling of power systems, and in particular to a method and system for constructing an electromagnetic transient user-defined model based on ADPSS. Background Art
[0002] With the continuous research and development and operation of various new regulating and protective devices, new high-voltage power transmission and transformation equipment, generator sets and various regulating and protective devices, the power system simulation program is required to flexibly establish models of various secondary system devices such as protection, safety and self-protection devices and regulating systems, such as: various types of voltage regulators, speed regulators, power system stabilizers (PSS), new power electronic components static VAR compensators (SVC), thyristor-controlled series compensation devices (TCSC), unified power flow controllers (UPFC), ultra-high voltage DC transmission lines and their control systems for different projects, various relay protections and safety automatic devices, etc., to meet the requirements of system analysis for power system planning, design, operation, dispatching and scientific research.
[0003] User-defined modeling technology can meet the growing demand for modeling of new power system equipment. It has become one of the effective means to solve the modeling and simulation of a large number of relays, safety and automatic devices, as well as power electronics and new energy control equipment, and has been widely used in a large number of power system calculation programs.
[0004] Electromechanical transient simulation is a time-domain simulation method based on the phasor value model to simulate the dynamic response characteristics of the power system. For the electromechanical process of the traditional AC power system, it has the advantages of high simulation accuracy and fast simulation speed. The typical simulation step is 10ms. It has long been one of the important functional modules for carrying out power system mode calculation and analysis. The input and output of the electromechanical transient user-defined model are the phasor average value of the electromechanical transient model, that is, the effective value, and its sampling step is equivalent to the electromechanical transient simulation step. With the large-scale grid connection of new energy and long-distance DC networking, a large number of power electronic equipment are connected to the grid, and the system switch control characteristics are highlighted. The switch control action frequency is very high. The effective value provided by the existing electromechanical transient simulation with a simulation step of 10ms cannot correctly describe the dynamic characteristics of the system, and the scope of application of the electromechanical transient custom model is limited.
[0005] The existing electromechanical transient custom modeling in PSASP provides a total of 63 basic function boxes, which can meet the needs of modeling conventional power grid protection and control equipment such as relay protection and safety automatic devices.
[0006] Electromagnetic transient simulation is a time domain simulation method based on an instantaneous value model to simulate the dynamic response characteristics of the power system. The accuracy of the electromagnetic transient simulation method is closely related to the constructed power system model, including the primary system model and the secondary control system model. A smaller simulation step can more accurately simulate the dynamic response characteristics of the power system, especially for power grids containing power electronic equipment. Due to the high switching frequency and fast control switching time of power electronic equipment, a smaller simulation step must be used to accurately reflect its switching characteristics. The typical electromagnetic transient simulation step is 50 microseconds. The input and output of the electromagnetic transient user-defined model are the instantaneous values of the electromagnetic transient model, and the step size used is equal to the electromagnetic transient simulation step size.
[0007] The existing ADPSS electromagnetic transient user-defined modeling provides a total of 177 basic function boxes, which can meet the modeling requirements of conventional power grid control and protection systems, new energy controllers, and power electronic control equipment.
[0008] The existing user-defined modeling functions of PSASP and ADPSS, whether it is custom electromechanical transient modeling or custom electromagnetic transient modeling, provide functions that can expand the basic function box to meet the modeling needs of new power system control equipment. However, the scope of full electromagnetic transient modeling of power systems currently only includes AC power grids and DC transmission primary systems, and the DC transmission system uses an electromechanical transient model, and does not involve automatic conversion of user-defined models that support secondary control system modeling. The basic idea is to establish an AC network electromagnetic transient model based on the existing AC network and DC electromechanical transient model parameters according to the mapping rules, and then obtain the DC electromechanical transient model from the electromechanical data, and add it to the AC electromagnetic transient model after initialization. Summary of the invention
[0009] Aiming at the problem that the PSASP electromechanical transient user-defined model in the prior art cannot be directly applied in the ADPSS electromagnetic transient simulation environment, manual modeling is required, and the process is cumbersome and complicated, and the modeling efficiency is low, the present invention provides a method and system for constructing an electromagnetic transient user-defined model based on ADPSS, the method comprising:
[0010] Determine the mapping relationship and parameter conversion rules between the basic function boxes of the PSASP electromechanical transient user-defined model and the ADPSS electromagnetic transient user-defined model; establish an initial electromagnetic transient user-defined model based on ADPSS according to the mapping relationship and parameter conversion rules;
[0011] By supplementing the conversion module and deriving the intermediate variables, the input and output of the initial electromagnetic transient user-defined model are adapted, and the electromagnetic transient user-defined model is obtained;
[0012] Based on two breadth-first searches and backtracking, the topological structure of the electromagnetic transient user-defined model is analyzed to identify the topological hierarchical information and loop information of the basic function boxes in the electromagnetic transient user-defined model arranged in layers; according to the topological hierarchical information and loop information, the position coordinates of each basic function box in the ADPSS modeling environment are assigned;
[0013] Based on the position coordinates, an ADPSS-based electromagnetic transient user-defined model is drawn by calling the ADPSS application program interface.
[0014] Furthermore, the ADPSS-based initial electromagnetic transient custom model includes:
[0015] The basic function box types, parameters and topological structures are automatically converted from the PSASP electromechanical transient user-defined model through mapping relationships and parameter conversion rules.
[0016] Furthermore, by supplementing the conversion module and introducing the intermediate variables, the adaptation of the input and output of the initial electromagnetic transient custom model is completed, including:
[0017] A conversion module is added at the input of the initial electromagnetic transient user-defined model to realize the conversion from the effective value input of the PSASP electromechanical transient user-defined model to the instantaneous value input of the initial electromagnetic transient user-defined model of the ADPSS;
[0018] Output the initial electromagnetic transient user-defined model of ADPSS to multiple output quantities of the same element and the same variable, derive intermediate variables respectively, and automatically set or operate the series and parallel operations of the basic function box according to the number of output quantities to aggregate multiple output quantities into one output quantity;
[0019] Add the basic function box of time-controlled switch operation and set the time threshold value. When the simulation time is less than the time threshold value, the output is locked.
[0020] Furthermore, based on two breadth-first searches and backtracking, the topological structure of the electromagnetic transient user-defined model is analyzed to identify topological hierarchical information and loop information of basic functional blocks in the electromagnetic transient user-defined model arranged in layers, including:
[0021] Based on two breadth-first searches, the initial layer number of the basic function box is determined and the feedback point is identified;
[0022] Based on the first backtracking search, determine the basic function block loop number, and identify the trunk, side branch and feedback loops, where the loop whose first function block is an output quantity operation function block and whose last function block is an input quantity operation function block is set as the trunk loop, the loop with a feedback link is set as the feedback loop, and the rest are set as side branch loops;
[0023] Based on the second backtracking search, modify the basic function box layer number and loop number on the feedback link.
[0024] Furthermore, according to the topological layer information and loop information, each basic function box is assigned a position coordinate of a map sheet in the ADPSS modeling environment, including:
[0025] The horizontal distribution of the ADPSS electromagnetic transient user-defined model is determined by the basic function frame layer number, and the vertical distribution of the ADPSS electromagnetic transient user-defined model is determined by the basic function frame loop number;
[0026] Traverse all basic function boxes to find the maximum layer number maxl and the minimum layer number minl; consider the input end and the output end, the total number of layers Ltotal = maxl-minl+1+2; add 2 layers to consider the drawing positions of the model input end and the model output end graphics respectively;
[0027] Traverse all basic function boxes to find the maximum loop number maxc and the minimum loop number minc; the total number of loops CtotalNew = maxc-minc+1;
[0028] The layer number is shifted so that the minimum layer number starts from 2. The layer number shift amount of each basic function box is 2-minl;
[0029] The upper left corner of the model image is taken as the origin, and the model image is assumed to be (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively;
[0030] Assume that the basic function frame layer number is Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; where xedge is the blank space reserved on both sides of the map;
[0031] Assume that the basic function frame loop number is Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; where yedge is the blank space reserved above and below the drawing.
[0032] Further, based on the position coordinates, by calling the ADPSS application program interface, an ADPSS-based electromagnetic transient user-defined model is drawn, including:
[0033] Based on the position coordinates, the ADPSS application program interface API is called to draw the basic function boxes, input terminals, output terminals of the electromagnetic transient user-defined model, draw input and output connections between the basic function boxes, and set the basic function box parameters.
[0034] The present invention also provides a system for constructing an electromagnetic transient user-defined model based on ADPSS, comprising:
[0035] The initial model establishment module is used to determine the mapping relationship and parameter conversion rules between the basic function boxes of the PSASP electromechanical transient user-defined model and the ADPSS electromagnetic transient user-defined model; according to the mapping relationship and parameter conversion rules, establish an initial electromagnetic transient user-defined model based on ADPSS;
[0036] An input and output adaptation module, used to complete the adaptation of the input and output of the initial electromagnetic transient user-defined model by supplementing the conversion module and deriving intermediate variables, and obtain the electromagnetic transient user-defined model;
[0037] A position coordinate determination module is used to analyze the topological structure of the electromagnetic transient user-defined model based on two breadth-first searches and backtracking, identify the topological hierarchical information and loop information of the basic function boxes in the electromagnetic transient user-defined model arranged in layers; and assign the position coordinates of each basic function box in the ADPSS modeling environment according to the topological hierarchical information and loop information;
[0038] The model drawing module is used to draw an ADPSS-based electromagnetic transient user-defined model based on the position coordinates by calling the ADPSS application program interface.
[0039] Furthermore, the input and output quantity adaptation module includes:
[0040] The input quantity adaptation submodule is used to supplement the conversion module at the input quantity of the initial electromagnetic transient user-defined model to realize the conversion from the effective value input of the PSASP electromechanical transient user-defined model to the instantaneous value input of the ADPSS initial electromagnetic transient user-defined model;
[0041] The output adapter module is used to output the initial electromagnetic transient user-defined model of the ADPSS to multiple output quantities of the same element and the same variable, respectively derive intermediate variables, and automatically set or operate the series and parallel operations of the basic function box according to the number of output quantities, so as to aggregate multiple output quantities into one output quantity;
[0042] Add the basic function box of time-controlled switch operation and set the time threshold value. When the simulation time is less than the time threshold value, the output is locked.
[0043] Furthermore, the position coordinate determination module includes:
[0044] The initial layer number determination submodule is used to determine the initial layer number of the basic function box based on two breadth-first searches and identify the feedback point;
[0045] The first backtracking search submodule is used to determine the basic function block loop number based on the first backtracking search, and identify the trunk, side branch and feedback loops, wherein the loop in which the first function block in the loop is an output quantity operation function block and the last function block is an input quantity operation function block is set as the trunk loop, the loop with a feedback link is set as the feedback loop, and the remaining loops are set as side branch loops;
[0046] The second backtracking search submodule is used to modify the basic function box layer number and loop number on the feedback link based on the second backtracking search.
[0047] Furthermore, the position coordinate determination module includes:
[0048] A submodule for determining the horizontal and vertical distribution is used to determine the horizontal distribution of the ADPSS electromagnetic transient user-defined model through the basic function box layer number, and the basic function box loop number determines the vertical distribution of the ADPSS electromagnetic transient user-defined model;
[0049] The total number of layers determination submodule is used to traverse all basic function boxes to find the maximum layer number maxl and the minimum layer number minl; considering the input end and the output end, the total number of layers Ltotal = maxl-minl+1+2; wherein 2 layers are added to consider the drawing positions of the model input end and the model output end graphics respectively; traverse all basic function boxes to find the maximum loop number maxc and the minimum loop number minc; the total number of loops CtotalNew = maxc-minc+1;
[0050] The layer number translation submodule is used to make the minimum layer number start from 2. The layer number translation amount of each basic function box is 2-minl;
[0051] The origin determination submodule is used to take the upper left corner of the model map as the origin, assuming that the model map is (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively;
[0052] The layer number horizontal coordinate determination submodule is used to set the basic function frame layer number as Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; where xedge is the blank size reserved on both sides of the map;
[0053] The loop number coordinate determination submodule is used to set the loop number of the basic function frame to Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; where yedge is the blank size reserved above and below the map.
[0054] The present invention provides a method and system for constructing an electromagnetic transient user-defined model in ADPSS. Based on the PSASP electromechanical transient user-defined model, the electromagnetic transient user-defined model structure is constructed through basic function box mapping and input-output automatic adaptation; through two breadth-first search and backtracking, the layer number and loop number of the basic function box are formed, and the coordinates of the basic function box are determined accordingly, and the topological structure analysis of the customized model and the position anchoring in the graphic environment are completed. Finally, the electromagnetic transient user-defined model is automatically laid out in the ADPSS interface environment through the application program interface API, and the electromagnetic transient user-defined model is automatically modeled, so as to improve the efficiency of electromagnetic transient modeling in the power system. The present invention aims to solve the problem that the existing PSASP electromechanical transient user-defined model cannot be directly applied in the ADPSS electromagnetic transient simulation environment, and manual modeling is required, and the process is cumbersome and complicated, and the modeling efficiency is low. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a flow chart of a method for constructing an electromagnetic transient user-defined model based on ADPSS provided by an embodiment of the present invention;
[0056] Figure 2 It is a flowchart of automatic modeling and layout of an ADPSS user-defined model involved in an embodiment of the present invention;
[0057] Figure 3 It is a structure diagram of a self-defined electromechanical transient model of a certain line safety control device involved in an embodiment of the present invention;
[0058] Figure 4 It is an initial model structure diagram after the electromechanical transient user-defined model of a certain line safety control device involved in an embodiment of the present invention is converted into an electromagnetic transient user-defined model;
[0059] Figure 5 It is a schematic diagram of the adaptation processing of the initial electromagnetic transient custom model input quantity involved in an embodiment of the present invention;
[0060] Figure 6 It is a schematic diagram of an initial electromagnetic transient custom model output adaptation model involved in an embodiment of the present invention;
[0061] Figure 7 It is a flow chart of topological structure analysis and automatic layout of an electromagnetic transient custom model involved in an embodiment of the present invention;
[0062] Figure 8 It is a schematic diagram of the initial layer number and feedback point of the basic function block determined after two breadth-first searches involved in an embodiment of the present invention;
[0063] Fig. 9It is a schematic diagram of determining a trunk loop, a side branch and a feedback loop of a basic function block after a backtracking search involved in an embodiment of the present invention;
[0064] Fig.10 It is a schematic diagram of the basic functional block layer number of the direct backtracking search and post-modification feedback link involved in the embodiment of the present invention;
[0065] Fig.11 It is a structural schematic diagram of a system for constructing an electromagnetic transient user-defined model based on ADPSS provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0066] Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific implementation disclosed below.
[0067] Example 1
[0068] The present invention provides a method for constructing an electromagnetic transient user-defined model based on ADPSS, the process of which is as follows: Figure 1 As shown, the following steps are included:
[0069] Step S101, determining the mapping relationship and parameter conversion rules between the basic function boxes of the PSASP electromechanical transient user-defined model and the ADPSS electromagnetic transient user-defined model; and establishing an initial electromagnetic transient user-defined model based on ADPSS according to the mapping relationship and parameter conversion rules.
[0070] The PSASP electromechanical transient and ADPSS electromagnetic transient custom modeling functions support different sets of basic function boxes. Due to the differences in simulation step size and simulation model principles between the two, the supported basic function boxes are not completely repeated. ADPSS electromagnetic transient custom modeling supports higher-level refined modeling requirements, and the basic function boxes it supports can generally cover PSASP electromechanical transients. Some basic function boxes require special processing due to design differences. At present, PSASP electromechanical transient custom modeling supports 63 basic function boxes, while ADPSS electromagnetic transient custom modeling supports 177 basic function boxes. The specific steps are as follows:
[0071] 1-1 Establish the mapping relationship and parameter conversion rules from the basic function box of the PSASP electromechanical transient user-defined model to the basic function box of the ADPSS electromagnetic transient user-defined model.
[0072]
[0073]
[0074] 1-2 According to the above basic function box mapping relationship and conversion rules, the electromechanical transient custom model is converted into the initial electromagnetic transient custom model, including the basic function box type, parameters and their topological relationship. The input and output of the converted electromagnetic transient custom model are consistent with the original electromechanical transient custom model, and only support the input and output of effective values, which cannot be directly used in ADPSS electromagnetic transient simulation.
[0075] Step S102, by supplementing the conversion module and deriving the intermediate variables, the adaptation of the input and output of the initial electromagnetic transient user-defined model is completed, and the electromagnetic transient user-defined model is obtained.
[0076] Through the basic functional box elements such as one-cycle fundamental amplitude and phase angle elements, three-phase positive and negative zero sequence elements, three-phase active power calculation elements, and three-phase reactive power calculation elements, the conversion module is supplemented at the input of the initial electromagnetic transient custom model to realize the conversion from the effective value input of the electromechanical transient user-defined model of PSASP to the instantaneous value input of the initial electromagnetic transient custom model of ADPSS. The basic functional boxes required for input adaptation include:
[0077]
[0078] The initial electromagnetic transient custom model of ADPSS is output to multiple output quantities of the same element and the same variable, and the intermediate variables are respectively derived. The series and parallel operations of the basic function box of the "or" operation are automatically set according to the number of output quantities, and multiple output quantities are aggregated into one output quantity to form an electromagnetic transient user-defined model to meet the requirements of the electromagnetic transient model in ADPSS for access to the power grid; and the "time-controlled switch" operation basic function box is added, and the time threshold value is set. When the simulation time is less than the time threshold value, the output quantity is locked to the external element to prevent the disturbance when the ADPSS simulation software is started from interfering with the normal startup of the system.
[0079] Step S103, based on two breadth-first searches and backtracking, analyze the topological structure of the electromagnetic transient user-defined model, identify the topological hierarchical information and loop information of the basic function boxes in the electromagnetic transient user-defined model arranged in layers; and assign the position coordinates of each basic function box in the ADPSS modeling environment according to the topological hierarchical information and loop information.
[0080] The previous two steps have obtained a custom model that can be connected to the power system in ADPSS. In this step, the input-output relationship of the basic function box of the model is determined based on two breadth-first searches to determine the initial layer number of the basic function box and identify the feedback point; based on the first backtracking search, the basic function box loop number is determined, and the trunk, side branch and feedback loops are identified. The loop in which the first function box in the loop is an output quantity operation function box and the last function box is an input quantity operation function box is set as the trunk loop, the loop with a feedback link is set as the feedback loop, and the remaining loops are set as side branch loops; based on the second backtracking search, the basic function box layer number and loop number on the feedback link are modified. Then, combined with the size of the map, each basic function box is assigned a position coordinate to anchor the position of the basic function box in the map. The specific steps are as follows:
[0081] 3-1 Initialization
[0082] The current layer basic function box set CUR is empty; the next layer basic function box set NEXT is empty; define the basic function box pair sets L1 and L2 as empty; define all basic function boxes with model input quantities in the model as input quantity basic function boxes, whose layer number is 1; all basic function boxes with model output quantities in the model are output quantity basic function boxes; define the basic function boxes without any input quantity as no input quantity basic function boxes; define the loop number of all basic function boxes as 0;
[0083] 3-2 Perform two breadth-first searches (DFS) to determine the initial layer number of the basic function box and identify the feedback point.
[0084] 3-2-1 Set all basic function box traversal flags to empty;
[0085] 3-2-2 Record the current layer CUR as a set of basic function boxes of input quantity, and record the layer number for each basic function box of the layer;
[0086] 3-2-3 For each basic function box I in the current layer CUR, find the basic function box J through the output quantity association information;
[0087] 3-2-4 If the traversal flag of the basic function box J is empty, add J to NEXT, mark the basic function box as traversed, record the previous basic function box of J as I, and the layer number of J is I plus 1;
[0088] 3-2-5 If the J basic function box has been traversed, then take out the I layer number CI and the J layer number CJ; if CI is greater than CJ, the feedback point is found, and the information of I and J and their layer numbers are recorded in the basic function box pair set L1;
[0089] 3-2-6 Update the current basic function box set CUR to the next basic function box set NEXT. If NEXT is empty, end the search and record all traversed basic function box sets as D1. Otherwise, clear the next basic function box set NEXT and go to step 3-2-3.
[0090] 3-2-7 Set CUR to a basic function box without input quantity, repeat 3-2-3 to 3-2-6, and record that the basic function box set traversed in this search is D2, and the basic function box pair set is L2;
[0091] 3-2-8 For each pair of basic function boxes in L2, trace back the search path according to the layer number of the existing basic function boxes in L2, and decrement the layer number of the basic function box on the assignment path (the layer number may be negative). At this point, all basic function box sets D1 and D2 have obtained the initial layer number;
[0092] 3-2-9 All basic function boxes that have not been traversed are invalid basic function boxes.
[0093] 3-3 Backtrack and search to determine the basic function box loop number, and identify the trunk, side branch and feedback loop.
[0094] 3-3-1 Set all basic function box traversal flags to empty; define loop set C. C is a two-dimensional array, and its row Ck represents loop k; a loop is a set of basic function boxes with input-output associations on the breadth-first search path with decreasing layer numbers, and is a part of the model that is interconnected;
[0095] 3-3-2 Start from the output basic function box in turn, and according to the information of the previous basic function box recorded in 3-2, backtrack the existing search path until the input basic function box or the basic function box without input, and record the traversed basic function box in C. Assume that the current is the kth loop, then the loop number of the traversed basic function box is recorded as k. During the backtracking traversal process, if the loop number of the upper function box is 0, its loop number is equal to the loop number of the lower function box; if the upper function box already has a loop number x, then terminate the backtracking of this loop and record the loop number x associated with this loop; set the basic function box that has been traversed as traversed;
[0096] 3-3-3 Set the main loop. The loop whose first function box is an output function box and whose last function box is an input function box is set as the main loop, the loop with feedback links is set as the feedback loop, and the others are set as the side branch loops; the side branch loops are all associated with a main, side branch or feedback loop;
[0097] 3-3-4 For the basic function box pair set L1, take out the basic function box pairs in turn, add a loop to the loop set C, and set it to be numbered kk; start the backtracking search from the basic function box with the larger layer number, and record the loop numbers of the basic function boxes searched as kk, and mark the loop kk as a feedback loop; if the loop number of the basic function box searched by backtracking is m and m>0, then terminate the backtracking and record the loop kk associated with loop m; set the basic function boxes that have been traversed by backtracking as traversed;
[0098] 3-3-5 For the basic function box pair set L2, take out the basic function box pairs in turn, take the circuit number of the one with the larger layer number, and set it as n;
[0099] 3-3-6 If n is greater than 0, add a loop to the loop set C and set it to jj; record loop jj associated with loop n; start from the basic function box with a smaller layer number and search back, and record the loop numbers of the basic function boxes searched as jj. Set the basic function boxes that have been traversed back as traversed, and mark loop jj as a side branch loop; if n is equal to 0, go to 3-3-5 and repeat this step until the loop numbers of the basic function boxes with larger layer numbers in each basic function box pair in L2 are all greater than 0;
[0100] 3-3-7 For the valid basic function box y1 that has not been traversed, find the downstream basic function box y2 through the output quantity association relationship. If y2 has a loop number nn and nn is greater than 0, add a side branch loop ii to the loop set C, and start backtracking from y1 to search the basic function box, record the loop nn associated with loop ii, and mark the basic function box that has been backtracked; repeat this step until all valid basic function boxes have loop numbers; record the total number of loops in C as Ctotal, and set the new serial numbers of all loops to 0;
[0101] 3-3-8 For the trunk loops, sort them according to the number of basic function boxes in the loops. The one with more basic function boxes should be placed in the middle of the map. The total number of trunk loops is Cmain, and the position number of the trunk branch with the most basic function boxes is INT(Cmain / 2)+1, where INT means rounding. The other trunk branches are arranged in sequence and assigned numbers. Finally, all trunk loops have a new number between 1 and Cmain.
[0102] 3-3-9 For the side branch loop of loop set C, if there is an associated main loop with a non-zero new sequence number, the sequence number of the side branch loop is inserted before the sequence number of the associated main loop, and the sequence numbers of other loops behind it are postponed; if there is an associated non-main loop with a non-zero new sequence number, the sequence number of the side branch loop is inserted after the sequence number of the associated non-main loop, and the sequence numbers of other loops behind it are postponed; for the feedback loop of loop set C, its new loop sequence number is inserted after the sequence number of the associated main loop, and the sequence numbers of other loops behind it are postponed; 3-3-9 is repeated until all loops have non-zero sequence numbers, and finally a loop order of 1:Ctotal is formed, and Ctotal is greater than Cmain;
[0103] 3-3-10 Update the loop number of each basic function box according to the new loop serial number.
[0104] 3-4 Backtrack and search to modify the basic function box layer number and loop number of the feedback link.
[0105] 3-4-1 For the basic function box pair set L1, take out the basic function box pairs in turn (recorded as a and b, where the layer number of a is smaller than the layer number of b), and find the basic function box (recorded as s) of the corresponding feedback loop and its associated trunk loop from the loop set C according to b; the number of feedback loop function boxes is recorded as m, and the number of basic function boxes traced back from s to a is recorded as p, where p is the corresponding part of the feedback loop in the trunk loop;
[0106] 3-4-2 If m is less than or equal to p, for the basic function box in the feedback link, backtrack from b again, assign the layer number to the a layer number in sequence, and add 1 to the a layer number until the a layer number is added to m-1;
[0107] 3-4-3 If m is greater than p, let r = INT(m / p) + 1, INT is rounded, and start backtracking from b again. Every p function boxes are assigned a layer number, and the a layer number is increased by 1 until the a layer number is increased by p-1; accordingly, r-1 loop numbers are added below the feedback loop number, and the other loop numbers behind it are postponed accordingly; at this time, the total number of loops increases to Ctotal+r-1.
[0108] 3-4-4 Repeat the processing of each feedback loop in the basic function block set L1 until the processing is completed.
[0109] 3-5 Calculate the coordinate position of each basic function frame according to the layer number and loop number.
[0110] The layer number determines the horizontal distribution of the model graphics, and the loop number determines the vertical distribution of the model graphics. The algorithm for arranging coordinates for each basic function box is as follows:
[0111] 3-5-1 Traverse all basic function boxes to find the maximum layer number maxl and the minimum layer number minl; Consider the input and output ends, the total number of layers Ltotal = maxl-minl+1+2; Add 2 layers to consider the drawing positions of the model input and model output elements respectively; Traverse all basic function boxes to find the maximum loop number maxc and the minimum loop number minc; The total number of loops CtotalNew = maxc-minc+1;
[0112] 3-5-2 Layer number translation, so that the minimum layer number starts from 2 (the input end is the 1st layer), and the layer number translation amount of each basic function box is 2-minl;
[0113] 3-5-3 Take the upper left corner as the origin and assume that the model map is (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively;
[0114] 3-5-4 Let the basic function frame layer number be Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; xedge is the blank space reserved on both sides of the map for aesthetic considerations;
[0115] 3-5-5 Assume that the basic function frame loop number is Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; yedge is the blank space reserved above and below the drawing for aesthetic considerations.
[0116] Step S104: Based on the position coordinates, an ADPSS-based electromagnetic transient user-defined model is drawn by calling the ADPSS application program interface.
[0117] Based on the position coordinates, the ADPSS application program interface API is called to draw the basic function box, input terminal, output terminal of the electromagnetic transient user-defined model, draw the input and output connection lines of the basic function box, and set the basic function box parameters.
[0118] Example 2
[0119] The following is a diagram illustrating the process of implementing the method of the present invention to realize the automatic modeling and layout of the electromagnetic transient user-defined model. Figure 2 The specific implementation example of the present invention is carried out according to the following steps.
[0120] Step 1: Basic function box mapping and model conversion.
[0121] First, we will conduct a detailed investigation of the basic function boxes and their parameter correspondence of the PSASP electromechanical transient custom modeling and ADPSS electromagnetic transient custom modeling function description models, and establish function box mapping relationships and conversion rules accordingly. The following table shows the mapping relationships and conversion rules of some basic function boxes.
[0122]
[0123]
[0124]
[0125] Then develop a conversion program to convert the PSASP electromechanical custom model into the ADPSS electromagnetic custom model. At this time, the electromagnetic transient custom model and the electromechanical transient custom model have the same input and output requirements under the conversion mapping rules. For example, taking a certain security control device as an example, its input is the real and imaginary parts of the line current positive sequence, and its output is the load shedding operation. The electromechanical custom model in PSASP is as shown in the attached figure. Figure 3 As shown in the attached figure, after conversion, the ADPSS electromagnetic custom model is Figure 4 shown.
[0126] Step 2: Adapt the input and output of the electromagnetic transient custom model.
[0127] As attached Figure 3 The electromagnetic transient user-defined model shown cannot be directly applied in ADPSS. The reason is that the real and imaginary parts of the input line current positive sequence cannot be directly collected from the electromagnetic transient simulation process. In addition, the output load shedding operation will cause the simulation program to fail to start because other safety control device models are also associated with the same load. Therefore, input and output adaptation is required.
[0128] The first is input adaptation, which connects the conversion module from instantaneous value to effective value to the input quantity of effective value input. This module needs to use the following basic function boxes:
[0129]
[0130] Attachment Figure 4 The model shown in the figure has the following input structure after the input quantity is adapted: Figure 5 shown.
[0131] Then, we adopt intermediate variables and use the basic function box "or" series and parallel operations to build an output adaptation model to adapt the output quantity. Figure 3 The model shown, after output adaptation, is attached Figure 4The model output is sent to the intermediate variable. The adaptation model introduces the model output into the load switch through the intermediate variable, or operation, and the time-controlled switch delay module, and filters the interference at the simulation startup according to the time-controlled threshold. The output adaptation model is shown in the attached figure. Figure 6 shown.
[0132] Step 3: Topology analysis and automatic layout of electromagnetic transient custom model.
[0133] The structural description of the electromagnetic transient custom model has been formed in step 2, but in order to apply it in ADPSS, it is necessary to complete the drawing in the ADPSS interface environment before it can be used.
[0134] Topological structure analysis and automatic layout of electromagnetic transient custom models Figure 7 The process includes: 3 (1) Initialization. (2) Two breadth-first searches (DFS) to determine the initial layer number of the basic function box and identify the feedback point. Figure 8 The model structure shown in the figure, the analysis of the stratification and feedback links are shown in the attached figure. Figure 8 (3) Backtrack and search to determine the basic function block loop number and identify the trunk, side branch and feedback loop. Fig. 9 The model structure shown in the figure is shown in the attached figure. Fig. 9 (4) Backtrack and search to modify the basic function frame layer number and loop number of the feedback link. Fig.10 The model structure shown in the figure requires the basic function frame layer number to be modified as shown in the attached Fig.10 As shown. (5) Calculate the coordinate position of each basic function in the ADPSS map according to the layer number and loop number. Take the upper left corner as the origin and assume that the model map is (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively; let the basic function frame layer number be Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; where xedge is the blank space size reserved on both sides of the map for aesthetics, and Ltotal is the total number of layers considering the input terminals and output terminals; let the basic function frame loop number be Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; where yedge is the blank space size reserved on the top and bottom of the map for aesthetics, and CtotalNew is the total number of loops obtained after traversing all the basic function frame loop numbers. (6) Call the ADPSS application programming interface API to draw the basic function box, input terminal, and output terminal graphics of the electromagnetic transient user-defined model, draw the input and output connections of the basic function box, and set parameters according to the basic function box parameters.
[0135] Example 3
[0136] Based on the same inventive concept, the present invention also provides a system 100 for constructing a user-defined electromagnetic transient model based on ADPSS, such as Fig.11 As shown, including:
[0137] The initial model building module 110 is used to determine the mapping relationship and parameter conversion rules between the basic function boxes of the PSASP electromechanical transient user-defined model and the ADPSS electromagnetic transient user-defined model; and to establish an initial electromagnetic transient user-defined model based on the ADPSS according to the mapping relationship and parameter conversion rules;
[0138] An input and output adaptation module 120, used to complete the adaptation of the input and output of the initial electromagnetic transient user-defined model by supplementing the conversion module and deriving the intermediate variables, and obtain the electromagnetic transient user-defined model;
[0139] The position coordinate determination module 130 is used to analyze the topological structure of the electromagnetic transient user-defined model based on two breadth-first searches and backtracking, identify the topological hierarchical information and loop information of the basic function blocks in the electromagnetic transient user-defined model arranged by layers; and assign the position coordinates of each basic function block in the ADPSS map according to the topological hierarchical information and loop information;
[0140] The model drawing module 140 is used to draw an ADPSS-based electromagnetic transient user-defined model based on the position coordinates by calling the ADPSS application program interface.
[0141] Furthermore, the input and output quantity adaptation module includes:
[0142] The input quantity adaptation submodule is used to supplement the conversion module at the input quantity of the initial electromagnetic transient user-defined model to realize the conversion from the effective value input of the PSASP electromechanical transient user-defined model to the instantaneous value input of the initial electromagnetic transient user-defined model of the ADPSS;
[0143] The output adapter module is used to output the initial electromagnetic transient user-defined model of the ADPSS to multiple output quantities of the same element and the same variable, respectively derive intermediate variables, and automatically set or operate the series and parallel operations of the basic function box according to the number of output quantities, so as to aggregate multiple output quantities into one output quantity;
[0144] Add the basic function box of time-controlled switch operation and set the time threshold value. When the simulation time is less than the time threshold value, the output is locked.
[0145] Furthermore, the position coordinate determination module includes:
[0146] The initial layer number determination submodule is used to determine the initial layer number of the basic function box based on two breadth-first searches and identify the feedback point;
[0147] The first backtracking search submodule is used to determine the basic function block loop number based on the first backtracking search, and identify the trunk, side branch and feedback loops, wherein the loop in which the first function block in the loop is an output quantity operation function block and the last function block is an input quantity operation function block is set as the trunk loop, the loop with a feedback link is set as the feedback loop, and the remaining loops are set as side branch loops;
[0148] The second backtracking search submodule is used to modify the basic function box layer number and loop number on the feedback link based on the second backtracking search.
[0149] Furthermore, the position coordinate determination module includes:
[0150] A submodule for determining the horizontal and vertical distribution is used to determine the horizontal distribution of the ADPSS electromagnetic transient user-defined model through the basic function box layer number, and the basic function box loop number determines the vertical distribution of the ADPSS electromagnetic transient user-defined model;
[0151] The total number of layers determination submodule is used to traverse all basic function boxes to find the maximum layer number maxl and the minimum layer number minl; considering the input end and the output end, the total number of layers Ltotal = maxl-minl+1+2; wherein 2 layers are added to consider the drawing positions of the model input end and the model output end graphics respectively; traverse all basic function boxes to find the maximum loop number maxc and the minimum loop number minc; the total number of loops CtotalNew = maxc-minc+1;
[0152] The layer number translation submodule is used to make the minimum layer number start from 2. The layer number translation amount of each basic function box is 2-minl;
[0153] The origin determination submodule is used to take the upper left corner of the model map as the origin, assuming that the model map is (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively;
[0154] The layer number horizontal coordinate determination submodule is used to set the basic function frame layer number as Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; where xedge is the blank size reserved on both sides of the map;
[0155] The loop number coordinate determination submodule is used to set the loop number of the basic function frame to Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; where yedge is the blank size reserved above and below the map.
[0156] The present invention provides a method and system for constructing an electromagnetic transient user-defined model in ADPSS. Based on the PSASP electromechanical transient user-defined model, the electromagnetic transient user-defined model structure is constructed through basic function box mapping and input-output automatic adaptation; through two breadth-first search and backtracking, the layer number and loop number of the basic function box are formed, and the coordinates of the basic function box are determined accordingly, and the topological structure analysis of the customized model and the position anchoring in the graphic environment are completed. Finally, the electromagnetic transient user-defined model is automatically laid out in the ADPSS interface environment through the application program interface API, and the electromagnetic transient user-defined model is automatically modeled, so as to improve the efficiency of electromagnetic transient modeling in the power system. The present invention aims to solve the problem that the existing PSASP electromechanical transient user-defined model cannot be directly applied in the ADPSS electromagnetic transient simulation environment, and manual modeling is required, and the process is cumbersome and complicated, and the modeling efficiency is low.
[0157] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0158] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0159] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0160] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalents that do not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for constructing a user-defined electromagnetic transient model based on ADPSS, characterized in that: include: Determine the mapping relationship and parameter conversion rules between the basic function boxes of the PSASP electromechanical transient user-defined model and the ADPSS electromagnetic transient user-defined model; establish an initial electromagnetic transient user-defined model based on ADPSS according to the mapping relationship and parameter conversion rules; By supplementing the conversion module and deriving the intermediate variables, the input and output of the initial electromagnetic transient user-defined model are adapted, and the electromagnetic transient user-defined model is obtained; Based on two breadth-first searches and backtracking, the topological structure of the electromagnetic transient user-defined model is analyzed to identify the topological hierarchical information and loop information of the basic function boxes in the electromagnetic transient user-defined model arranged in layers; according to the topological hierarchical information and loop information, the position coordinates of each basic function box in the ADPSS modeling environment are assigned; Based on the position coordinates, an ADPSS-based electromagnetic transient user-defined model is drawn by calling the ADPSS application program interface.
2. The method according to claim 1, characterized in that The ADPSS-based initial electromagnetic transient custom model includes: The basic function box types, parameters and topological structures are automatically converted from the PSASP electromechanical transient user-defined model through mapping relationships and parameter conversion rules.
3. The method according to claim 1, characterized in that By supplementing the conversion module and introducing the intermediate variables, the adaptation of the input and output of the initial electromagnetic transient custom model is completed, including: A conversion module is added at the input of the initial electromagnetic transient user-defined model to realize the conversion from the effective value input of the PSASP electromechanical transient user-defined model to the instantaneous value input of the ADPSS initial electromagnetic transient user-defined model; Output the initial electromagnetic transient user-defined model of ADPSS to multiple output quantities of the same element and the same variable, derive intermediate variables respectively, and automatically set or operate the series and parallel operations of the basic function box according to the number of output quantities to aggregate multiple output quantities into one output quantity; Add the basic function box of time-controlled switch operation and set the time threshold value. When the simulation time is less than the time threshold value, the output is locked.
4. The method according to claim 1, characterized in that: Based on two breadth-first searches and backtracking, the topological structure of the electromagnetic transient user-defined model is analyzed to identify the topological hierarchical information and loop information of the basic functional blocks in the electromagnetic transient user-defined model arranged in layers, including: Based on two breadth-first searches, the initial layer number of the basic function box is determined and the feedback point is identified; Based on the first backtracking search, determine the basic function block loop number, and identify the trunk, side branch and feedback loops, where the loop in which the first function block is an output quantity operation function block and the last function block is an input quantity operation function block is set as the trunk loop, the loop with a feedback link is set as the feedback loop, and the remaining loops are set as side branch loops; Based on the second backtracking search, modify the basic function box layer number and loop number on the feedback link.
5. The method according to claim 1, characterized in that According to the topological layer information and loop information, each basic function box is assigned the position coordinates of the map in the ADPSS modeling environment, including: The horizontal distribution of the ADPSS electromagnetic transient user-defined model is determined by the basic function frame layer number, and the vertical distribution of the ADPSS electromagnetic transient user-defined model is determined by the basic function frame loop number; Traverse all basic function boxes to find the maximum layer number maxl and the minimum layer number minl; consider the input end and the output end, the total number of layers Ltotal = maxl-minl+1+2; add 2 layers to consider the drawing positions of the model input end and the model output end graphics respectively; Traverse all basic function boxes to find the maximum loop number maxc and the minimum loop number minc; the total number of loops CtotalNew = maxc-minc+1; The layer number is shifted so that the minimum layer number starts from 2. The layer number shift amount of each basic function box is 2-minl; The upper left corner of the model image is taken as the origin, and the model image is assumed to be (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively; Assume that the basic function frame layer number is Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; where xedge is the blank space reserved on both sides of the map; Assume that the basic function frame loop number is Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; where yedge is the blank space reserved above and below the drawing.
6. The method according to claim 1, characterized in that Based on the position coordinates, by calling the ADPSS application program interface, an ADPSS-based electromagnetic transient user-defined model is drawn, including: Based on the position coordinates, the ADPSS application program interface API is called to draw the basic function boxes, input terminals, output terminals of the electromagnetic transient user-defined model, draw input and output connections between the basic function boxes, and set the basic function box parameters.
7. A system for constructing a user-defined electromagnetic transient model based on ADPSS, characterized in that: include: The initial model establishment module is used to determine the mapping relationship and parameter conversion rules between the basic function boxes of the PSASP electromechanical transient user-defined model and the ADPSS electromagnetic transient user-defined model; according to the mapping relationship and parameter conversion rules, establish an initial electromagnetic transient user-defined model based on ADPSS; An input and output adaptation module, used to complete the adaptation of the input and output of the initial electromagnetic transient user-defined model by supplementing the conversion module and deriving intermediate variables, and obtain the electromagnetic transient user-defined model; A position coordinate determination module is used to analyze the topological structure of the electromagnetic transient user-defined model based on two breadth-first searches and backtracking, identify the topological hierarchical information and loop information of the basic function boxes in the electromagnetic transient user-defined model arranged in layers; and assign the position coordinates of each basic function box in the ADPSS modeling environment according to the topological hierarchical information and loop information; The model drawing module is used to draw an ADPSS-based electromagnetic transient user-defined model based on the position coordinates by calling the ADPSS application program interface.
8. The system according to claim 7, characterized in that: Input and output adapter modules, including: The input quantity adaptation submodule is used to supplement the conversion module at the input quantity of the initial electromagnetic transient user-defined model to realize the conversion from the effective value input of the PSASP electromechanical transient user-defined model to the instantaneous value input of the ADPSS initial electromagnetic transient user-defined model; The output adapter module is used to output the initial electromagnetic transient user-defined model of the ADPSS to multiple output quantities of the same element and the same variable, respectively derive intermediate variables, and automatically set or operate the series and parallel operations of the basic function box according to the number of output quantities, so as to aggregate multiple output quantities into one output quantity; Add the basic function box of time-controlled switch operation and set the time threshold value. When the simulation time is less than the time threshold value, the output is locked.
9. The system according to claim 7, characterized in that: The position coordinate determination module includes: The initial layer number determination submodule is used to determine the initial layer number of the basic function box based on two breadth-first searches and identify the feedback point; The first backtracking search submodule is used to determine the basic function block loop number based on the first backtracking search, and identify the trunk, side branch and feedback loops, wherein the loop in which the first function block in the loop is an output quantity operation function block and the last function block is an input quantity operation function block is set as the trunk loop, the loop with a feedback link is set as the feedback loop, and the remaining loops are set as side branch loops; The second backtracking search submodule is used to modify the basic function box layer number and loop number on the feedback link based on the second backtracking search.
10. The system according to claim 7, characterized in that: The position coordinate determination module includes: A submodule for determining the horizontal and vertical distribution is used to determine the horizontal distribution of the ADPSS electromagnetic transient user-defined model through the basic function box layer number, and the basic function box loop number determines the vertical distribution of the ADPSS electromagnetic transient user-defined model; The total number of layers determination submodule is used to traverse all basic function boxes to find the maximum layer number maxl and the minimum layer number minl; considering the input end and the output end, the total number of layers Ltotal = maxl-minl+1+2; wherein 2 layers are added to consider the drawing positions of the model input end and the model output end graphics respectively; traverse all basic function boxes to find the maximum loop number maxc and the minimum loop number minc; the total number of loops CtotalNew = maxc-minc+1; The layer number translation submodule is used to make the minimum layer number start from 2. The layer number translation amount of each basic function box is 2-minl; The origin determination submodule is used to take the upper left corner of the model map as the origin, assuming that the model map is (xt, yt); xt and yt are the horizontal and vertical coordinates in pixels respectively; The layer number horizontal coordinate determination submodule is used to set the basic function frame layer number as Lno, then its horizontal coordinate is (Lno-1)*(xt-xedge) / Ltotal; where xedge is the blank size reserved on both sides of the map; The loop number coordinate determination submodule is used to set the loop number of the basic function frame to Cno, then its vertical coordinate is (Cno-1)*(yt-yedge) / CtotalNew; where yedge is the blank size reserved above and below the map.