A fast self-adaptive estimation method for equivalent inertia of power system
By constructing and freezing a convolutional neural network with 1D-CNN weights and combining it with an MLP, and using the barnacle optimization algorithm to update the MLP hyperparameters, the problem of decreased accuracy of neural networks under sudden power grid changes was solved, and fast adaptive estimation of the equivalent inertia of the power system was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-03-09
- Publication Date
- 2026-06-09
AI Technical Summary
Existing neural network models suffer a significant drop in estimation accuracy when faced with sudden changes in power grid operation or unfamiliar operating conditions, making it difficult to simultaneously ensure both the accuracy and speed of system equivalent inertia estimation.
A one-dimensional convolutional neural network (1D-CNN) is constructed and pre-trained as a temporal local feature extractor. It is combined with a multilayer perceptron (MLP), the weight parameters of the 1D-CNN are frozen, and only the hyperparameters of the MLP are updated. The barnacle optimization algorithm is used to quickly retrain the MLP when the working conditions change.
It improves the accuracy and speed of system equivalent inertia estimation, reduces the number of retraining parameters, and significantly improves retraining speed.
Smart Images

Figure CN122178363A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system inertia estimation, and in particular to a fast adaptive estimation method for the equivalent inertia of a power system. Background Technology
[0002] With the increasing penetration rate of new energy sources, the equivalent inertia of power systems exhibits significant time-varying and spatial distribution differences. The equivalent inertia is a key factor in maintaining grid frequency stability and preventing power system collapse during disturbances. Therefore, accurate and rapid estimation of the equivalent inertia of power systems is crucial for maintaining grid frequency stability and developing weak inertia compensation strategies.
[0003] Mechanism-based methods for estimating the equivalent inertia of a system require model parameter identification and iterative solving after acquiring disturbance data, making it difficult to simultaneously meet the requirements of accuracy and speed in estimating the equivalent inertia. With the development of artificial intelligence, the methods for estimating the equivalent inertia of a system are gradually shifting from mechanism-based approaches to data-driven machine learning or deep learning methods. Existing neural networks, such as Long Short-Term Memory (LSTM) networks, can estimate the inertia of power systems in offline environments. However, once such neural network models are trained, their network weights are locked, and their estimation accuracy often drops significantly when faced with sudden changes in power grid operation or unfamiliar operating conditions. The more complex the neural network model, the more parameters need to be retrained; adopting a strategy of full-parameter retraining of the entire neural network incurs substantial computational and time costs. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention proposes a fast adaptive estimation method for the equivalent inertia of a power system. The technical solution of this invention is as follows: S1: Construct a dataset. Whenever an active power disturbance occurs in the power system, collect the frequency change rate RoCoF of all synchronous machines and virtual synchronous machines connected to the power system at that time, as well as the deviation between the current active power and the steady-state active power. Deviation between current frequency and rated frequency The system records the actual inertia values of the synchronous machine and the virtual synchronous machine each time an active power disturbance occurs. The equivalent inertia of the system is calculated using these actual inertia values, and the frequency change rate RoCoF and active power deviation are then considered. Frequency deviation The system's equivalent inertia is used as the label data to construct a dataset; S2: Construct and pre-train a one-dimensional convolutional neural network 1D-CNN. Use the dataset described in step S1 to pre-train the constructed 1D-CNN. After pre-training, freeze the weights and bias parameters of the 1D-CNN so that they remain unchanged during subsequent training, use and retraining. Then use the 1D-CNN as a temporal local feature extractor of the system's equivalent inertia to output temporal local features. S3: Construct a multilayer perceptron (MLP) and train it in conjunction with the 1D-CNN described in step S2. Use the dataset described in step S1 as training data, take the output temporal local features of the 1D-CNN described in step S2 as the input features of the MLP input layer, and use the system equivalent inertia as the label to complete the training of the entire neural network, including the 1D-CNN and MLP with frozen weights and bias parameters. S4: Construct a fast adaptive estimation method for the equivalent inertia of the power system. The entire neural network, including 1D-CNN and MLP, trained in step S3 is used as the system equivalent inertia estimation model. The feature data is input into the 1D-CNN, which extracts the temporal local feature matrix. The temporal local feature matrix is pooled and flattened to obtain the feature vector. The feature vector is then input into the MLP, which calculates the estimated value of the system equivalent inertia. S5: Run the fast adaptive estimation method of the equivalent inertia of the power system described in step S4 online and continuously update the parameters. During the operation, whenever the operating conditions of the power system change, after obtaining the true value of the equivalent inertia of the system, determine whether the error between the estimated value of the equivalent inertia of the system calculated by the MLP and the true value exceeds a preset threshold. If it exceeds the threshold, retrain the entire neural network including 1D-CNN and MLP. During the retraining process, keep the weights and bias parameters of 1D-CNN unchanged, and use the barnacle optimization algorithm to quickly search and update the hyperparameters of the MLP.
[0005] In this solution, the specific method for constructing the dataset in step S1 is as follows: S1-1: Acquire characteristic data. Each time an active power disturbance occurs in the power system, collect the RoCoF of all synchronous machines and virtual synchronous machines connected to the power system at that time. For the i-th synchronous machine or virtual synchronous machine, the RoCoF time series data collected at the j-th disturbance constitutes the... The specific manifestations are as follows: (1) In equation (1), Represents the RoCoF value collected by the i-th synchronous machine or virtual synchronous machine at the K-th sampling time during the j-th disturbance in the power system, where i=1,2,…,N, N is the total number of synchronous machines and virtual synchronous machines connected to the power system, j=1,2,…,M, M is the total number of active disturbances, and T is the matrix transpose symbol; The first i In total, the number of physical or virtual synchronizers is... M The data collected during the first disturbance are integrated to obtain the second... i RoCoF datasets from a single synchronizer or virtual synchronizer The specific representation is as follows: (2) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (3) Whenever an active power disturbance occurs in the power system, the deviation between the active power and the steady-state active power at the grid connection points of all synchronous machines and virtual synchronous machines connected to the power system at that time is collected. For the i-th synchronizer or virtual synchronizer, at the j-th disturbance, the collected data is... Time series data The specific manifestations are as follows: (4) In formula (4) This represents the power deviation value collected by the i-th synchronous machine at the K-th sampling time when the j-th disturbance occurs in the power system; The data collected by the i-th synchronizer or virtual synchronizer during a total of M disturbances are integrated to obtain the data of the i-th synchronizer or virtual synchronizer. Dataset The specific representation is as follows: (5) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (6) Each time an active power disturbance occurs in the power system, the frequency deviation from the rated frequency of all synchronous machines and virtual synchronous machines connected to the power system at that time is collected. For the i-th synchronizer or virtual synchronizer, at the j-th disturbance, the collected data is... Time series data The specific manifestations are as follows: (7) In formula (7) This represents the frequency deviation value collected by the i-th synchronous machine at the K-th sampling time when the j-th disturbance occurs in the power system; The data collected by the i-th synchronizer or virtual synchronizer during a total of M disturbances are integrated to obtain the data of the i-th synchronizer or virtual synchronizer. Dataset The specific representation is as follows: (8) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (9) S1-2: Obtain tag data. For the j-th disturbance described in step S1-1, record the inertia of the i-th synchronous machine or virtual synchronous machine connected to the power system during this disturbance. At the same time, obtain its rated capacity The equivalent inertia of the system for each disturbance is calculated. Its specific form of expression is: (10) In equation (10), S i This represents the rated capacity of the i-th synchronizer or virtual synchronizer. This represents the actual inertia value of the i-th synchronizer or virtual synchronizer during this disturbance; The system's equivalent inertia for each disturbance After integration, a labeled dataset is obtained, which is specifically represented as follows: (11) In formula (11) This represents the system's equivalent inertia calculated for the Mth disturbance. S1-3: The frequency change rate RoCoF dataset described in step S1-1... Power deviation dataset and frequency bias dataset Constructing the feature dataset X o Its specific form is as follows: (12) In this scheme, the specific method for constructing and pre-training a one-dimensional convolutional neural network (1D-CNN) in step S2 is as follows: S2-1: Construct a 1D-CNN network framework, including an input layer, a processing unit, a flattening layer, and a temporary regression layer; S2-2: Set up the input layer described in step S2-1 to receive the dataset; S2-3: Set up the processing unit described in step S2-1. The processing unit consists of two convolutional layers, two activation layers and one pooling layer. Specifically, the convolutional layers and activation layers are connected alternately first, and the pooling layer performs average pooling at the end. The convolutional layer uses a one-dimensional convolutional kernel that slides along the time dimension to perform convolution operations on the input data, outputting a multi-channel feature map, the specific form of which is as follows: (13) In formula (13) For the first The output feature map of the convolutional layer. For the first Layer convolution kernel weights, If the output feature map of the previous layer is... =1, then For the input data of the input layer, For the first Layer bias term; The activation layer performs a non-linear mapping on the output feature map of the preceding convolutional layer, which is expressed as follows: (14) In formula (14) =1,2, For the first Feature map after activation layer processing; The feature map output from the second activation layer is input into the pooling layer for average pooling. Its specific form is as follows: (15) In formula (15) This is the output at position t after average pooling. For the pooling window length, The index is within the window, p=0,1,…,P-1; The pooling window slides along the time dimension, and average pooling is performed at each position t according to equation (15) to obtain the pooling output feature sequence; S2-4: Set up the flattening layer described in S2-1 to flatten the feature sequence output by average pooling in S2-3, thereby obtaining the feature vector. ; S2-5: Set up the temporary regression layer described in S2-1 for pre-training. Input the feature vector described in S2-4 into the temporary regression layer for regression calculation. Its specific expression is as follows: (16) In formula (16) This is the estimated equivalent inertia of the system output by the temporary regression layer. This is the weight vector of the temporary regression layer. The pooling output is the flattened feature vector. This is the bias for the temporary regression layer; S2-6: The Adam optimizer is used to pre-train the 1D-CNN, the backpropagation algorithm is used to calculate the network gradient, and the weights and biases of each layer are updated through the Adam optimizer. S2-7: After the 1D-CNN is pre-trained through step S2-6, the weights and bias parameters of the 1D-CNN feature extraction part are frozen so that the parameters remain unchanged in the subsequent online running stage. At the same time, the temporary regression layer is removed, and the 1D-CNN is used as a temporal local feature extractor to output temporal local features.
[0006] In this scheme, step S3 involves constructing a multilayer perceptron (MLP) and training it in conjunction with the 1D-CNN described in step S2. The specific method is as follows: S3-1: Construct a multilayer perceptron (MLP) network containing an input layer, several hidden layers, and an output layer; S3-2: The MLP input layer receives the feature vector obtained after flattening the 1D-CNN described in step S2-4, and inputs the received feature vector into the MLP hidden layer. In the hidden layer, a non-linear activation function is used to perform a one-step abstraction and mapping of the features, where the output z of the k-th hidden layer... k The expression is as follows: (17) In formula (17) Let k be the output vector of the k-th hidden layer. For activation function, Let be the weight matrix of the k-th hidden layer. Let be the bias matrix of the k-th hidden layer. This is the output vector of the (k-1)th hidden layer. When k=1 The input vector of the input layer; S3-3: Convert the output vector of the last hidden layer... The value is sent to the output layer, where the estimated value of the equivalent inertia of the power system is calculated. Its specific expression is as follows: (18) In formula (18) This is the final output of the output layer, i.e., the estimated equivalent inertia of the system. The weight matrix of the output layer. This is the output vector of the last hidden layer. This is the output bias matrix; S3-4: Establish the objective function J required for pre-training, its specific form is as follows: (19) In equation (19) This represents the total number of active disturbances. This is the estimated equivalent inertia of the system when the j-th disturbance occurs. This represents the true equivalent inertia of the system when the j-th disturbance occurs. S3-5: Pre-train the 1D-CNN combined with MLP described in step S2. During the training process, keep the 1D-CNN parameters unchanged and use the minimization of the objective function J as the optimization index to search for the optimal MLP weight parameters in the parameter space.
[0007] In this scheme, the online operation of the fast adaptive estimation method for the equivalent inertia of the power system and the continuous updating of parameters described in step S5 are as follows: S5-1: When a disturbance occurs in the power system, obtain the frequency change rate RoCoF and active power deviation of all synchronous machines and virtual synchronous machines connected to the power system at their grid connection points. Frequency deviation The three feature data are used to estimate the equivalent inertia of the power system using the fast adaptive estimation method of power system equivalent inertia composed of 1D-CNN and MLP described in step S4. S5-2: Obtain the rated capacity of all synchronous machines and virtual synchronous machines connected to the power system, and calculate the equivalent inertia of the system under disturbance using a mechanistic model-based method. The specific calculation method is as follows: (20) In equation (20) For the rated frequency, The active power deviation is the active power deviation of all synchronous machines and virtual synchronous machines in the system. The sum; The system center frequency is calculated as follows: (twenty one) In equation (21) Let i be the rated capacity of the i-th synchronizer or virtual synchronizer. Let be the real-time frequency of the i-th synchronizer or virtual synchronizer; S5-3: Calculate the system equivalent inertia from step S5-2. The system equivalent inertia estimate is compared with the output of the entire neural network, including 1D-CNN and MLP, and the relative error between the two is calculated. If the error exceeds the preset threshold, the entire neural network, including 1D-CNN and MLP, is retrained. During the retraining process, the weight parameters of 1D-CNN are kept unchanged, and the barnacle optimization algorithm is used to quickly search and update the hyperparameters of MLP. S5-4: Encode the MLP hyperparameters to be optimized into individual vectors X of barnacles. bmo In the search space [ , Random initialization within] 100 barnacle individuals were used as the initial population, among which and Let X be the lower and upper bounds of the hyperparameter vector, and let X be the value of each barnacle individual. bmo This represents a set of MLP hyperparameter configurations for the current new operating conditions, and its specific expression is as follows: (twenty two) In equation (22), x1 is the fine-tuning learning rate of the MLP layer, x2 is the activation threshold of the neurons in the hidden layer of the MLP, x3 is the momentum factor for updating the weights of the MLP, and x4 is the number of hidden layers of the MLP. S5-5: Define the fitness function Its specific form of expression is as follows: (twenty three) In formula (23) The number of samples in the new sample set that includes this perturbation. This is the actual equivalent inertia value of the system obtained through calculation. To use hyperparameter configuration The inertia estimate output by the MLP model, The smaller the value, the better the adaptability; S5-6: The barnacle algorithm simulates the mating characteristics of barnacles based on genital length. The algorithm sorts the population in ascending order according to the fitness of individuals, and regards the individuals at the beginning of the sequence, i.e., those with better fitness, as parents. The remaining individuals with poor fitness were considered as the maternal generation. Calculate the genital length of each parent barnacle, expressed mathematically as follows: (twenty four) In equation (24), PL b For the first The length of the genitals of the paternal barnacles. X is the ratio coefficient of genital length, responsible for adjusting the search radius.best It is the globally optimal individual. To prevent extremely small real numbers from being divided by zero; S5-7: If the PL of the male barnacle can reach the female barnacle, that is, the condition of formula (25) is met, then mating will take place. After mating, the position of the offspring barnacle will be updated according to formula (26): (25) (26) In equation (25), b represents the parent barnacle in the current iteration loop. The index position, m is the female barnacle in the population. The index position allows poorly fit parent individuals to perform local searches by mating with neighboring parent individuals, while well-fit parent individuals can perform global searches by mating with distant parent individuals. In equation (26) For the new parameter set, Controlling the ratio of genes inherited from the father and mother and The genes from the father and mother generations are respectively, which are the two sets of MLP hyperparameters; If the PL of the male barnacle cannot reach the female barnacle, i.e., the condition of formula (25) is not met, then self-fertilization occurs, resulting in mutation and parameter self-updating. Its specific mathematical expression is as follows: (27) In equation (27) The coefficient of variation is 1. This indicates element-wise multiplication. It is a random vector that follows a standard normal distribution; S5-8: Repeat steps S5-5 and S5-7 until the maximum number of iterations is reached or the error value is less than the preset threshold. The globally optimal individual in each iteration is updated using the following formula: (28) After the iteration ends, the current best individual X is... best The parameters are applied to the MLP layer; S5-9: Whenever a disturbance occurs in the power system, execute steps S5-1 to S5-3. When the error determined by S5-3 exceeds the preset threshold, execute steps S5-4 to S5-8 to update the MLP hyperparameters again.
[0008] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention proposes a fast adaptive estimation method for the equivalent inertia of a power system. After pre-training a 1D-CNN and freezing its weight parameters, it is used as a temporal local feature extractor in conjunction with an MLP. When the operating conditions change and the error exceeds a preset threshold, the network is retrained using a barnacle optimization algorithm. During retraining, the 1D-CNN weight parameters remain unchanged, and only the hyperparameters of the MLP are quickly searched and updated, reducing the number of parameters requiring retraining and significantly improving the retraining speed. After retraining, when the neural network encounters the same operating conditions again, it can accurately estimate the equivalent inertia of the system, balancing accuracy and speed. Attached Figure Description
[0009] Figure 1 This is a flowchart of a fast adaptive estimation method for the equivalent inertia of a power system proposed in this invention. Detailed Implementation
[0010] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0011] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0012] In a specific embodiment, such as Figure 1 As shown, a fast adaptive estimation method for the equivalent inertia of a power system includes the following steps: S1: Construct a dataset. Whenever an active power disturbance occurs in the power system, collect the frequency change rate RoCoF of all synchronous machines and virtual synchronous machines connected to the power system at that time, as well as the deviation between the current active power and the steady-state active power. Deviation between current frequency and rated frequency The system records the actual inertia values of the synchronous machine and the virtual synchronous machine each time an active power disturbance occurs. The equivalent inertia of the system is calculated using these actual inertia values, and the frequency change rate RoCoF and active power deviation are then considered. Frequency deviation The system's equivalent inertia is used as the label data to construct a dataset; S2: Construct and pre-train a one-dimensional convolutional neural network 1D-CNN. Use the dataset described in step S1 to pre-train the constructed 1D-CNN. After pre-training, freeze the weights and bias parameters of the 1D-CNN so that they remain unchanged during subsequent training, use and retraining. Then use the 1D-CNN as a temporal local feature extractor of the system's equivalent inertia to output temporal local features. S3: Construct a multilayer perceptron (MLP) and train it in conjunction with the 1D-CNN described in step S2. Use the dataset described in step S1 as training data, take the output temporal local features of the 1D-CNN described in step S2 as the input features of the MLP input layer, and use the system equivalent inertia as the label to complete the training of the entire neural network, including the 1D-CNN and MLP with frozen weights and bias parameters. S4: Construct a fast adaptive estimation method for the equivalent inertia of the power system. The entire neural network, including 1D-CNN and MLP, trained in step S3 is used as the system equivalent inertia estimation model. The feature data is input into the 1D-CNN, which extracts the temporal local feature matrix. The temporal local feature matrix is pooled and flattened to obtain the feature vector. The feature vector is then input into the MLP, which calculates the estimated value of the system equivalent inertia. S5: Run the fast adaptive estimation method of the equivalent inertia of the power system described in step S4 online and continuously update the parameters. During the operation, whenever the operating conditions of the power system change, after obtaining the true value of the equivalent inertia of the system, determine whether the error between the estimated value of the equivalent inertia of the system calculated by the MLP and the true value exceeds a preset threshold. If it exceeds the threshold, retrain the entire neural network including 1D-CNN and MLP. During the retraining process, keep the weights and bias parameters of 1D-CNN unchanged, and use the barnacle optimization algorithm to quickly search and update the hyperparameters of the MLP.
[0013] In this example, the specific method for constructing the dataset in step S1 is as follows: S1-1: Acquire characteristic data. Each time an active power disturbance occurs in the power system, collect the RoCoF of all synchronous machines and virtual synchronous machines connected to the power system at that time. For the i-th synchronous machine or virtual synchronous machine, the RoCoF time series data collected at the j-th disturbance constitutes the... The specific manifestations are as follows: (1) In equation (1), Represents the RoCoF value collected by the i-th synchronous machine or virtual synchronous machine at the K-th sampling time during the j-th disturbance in the power system, where i=1,2,…,N, N is the total number of synchronous machines and virtual synchronous machines connected to the power system, j=1,2,…,M, M is the total number of active disturbances, and T is the matrix transpose symbol; The data collected by the i-th synchronizer or virtual synchronizer during a total of M disturbances are integrated to obtain the RoCoF dataset of the i-th synchronizer or virtual synchronizer. The specific representation is as follows: (2) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (3) Whenever an active power disturbance occurs in the power system, the deviation between the active power and the steady-state active power at the grid connection points of all synchronous machines and virtual synchronous machines connected to the power system at that time is collected. For the i-th synchronizer or virtual synchronizer, at the j-th disturbance, the collected data is... Time series data The specific manifestations are as follows: (4) In formula (4) This represents the power deviation value collected by the i-th synchronous machine at the K-th sampling time when the j-th disturbance occurs in the power system; The data collected by the i-th synchronizer or virtual synchronizer during a total of M disturbances are integrated to obtain the data of the i-th synchronizer or virtual synchronizer. Dataset The specific representation is as follows: (5) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (6) Each time an active power disturbance occurs in the power system, the frequency deviation from the rated frequency of all synchronous machines and virtual synchronous machines connected to the power system at that time is collected. For the i-th synchronizer or virtual synchronizer, at the j-th disturbance, the collected data is... Time series data The specific manifestations are as follows: (7) In formula (7) This represents the frequency deviation value collected by the i-th synchronous machine at the K-th sampling time when the j-th disturbance occurs in the power system; The data collected by the i-th synchronizer or virtual synchronizer during a total of M disturbances are integrated to obtain the data of the i-th synchronizer or virtual synchronizer. Dataset The specific representation is as follows: (8) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (9) S1-2: Obtain tag data. For the j-th disturbance described in step S1-1, record the inertia of the i-th synchronous machine or virtual synchronous machine connected to the power system during this disturbance. At the same time, obtain its rated capacity The equivalent inertia of the system for each disturbance is calculated. Its specific form of expression is: (10) In equation (10), S i This represents the rated capacity of the i-th synchronizer or virtual synchronizer. This represents the actual inertia value of the i-th synchronizer or virtual synchronizer during this disturbance; The system's equivalent inertia for each disturbance After integration, a labeled dataset is obtained, which is specifically represented as follows: (11) In formula (11) This represents the system's equivalent inertia calculated for the Mth disturbance. S1-3: The frequency change rate RoCoF dataset described in step S1-1... Power deviation dataset and frequency bias dataset Constructing the feature dataset X o Its specific form is as follows: (12) In this example, the specific implementation method for constructing and pre-training the one-dimensional convolutional neural network 1D-CNN in step S2 is as follows: S2-1: Construct a 1D-CNN network framework, including an input layer, a processing unit, a flattening layer, and a temporary regression layer; S2-2: Set up the input layer described in step S2-1 to receive the dataset; S2-3: Set up the processing unit described in step S2-1. The processing unit consists of two convolutional layers, two activation layers and one pooling layer. Specifically, the convolutional layers and activation layers are connected alternately first, and the pooling layer performs average pooling at the end. The convolutional layer uses a one-dimensional convolutional kernel that slides along the time dimension to perform convolution operations on the input data, outputting a multi-channel feature map, the specific form of which is as follows: (13) In formula (13) For the first The output feature map of the convolutional layer. For the first Layer convolution kernel weights, If the output feature map of the previous layer is... =1, then For the input data of the input layer, For the first Layer bias term; The activation layer performs a non-linear mapping on the output feature map of the preceding convolutional layer, which is expressed as follows: (14) In formula (14) =1,2, For the first Feature map after activation layer processing; The feature map output from the second activation layer is input into the pooling layer for average pooling. Its specific form is as follows: (15) In formula (15) This is the output at position t after average pooling. For the pooling window length, The index is within the window, p=0,1,…,P-1; The pooling window slides along the time dimension, and average pooling is performed at each position t according to equation (15) to obtain the pooling output feature sequence; S2-4: Set up the flattening layer described in S2-1 to flatten the feature sequence output by average pooling in S2-3, thereby obtaining the feature vector. ; S2-5: Set up the temporary regression layer described in S2-1 for pre-training. Input the feature vector described in S2-4 into the temporary regression layer for regression calculation. Its specific expression is as follows: (16) In formula (16) This is the estimated equivalent inertia of the system output by the temporary regression layer. This is the weight vector of the temporary regression layer. The pooling output is the flattened feature vector. This is the bias for the temporary regression layer; S2-6: The Adam optimizer is used to pre-train the 1D-CNN, the backpropagation algorithm is used to calculate the network gradient, and the weights and biases of each layer are updated through the Adam optimizer. S2-7: After the 1D-CNN is pre-trained through step S2-6, the weights and bias parameters of the 1D-CNN feature extraction part are frozen so that the parameters remain unchanged in the subsequent online running stage. At the same time, the temporary regression layer is removed, and the 1D-CNN is used as a temporal local feature extractor to output temporal local features.
[0014] In this example, the method for constructing a multilayer perceptron (MLP) and training it in conjunction with the 1D-CNN described in step S2 is as follows: S3-1: Construct a multilayer perceptron (MLP) network containing an input layer, several hidden layers, and an output layer; S3-2: The MLP input layer receives the feature vector obtained after flattening the 1D-CNN described in step S2-4, and inputs the received feature vector into the MLP hidden layer. In the hidden layer, a non-linear activation function is used to perform a one-step abstraction and mapping of the features, where the output z of the k-th hidden layer... k The expression is as follows: (17) In formula (17) Let k be the output vector of the k-th hidden layer. For activation function, Let be the weight matrix of the k-th hidden layer. Let be the bias matrix of the k-th hidden layer. This is the output vector of the (k-1)th hidden layer. When k=1 The input vector of the input layer; S3-3: Convert the output vector of the last hidden layer... The value is sent to the output layer, where the estimated value of the equivalent inertia of the power system is calculated. Its specific expression is as follows: (18) In formula (18) This is the final output of the output layer, i.e., the estimated equivalent inertia of the system. The weight matrix of the output layer. This is the output vector of the last hidden layer. This is the output bias matrix; S3-4: Establish the objective function J required for pre-training, its specific form is as follows: (19) In equation (19) This represents the total number of active disturbances. This is the estimated equivalent inertia of the system when the j-th disturbance occurs. This represents the true equivalent inertia of the system when the j-th disturbance occurs. S3-5: Pre-train the 1D-CNN combined with MLP described in step S2. During the training process, keep the 1D-CNN parameters unchanged and use the minimization of the objective function J as the optimization index to search for the optimal MLP weight parameters in the parameter space.
[0015] In this scheme, the online operation of the fast adaptive estimation method for the equivalent inertia of the power system and the continuous updating of parameters described in step S5 are as follows: S5-1: When a disturbance occurs in the power system, obtain the frequency change rate RoCoF and active power deviation of all synchronous machines and virtual synchronous machines connected to the power system at their grid connection points. Frequency deviation The three feature data are used to estimate the equivalent inertia of the power system using the fast adaptive estimation method of power system equivalent inertia composed of 1D-CNN and MLP described in step S4. S5-2: Obtain the rated capacity of all synchronous machines and virtual synchronous machines connected to the power system, and calculate the equivalent inertia of the system under disturbance using a mechanistic model-based method. The specific calculation method is as follows: (20) In equation (20) For the rated frequency, The active power deviation is the active power deviation of all synchronous machines and virtual synchronous machines in the system. The sum; The system center frequency is calculated as follows: (twenty one) In equation (21) Let i be the rated capacity of the i-th synchronizer or virtual synchronizer. Let be the real-time frequency of the i-th synchronizer or virtual synchronizer; S5-3: Calculate the system equivalent inertia from step S5-2. The system equivalent inertia estimate is compared with the output of the entire neural network, including 1D-CNN and MLP, and the relative error between the two is calculated. If the error exceeds the preset threshold, the entire neural network, including 1D-CNN and MLP, is retrained. During the retraining process, the weight parameters of 1D-CNN are kept unchanged, and the barnacle optimization algorithm is used to quickly search and update the hyperparameters of MLP. S5-4: Encode the MLP hyperparameters to be optimized into individual vectors X of barnacles. bmo In the search space [ , Random initialization within] 100 barnacle individuals were used as the initial population, among which and Let X be the lower and upper bounds of the hyperparameter vector, and let X be the value of each barnacle individual. bmo This represents a set of MLP hyperparameter configurations for the current new operating conditions, and its specific expression is as follows: (twenty two) In equation (22), x1 is the fine-tuning learning rate of the MLP layer, x2 is the activation threshold of the neurons in the hidden layer of the MLP, x3 is the momentum factor for updating the weights of the MLP, and x4 is the number of hidden layers of the MLP. S5-5: Define the fitness function Its specific form of expression is as follows: (twenty three) In formula (23) The number of samples in the new sample set that includes this perturbation. This is the actual equivalent inertia value of the system obtained through calculation. To use hyperparameter configuration The inertia estimate output by the MLP model, The smaller the value, the better the adaptability; S5-6: The barnacle algorithm simulates the mating characteristics of barnacles based on genital length. The algorithm sorts the population in ascending order according to the fitness of individuals, and regards the individuals at the beginning of the sequence, i.e., those with better fitness, as parents. The remaining individuals with poor fitness were considered as the maternal generation. Calculate the genital length of each parent barnacle, expressed mathematically as follows: (twenty four) In equation (24), PL b For the first The length of the genitals of the paternal barnacles. X is the ratio coefficient of genital length, responsible for adjusting the search radius.best It is the globally optimal individual. To prevent extremely small real numbers from being divided by zero; S5-7: If the PL of the male barnacle can reach the female barnacle, that is, the condition of formula (25) is met, then mating will take place. After mating, the position of the offspring barnacle will be updated according to formula (26): (25) (26) In equation (25), b represents the parent barnacle in the current iteration loop. The index position, m is the female barnacle in the population. The index position allows poorly fit parent individuals to perform local searches by mating with neighboring parent individuals, while well-fit parent individuals can perform global searches by mating with distant parent individuals. In equation (26) For the new parameter set, Controlling the ratio of genes inherited from the father and mother and The genes from the father and mother generations are respectively, which are the two sets of MLP hyperparameters; If the PL of the male barnacle cannot reach the female barnacle, i.e., the condition of formula (25) is not met, then self-fertilization occurs, resulting in mutation and parameter self-updating. Its specific mathematical expression is as follows: (27) In equation (27) The coefficient of variation is 1. This indicates element-wise multiplication. It is a random vector that follows a standard normal distribution; S5-8: Repeat steps S5-5 and S5-7 until the maximum number of iterations is reached or the error value is less than the preset threshold. The globally optimal individual in each iteration is updated using the following formula: (28) After the iteration ends, the current best individual X is... best The parameters are applied to the MLP layer; S5-9: Whenever a disturbance occurs in the power system, execute steps S5-1 to S5-3. When the error determined by S5-3 exceeds the preset threshold, execute steps S5-4 to S5-8 to update the MLP hyperparameters again.
[0016] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A fast adaptive estimation method for the equivalent inertia of a power system, characterized in that, The specific steps are as follows: S1: Construct a dataset. Whenever an active power disturbance occurs in the power system, collect the frequency change rate RoCoF of all synchronous machines and virtual synchronous machines connected to the power system at that time, as well as the deviation between the current active power and the steady-state active power. Deviation between current frequency and rated frequency The system records the actual inertia values of the synchronous machine and the virtual synchronous machine each time an active power disturbance occurs. The equivalent inertia of the system is calculated using these actual inertia values, and the frequency change rate RoCoF and active power deviation are then considered. Frequency deviation The system's equivalent inertia is used as the label data to construct a dataset; S2: Construct and pre-train a one-dimensional convolutional neural network 1D-CNN. Use the dataset described in step S1 to pre-train the constructed 1D-CNN. After pre-training, freeze the weights and bias parameters of the 1D-CNN so that they remain unchanged during subsequent training, use and retraining. Then use the 1D-CNN as a temporal local feature extractor of the system's equivalent inertia to output temporal local features. S3: Construct a multilayer perceptron (MLP) and train it in conjunction with the 1D-CNN described in step S2. Use the dataset described in step S1 as training data, take the output temporal local features of the 1D-CNN described in step S2 as the input features of the MLP input layer, and use the system equivalent inertia as the label to complete the training of the entire neural network, including the 1D-CNN and MLP with frozen weights and bias parameters. S4: Construct a fast adaptive estimation method for the equivalent inertia of the power system. The entire neural network, including 1D-CNN and MLP, trained in step S3 is used as the system equivalent inertia estimation model. The feature data is input into the 1D-CNN, which extracts the temporal local feature matrix. The temporal local feature matrix is pooled and flattened to obtain the feature vector. The feature vector is then input into the MLP, which calculates the estimated value of the system equivalent inertia. S5: Run the fast adaptive estimation method of the equivalent inertia of the power system described in step S4 online and continuously update the parameters. During the operation, whenever the operating conditions of the power system change, after obtaining the true value of the equivalent inertia of the system, determine whether the error between the estimated value of the equivalent inertia of the system calculated by the MLP and the true value exceeds a preset threshold. If it exceeds the threshold, retrain the entire neural network including 1D-CNN and MLP. During the retraining process, keep the weights and bias parameters of 1D-CNN unchanged, and use the barnacle optimization algorithm to quickly search and update the hyperparameters of the MLP.
2. The fast adaptive estimation method for equivalent inertia of a power system according to claim 1, characterized in that, The specific steps for constructing the dataset described in step S1 are as follows: S1-1: Acquire feature data. Each time an active power disturbance occurs in the power system, collect the RoCoF of all synchronous machines and virtual synchronous machine grid connection endpoints connected to the power system at that time. For the [missing information], [missing information]... A physical or virtual synchronizer, in the first... The RoCoF time series data collected during the second perturbation constitutes... The specific manifestations are as follows: (1) In equation (1), Indicates the first In the power system, a synchronous machine or virtual synchronous machine is used in the first stage. During the perturbation, the RoCoF value collected at the Kth sampling time is as follows: =1,2,…,N, where N is the total number of synchronous machines and virtual synchronous machines connected to the power system. =1,2,…,M, where M is the total number of active disturbances and T is the matrix transpose symbol; The first The data collected by the synchro or virtual synchro during a total of M disturbances are integrated to obtain the first... RoCoF datasets from a single synchronizer or virtual synchronizer The specific representation is as follows: (2) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (3) Whenever an active power disturbance occurs in the power system, the deviation between the active power and the steady-state active power at the grid connection points of all synchronous machines and virtual synchronous machines connected to the power system at that time is collected. For the first one A physical or virtual synchronizer, in the first... During the second disturbance, the collected data Time series data The specific manifestations are as follows: (4) In formula (4) Indicates the first The synchronous machine was in the power system when the first The power deviation value obtained at the Kth sampling time during the perturbation; The first The data collected by the synchro or virtual synchro during a total of M disturbances are integrated to obtain the first... Taiwan-based or virtual synchronizer Dataset The specific representation is as follows: (5) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (6) Each time an active power disturbance occurs in the power system, the frequency deviation from the rated frequency of all synchronous machines and virtual synchronous machines connected to the power system at that time is collected. For the first one A physical or virtual synchronizer, in the first... During the second disturbance, the collected data Time series data The specific manifestations are as follows: (7) In formula (7) Indicates the first The synchronous machine was in the power system when the first The frequency deviation value collected at the Kth sampling time during the perturbation; The first The data collected by the synchro or virtual synchro during a total of M disturbances are integrated to obtain the first... Taiwan-based or virtual synchronizer Dataset The specific representation is as follows: (8) The data collected from all synchronous machines connected to the power system and the virtual synchronous machine By integrating the data, we obtain the dataset. Its specific form of expression is: (9) S1-2: Obtain tag data, for the step described in S1-1... The first disturbance, recording the number of times the power system was connected during this disturbance. Inertia of a physical or virtual synchronizer At the same time, obtain its rated capacity The equivalent inertia of the system for each disturbance is calculated. Its specific form of expression is: (10) In formula (10) Indicates the first The rated capacity of a physical or virtual synchronizer. Indicates the first The actual inertia value of the physical or virtual synchronizer during this disturbance; The system's equivalent inertia for each disturbance After integration, a labeled dataset is obtained, which is specifically represented as follows: (11) In formula (11) This represents the system's equivalent inertia calculated for the Mth disturbance. S1-3: The frequency change rate RoCoF dataset described in step S1-1... Power deviation dataset and frequency bias dataset Constructing the feature dataset X o Its specific form is as follows: (12)。 3. The fast adaptive estimation method for equivalent inertia of a power system according to claim 1, characterized in that, Step S2 involves constructing and pre-training a one-dimensional convolutional neural network (1D-CNN), and the specific steps are as follows: S2-1: Construct a 1D-CNN network framework, including an input layer, a processing unit, a flattening layer, and a temporary regression layer; S2-2: Set up the input layer described in step S2-1 to receive the dataset; S2-3: Set up the processing unit described in step S2-1. The processing unit consists of two convolutional layers, two activation layers and one pooling layer. Specifically, the convolutional layers and activation layers are connected alternately first, and the pooling layer performs average pooling at the end. The convolutional layer uses a one-dimensional convolutional kernel that slides along the time dimension to perform convolution operations on the input data, outputting a multi-channel feature map, the specific form of which is as follows: (13) In formula (13) For the first The output feature map of the convolutional layer. For the first Layer convolution kernel weights, If the output feature map of the previous layer is... =1, then For the input data of the input layer, For the first Layer bias term; The activation layer performs a non-linear mapping on the output feature map of the preceding convolutional layer, which is expressed as follows: (14) In formula (14) =1,2, For the first Feature map after activation layer processing; The feature map output from the second activation layer is input into the pooling layer for average pooling. Its specific form is as follows: (15) In formula (15) For average pooling at position The output, For the pooling window length, For in-window indexing, ; The pooling window slides along the time dimension, for each position Average pooling is performed according to equation (15) to obtain the pooled output feature sequence; S2-4: Set up the flattening layer described in S2-1 to flatten the feature sequence output by average pooling in S2-3, thereby obtaining the feature vector. ; S2-5: Set up the temporary regression layer described in S2-1 for pre-training. Input the feature vector described in S2-4 into the temporary regression layer for regression calculation. Its specific expression is as follows: (16) In formula (16) This is the estimated equivalent inertia of the system output by the temporary regression layer. This is the weight vector of the temporary regression layer. The pooling output is the flattened feature vector. This is the bias for the temporary regression layer; S2-6: The Adam optimizer is used to pre-train the 1D-CNN, the backpropagation algorithm is used to calculate the network gradient, and the weights and biases of each layer are updated through the Adam optimizer. S2-7: After the 1D-CNN is pre-trained through step S2-6, the weights and bias parameters of the 1D-CNN feature extraction part are frozen so that the parameters remain unchanged in the subsequent online running stage. At the same time, the temporary regression layer is removed, and the 1D-CNN is used as a temporal local feature extractor to output temporal local features.
4. The fast adaptive estimation method for equivalent inertia of a power system according to claim 1, characterized in that, Step S3 involves constructing a multilayer perceptron (MLP) and training it in conjunction with the 1D-CNN described in step S2. The specific steps are as follows: S3-1: Construct a multilayer perceptron (MLP) network containing an input layer, several hidden layers, and an output layer; S3-2: The MLP input layer receives the feature vector obtained after flattening the 1D-CNN described in step S2-4, and inputs the received feature vector into the MLP hidden layer. In the hidden layer, a non-linear activation function is used to perform a one-step abstraction and mapping of the features, where the output of the k-th hidden layer... The expression is as follows: (17) In formula (17) Let k be the output vector of the k-th hidden layer. For activation function, Let be the weight matrix of the k-th hidden layer. Let be the bias matrix of the k-th hidden layer. This is the output vector of the (k-1)th hidden layer. When k=1 The input vector of the input layer; S3-3: Convert the output vector of the last hidden layer... The value is sent to the output layer, where the estimated value of the equivalent inertia of the power system is calculated. Its specific expression is as follows: (18) In formula (18) This is the final output of the output layer, i.e., the estimated equivalent inertia of the system. The weight matrix of the output layer. This is the output vector of the last hidden layer. This is the output bias matrix; S3-4: Establish the objective function required for pre-training Its specific form of expression is as follows: (19) In equation (19) This represents the total number of active disturbances. For the system to occur the first Estimated equivalent inertia at the time of the second disturbance For the system to occur the first The true value of the equivalent inertia at the time of the second disturbance; S3-5: Pre-train the 1D-CNN combined with MLP described in step S2. During the training process, keep the 1D-CNN parameters unchanged and use the objective function... Minimization is used as the optimization metric, and the optimal MLP weight parameters are searched in the parameter space.
5. The fast adaptive estimation method for equivalent inertia of a power system according to claim 1, characterized in that, Step S5 describes the online operation of the fast adaptive estimation method for the equivalent inertia of the power system and the continuous updating of parameters. The specific steps are as follows: S5-1: When a disturbance occurs in the power system, obtain the frequency change rate RoCoF and active power deviation of all synchronous machines and virtual synchronous machines connected to the power system at their grid connection points. Frequency deviation The three feature data are used to estimate the equivalent inertia of the power system using the fast adaptive estimation method of power system equivalent inertia composed of 1D-CNN and MLP described in step S4. S5-2: Obtain the rated capacity of all synchronous machines and virtual synchronous machines connected to the power system, and calculate the equivalent inertia of the system under disturbance using a mechanistic model-based method. The specific calculation method is as follows: (20) In equation (20) For the rated frequency, The active power deviation is the active power deviation of all synchronous machines and virtual synchronous machines in the system. The sum; The system center frequency is calculated as follows: (21) In equation (21) For the first The rated capacity of a physical or virtual synchronizer. For the first The real-time frequency of a physical or virtual synchronizer; S5-3: Calculate the system equivalent inertia from step S5-2. The system equivalent inertia estimate is compared with the output of the entire neural network, including 1D-CNN and MLP, and the relative error between the two is calculated. If the error exceeds the preset threshold, the entire neural network, including 1D-CNN and MLP, is retrained. During the retraining process, the weight parameters of 1D-CNN are kept unchanged, and the barnacle optimization algorithm is used to quickly search and update the hyperparameters of MLP. S5-4: Encode the MLP hyperparameters to be optimized into individual vectors X of barnacles. bmo In the search space [ , Random initialization within] 100 barnacle individuals were used as the initial population, among which and Let X be the lower and upper bounds of the hyperparameter vector, and let X be the value of each barnacle individual. bmo This represents a set of MLP hyperparameter configurations for the current new operating conditions, and its specific expression is as follows: (22) In equation (22), x1 is the fine-tuning learning rate of the MLP layer, x2 is the activation threshold of the neurons in the hidden layer of the MLP, x3 is the momentum factor for updating the weights of the MLP, and x4 is the number of hidden layers of the MLP. S5-5: Define the fitness function Its specific form of expression is as follows: (23) In formula (23) The number of samples in the new sample set that includes this perturbation. This is the actual equivalent inertia value of the system obtained through calculation. To use hyperparameter configuration The inertia estimate output by the MLP model, The smaller the value, the better the adaptability; S5-6: The barnacle algorithm simulates the mating characteristics of barnacles based on genital length. The algorithm sorts the population in ascending order according to the fitness of individuals, and regards the individuals at the beginning of the sequence, i.e., those with better fitness, as parents. The remaining individuals with poor fitness were considered as the maternal generation. Calculate the genital length of each parent barnacle, expressed mathematically as follows: (24) In equation (24), PL b For the first The length of the genitals of the paternal barnacles. X is the ratio coefficient of genital length, responsible for adjusting the search radius. best It is the globally optimal individual. To prevent extremely small real numbers from being divided by zero; S5-7: If the PL of the male barnacle can reach the female barnacle, that is, the condition of formula (25) is met, then mating will take place. After mating, the position of the offspring barnacle will be updated according to formula (26): (25) (26) In equation (25), b represents the parent barnacle in the current iteration loop. The index position, m is the female barnacle in the population. The index position allows poorly fit parent individuals to perform local searches by mating with neighboring parent individuals, while well-fit parent individuals can perform global searches by mating with distant parent individuals. In equation (26) For the new parameter set, Controlling the ratio of genes inherited from the father and mother and The genes from the father and mother generations are respectively, which are the two sets of MLP hyperparameters; If the PL of the male barnacle cannot reach the female barnacle, i.e., the condition of formula (25) is not met, then self-fertilization occurs, resulting in mutation and parameter self-updating. Its specific mathematical expression is as follows: (27) In equation (27) The coefficient of variation is 1. This indicates element-wise multiplication. It is a random vector that follows a standard normal distribution; S5-8: Repeat steps S5-5 and S5-7 until the maximum number of iterations is reached or the error value is less than the preset threshold. The globally optimal individual in each iteration is updated using the following formula: (28) After the iteration ends, the current best individual X is... best The parameters are applied to the MLP layer; S5-9: Whenever a disturbance occurs in the power system, execute steps S5-1 to S5-3. When the error determined by S5-3 exceeds the preset threshold, execute steps S5-4 to S5-8 to update the MLP hyperparameters again.