CN117972343A - Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo - Google Patents

Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo Download PDF

Info

Publication number
CN117972343A
CN117972343A CN202410025623.8A CN202410025623A CN117972343A CN 117972343 A CN117972343 A CN 117972343A CN 202410025623 A CN202410025623 A CN 202410025623A CN 117972343 A CN117972343 A CN 117972343A
Authority
CN
China
Prior art keywords
probability
voltage sag
monte carlo
data
evaluation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410025623.8A
Other languages
Chinese (zh)
Inventor
杨发宇
何觅
蒋羽鹏
于振国
王新
张军
冯耀宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunnan Power Grid Co Ltd
Original Assignee
Yunnan Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunnan Power Grid Co Ltd filed Critical Yunnan Power Grid Co Ltd
Priority to CN202410025623.8A priority Critical patent/CN117972343A/en
Publication of CN117972343A publication Critical patent/CN117972343A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

The invention discloses a voltage sag probability evaluation method and a system based on Hamiltonian Monte Carlo, which relate to the technical field of electric energy quality and comprise the steps of collecting representative voltage sag event data so as to obtain a voltage waveform sample; setting random number seeds, target acceptance rate and gamma prior density distribution function parameters, and initializing related variables; sample generation is carried out by utilizing a Hamiltonian Monte Carlo sampling method, and parameter adjustment is carried out to meet the target acceptance rate; creating posterior density distribution functions, and carrying out probability density evaluation by combining Bayesian reasoning. According to the invention, hamiltonian mechanics is combined with a Monte Carlo method to generate voltage sag data of an electric power system, so that the problem of insufficient voltage sag data samples is solved, and then the probability density distribution of the generated data is evaluated, thereby realizing more accurate and reliable evaluation of the probability distribution of voltage sag events.

Description

Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo
Technical Field
The invention relates to the technical field of electric energy quality, in particular to a voltage sag probability evaluation method and system based on Hamiltonian Monte Carlo.
Background
Voltage sag is an unavoidable serious power quality problem of the power system, and the research on the occurrence probability of the voltage sag has important engineering significance for the reliability evaluation of the power system. The introduction of new energy and new load in the electric power system enhances the randomness of disturbance, which leads to the problem that the data distribution of voltage sag is estimated to become high-dimensional probability distribution, and the existing evaluation algorithms such as Monte Carlo (MC), markov chain Monte Carlo (Markov ChainMonte Carlo, MCMC) and the like can not ensure the evaluation precision and efficiency under the new condition, and the algorithm is influenced by different factors, so that the defects of random walk, low acceptance rate, slow convergence and the like are generally caused.
Although the MC method can effectively solve the problem of randomness or certainty of the voltage sag condition quantity, the efficiency of the method depends on the quantity of random variables, and a large number of scenes need to be simulated to generate enough samples under the condition of high dimensionality, so that the efficiency is greatly reduced. The monte carlo reject sampling Method (MCSRS) as one of the MC methods, its random walk nature and the feature of sampling from only a single region with high values results in a difference in convergence speed, which may require multiple attempts to generate an independent sample. The MCMC method builds a markov chain mask chain associated with the target distribution such that random walk is performed according to the target probability distribution to reduce the number of simulations. However, the random walk behavior of the Markov chain is affected by the structure of the objective function, which may lead to walk failure. The Metropolis-Hastings algorithm realizes automatic construction of transformation relation according to target distribution on the basis of an MCMC method, but the random process can be moved out of the target set boundary under the condition of high dimensionality with high probability.
Disclosure of Invention
The invention is provided in view of the problems of random walk, low acceptance rate, slow convergence and the like of the existing evaluation algorithms such as the Monte Carlo method and the Markov chain Monte Carlo method.
Therefore, the problem to be solved by the invention is how to apply the hamilton monte carlo sampling method to the generation of the voltage sag frequency data of the power system and evaluate and analyze the probability density distribution of the voltage sag generation data.
In order to solve the technical problems, the invention provides the following technical scheme:
In a first aspect, an embodiment of the present invention provides a method for evaluating probability of voltage sag based on hamilton monte carlo, including collecting representative voltage sag event data to obtain a voltage waveform sample; setting random number seeds, target acceptance rate and gamma prior density distribution function parameters, and initializing related variables; sample generation is carried out by utilizing a Hamiltonian Monte Carlo sampling method, and parameter adjustment is carried out to meet the target acceptance rate; creating posterior density distribution functions, and carrying out probability density evaluation by combining Bayesian reasoning.
As a preferable scheme of the Hamiltonian Monte Carlo-based voltage sag probability evaluation method, the invention comprises the following steps: the sample generation by using the hamilton monte carlo sampling method comprises the following steps: adopting an initial sample mean value obtained by Bayesian neural network prediction as a starting point; initializing the number of sampling samples and the number of discarded samples determined by adopting an adaptive differential evolution algorithm; generating a countermeasure control system by applying a high-order neural network to finely adjust the step length and step number parameters of the Hamiltonian Monte Carlo sampler; performing sampling by using a Hamiltonian Monte Carlo sampling method accelerated by quanta, and utilizing parallelism of quantum computation; monitoring and recording the sampling state by utilizing a real-time data stream analysis and sampling process visualization tool so as to respond to the sampling performance in real time and perform optimization adjustment in time; parameters of poisson distribution are modified in combination with a deep learning reinforcement learning algorithm, and an accurate posterior density distribution function is created to generate high quality samples.
As a preferable scheme of the Hamiltonian Monte Carlo-based voltage sag probability evaluation method, the invention comprises the following steps: the sample generation by the hamilton monte carlo sampling method further comprises replacing the energy function with a miltonian energy function, and generating a data sample by adopting joint exponential distribution, wherein the specific formula is as follows:
Wherein H (P, theta) represents the total Hamiltonian energy of the system, K (P), U (theta) respectively represent corresponding kinetic energy and potential energy functions, theta represents the sample position, P (P, theta) represents the data sample function, and Z is a normalization constant.
As a preferable scheme of the Hamiltonian Monte Carlo-based voltage sag probability evaluation method, the invention comprises the following steps: the probability density evaluation in combination with Bayesian reasoning comprises the following steps: selecting a priori distribution of unknown parameters lambda as gamma distribution, and simultaneously selecting likelihood functions of data X as poisson distribution to construct a Bayesian model; calculating posterior distribution of the unknown parameter lambda according to a Bayesian rule, and generating a sampling sample { lambda 1,...,λN } of the posterior distribution of the unknown parameter lambda based on a Hamiltonian Monte Carlo algorithm; traversing all samples lambda i, and calculating probability density values of data X corresponding to each sample lambda i below a threshold value; averaging the N probability density values to obtain a probability density evaluation value of the voltage sagIterative execution, obtaining different time periodsThe sequence is used for drawing a probability density time sequence chart; collecting probability sequences calculated by actual data and evaluating the probability sequencesThe sequences are compared to verify the validity of the model.
As a preferable scheme of the Hamiltonian Monte Carlo-based voltage sag probability evaluation method, the invention comprises the following steps: the specific formula of the likelihood function is as follows:
where x= { X 1,X2,...,Xn } represents the observed data of the monitored busbar, λ represents an unknown parameter, and θ represents the sample position.
The specific formula of the prior distribution is as follows:
Where λ represents an unknown parameter, θ represents a sample position, prior a、Priorb represents a shape parameter and a scale parameter of the gamma distribution, and the value is 1 according to experience.
The specific formula of posterior distribution is as follows:
P(θ|X)∝P(X|θ)×P(θ)
where P (θ|x) represents the posterior probability, P (x|θ) represents the likelihood function, and P (θ) represents the prior distribution.
As a preferable scheme of the Hamiltonian Monte Carlo-based voltage sag probability evaluation method, the invention comprises the following steps: and evaluate and getThe comparison of the sequences to verify the effectiveness of the model comprises the steps of setting high-precision voltage monitoring equipment in a power grid, and collecting voltage time sequence actual measurement data { x 1,x2,...,xt }; based on a preset voltage sag threshold mu, counting the proportion of x < mu in the actual measurement data to obtain actual voltage sag probability P s; if the actual voltage sag probability P s suddenly changes to exceed the preset upper limit and the preset lower limit, judging that the current is abnormal and starting an abnormal value processing subroutine; if the actual voltage sag probability P s is within the preset range, under the same load condition, predicting the voltage sag probability P y by using the constructed Bayes-HMC model; calculating a distance score S between the actual voltage sag probability P s and the predicted voltage sag probability P y by using a dynamic time warping algorithm; according to the distance score S, automatically optimizing parameters of the Bayes-HMC model by using a genetic algorithm, so that the predicted output approximates to the actual measurement probability; if the distance score S is higher than the acceptance index, executing a model quality improvement subroutine which comprises an updating algorithm, a newly added variable and adjusting the number of samples; when the model meets the quality requirement, the predicted voltage sag probability P y is used for the power grid control strategy.
As a preferable scheme of the Hamiltonian Monte Carlo-based voltage sag probability evaluation method, the invention comprises the following steps: the outlier processing subroutine includes the following: when the abnormal phenomenon of the data appears as high-frequency random noise interference, adopting a self-adaptive multi-frame average filter to carry out smoothing treatment; judging whether to enter a normal evaluation flow or not through the evaluation of the filtering effect, entering the normal evaluation flow if the filtering effect is good, marking the method as invalid if the filtering effect is bad, and outputting a low-level alarm; when the data anomaly has periodicity, separating out periodic characteristics and other items by adopting a signal decomposition method; if the decomposition is successful, filtering out periodic components, entering an evaluation flow, if the decomposition is failed, marking the method as invalid, and outputting a medium-level alarm; when the abnormal gradual amplification of the data is detected, judging whether the gradual accumulation of energy leads to data burst; if yes, resetting the smoothing parameters to realize the drainage control, if not, marking the reason is unknown, and outputting an advanced alarm; when all automatic processes fail, the expert is notified of the intervention, and the subsequent processes are performed under the manual analysis guidance of the expert.
In a second aspect, an embodiment of the present invention provides a voltage sag probability evaluation system based on a hamilton monte carlo method, which includes an acquisition module configured to acquire representative voltage sag event data to obtain a voltage waveform sample; the initialization module is used for setting random number seeds, target acceptance rate and gamma prior density distribution function parameters and initializing related variables; the sample generation module is used for generating samples by utilizing a Hamiltonian Monte Carlo sampling method and adjusting parameters to meet the target acceptance rate; and the evaluation module is used for creating a posterior density distribution function and carrying out probability density evaluation by combining Bayesian reasoning.
In a third aspect, embodiments of the present invention provide a computer apparatus comprising a memory and a processor, the memory storing a computer program, wherein: the computer program instructions, when executed by a processor, implement the steps of the hamiltonian monte carlo based voltage sag probability assessment method according to the first aspect of the invention.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein: the computer program instructions, when executed by a processor, implement the steps of the hamiltonian monte carlo based voltage sag probability assessment method according to the first aspect of the invention.
The beneficial effects of the invention are as follows: according to the invention, by fusing a Bayesian model and a Hamiltonian Monte Carlo high-efficiency sampling algorithm, more accurate voltage sag probability distribution is constructed, and the evaluation result reflects the running state of the power grid more accurately and has high reliability; the probability time sequence model is established, so that the time sequence evolution of the voltage abnormality probability can be dynamically captured, the real-time monitoring and early warning of the voltage quality are realized, and the application scene is expanded; through an abnormality identification and grading early warning mechanism, voltage abnormality can be effectively processed in time, a power grid dispatching control strategy is formulated in an auxiliary mode, and the power grid health management level is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description will briefly explain the drawings required to be used in the embodiments, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an HMC method evaluation process based on the hamiltonian monte carlo voltage dip probability evaluation method.
Fig. 2 is a schematic diagram of an original data distribution situation of a voltage sag probability evaluation method based on hamilton monte carlo.
Fig. 3 is a schematic diagram of a data distribution situation generated by simulating voltage sag times based on a hamilton monte carlo voltage sag probability evaluation method.
Fig. 4 is a probability density histogram of raw data samples based on the hamilton monte carlo voltage dip probability assessment method and the HMC method generated data samples.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Example 1
Referring to fig. 1, a first embodiment of the present invention provides a method for evaluating probability of voltage sag based on hamiltonian monte carlo, including,
S1: representative voltage sag event data is collected to obtain voltage waveform samples.
S2: setting random number seeds, target acceptance rate and gamma prior density distribution function parameters, and initializing related variables.
S3: and (3) generating samples by using a Hamiltonian Monte Carlo sampling method, and performing parameter adjustment to meet the target acceptance rate.
Specifically, an initial sample mean value obtained by Bayesian neural network prediction is used as a starting point; initializing the number of sampling samples and the number of discarded samples determined by adopting an adaptive differential evolution algorithm; generating a countermeasure control system by applying a high-order neural network to finely adjust the step length and step number parameters of the Hamiltonian Monte Carlo sampler;
Performing sampling by using a Hamiltonian Monte Carlo sampling method accelerated by quanta, and utilizing parallelism of quantum computation; monitoring and recording the sampling state by utilizing a real-time data stream analysis and sampling process visualization tool so as to respond to the sampling performance in real time and perform optimization adjustment in time; parameters of poisson distribution are modified in combination with a deep learning reinforcement learning algorithm, and an accurate posterior density distribution function is created to generate high quality samples.
Preferably, a Hamiltonian function which is related to kinetic energy and potential energy functions is established by using a Hamiltonian Monte Carlo sampling method to generate samples through a regular distribution concept of statistical mechanics, and the specific formula is as follows:
H(p,θ)=K(p)+U(θ)
wherein H (p, θ) represents a Hamiltonian, the Hamiltonian equation of motion is controlled by a position vector θ and a momentum vector p, K (p) represents a potential energy function, and U (θ) represents a kinetic energy function.
The specific formula of the generated sample data for the given energy function E (x) in the statistical mechanics is as follows:
Wherein E (x) represents an energy function, T represents the temperature of the system, and Z is a normalization constant;
However, the present invention uses the miltonian energy function H (p, θ) instead of the energy function, and uses the joint exponential distribution to generate the data samples, with the following specific formula:
Wherein H (P, theta) represents the total Hamiltonian energy of the system, K (P), U (theta) respectively represent corresponding kinetic energy and potential energy functions, theta represents the sample position, P represents the sample momentum, P (P, theta) represents the data sample function, and Z is a normalization constant.
Preferably, the potential energy function U (θ) determines the sample position θ, which is a posterior distribution of the bayesian statistical model, and the specific formula is as follows:
U(θ)=-log(P(θ)P(X|θ))
Where P (θ) represents the prior density, P (x|θ)) represents the likelihood function of the observed data X, and U (θ) represents the potential energy function.
It should be noted that the kinetic energy function K (p) determines the sample momentum p, and the kinetic energy function is defined as a negative number of the logarithmic probability density of zero-mean gaussian distribution with positive definite and symmetric covariance matrices, and the specific formula is as follows:
where p represents the sample momentum and M is a positive definite diagonal covariance matrix.
Further, substituting the potential energy function and the kinetic energy function into the generated data sample function P (P, θ), it is possible to obtain,
Where P (P, θ) represents the data sample function, θ represents the sample position, P (θ) represents the a priori density, and P represents the sample momentum.
S4: creating posterior density distribution functions, and carrying out probability density evaluation by combining Bayesian reasoning.
Preferably, the prior distribution of the unknown parameter lambda is selected as gamma distribution, and the likelihood function of the data X is selected as poisson distribution, so as to construct a Bayesian model; calculating posterior distribution of the unknown parameter lambda according to a Bayesian rule, and generating a sampling sample { lambda 1,...,λN } of the posterior distribution of the unknown parameter lambda based on a Hamiltonian Monte Carlo algorithm; traversing all samples lambda i, and calculating probability density values of data X corresponding to each sample lambda i below a threshold value; averaging the N probability density values to obtain a probability density evaluation value of the voltage sagIterative execution, obtaining the/>, of different time periodsThe sequence is used for drawing a probability density time sequence chart; collecting probability sequences calculated by actual data and evaluating the probability sequencesThe sequences are compared to verify the validity of the model.
In the invention, poisson distribution is used as a posterior density distribution function, and if observation data { X 1,...,Xn } of all monitored buses obey poisson distribution, and the unknown parameter of poisson distribution is lambda, the likelihood function of the observation data is:
where x= { X 1,X2,...,Xn } represents the observed data of the monitored busbar, λ represents an unknown parameter, and θ represents the sample position.
Specifically, the prior distribution of the unknown parameter λ is selected as the gamma distribution, and the specific formula is as follows:
Where λ represents an unknown parameter, θ represents a sample position, prior a、Priorb represents a shape parameter and a scale parameter of the gamma distribution, and the value is 1 according to experience.
Further, according to the bayesian theorem, the posterior probability is proportional to the product of the likelihood function and the prior density, and the specific formula is as follows:
P(θ|X)∝P(X|θ)×P(θ)
where P (θ|x) represents the posterior probability, P (x|θ) represents the likelihood function, and P (θ) represents the prior distribution.
Further, and is evaluated to obtainThe comparison of the sequences to verify the effectiveness of the model comprises the steps of setting high-precision voltage monitoring equipment in a power grid, and collecting voltage time sequence actual measurement data { x 1,x2,...,xt }; based on a preset voltage sag threshold mu, counting the proportion of x < mu in the actual measurement data to obtain actual voltage sag probability P s; if the actual voltage sag probability P s suddenly changes to exceed the preset upper limit and the preset lower limit, judging that the current is abnormal and starting an abnormal value processing subroutine; if the actual voltage sag probability P s is within the preset range, under the same load condition, predicting the voltage sag probability P y by using the constructed Bayes-HMC model; calculating a distance score S between the actual voltage sag probability P s and the predicted voltage sag probability P y by using a dynamic time warping algorithm; according to the distance score S, automatically optimizing parameters of the Bayes-HMC model by using a genetic algorithm, so that the predicted output approximates to the actual measurement probability; if the distance score S is higher than the acceptance index, executing a model quality improvement subroutine which comprises an updating algorithm, a newly added variable and adjusting the number of samples; when the model meets the quality requirement, the predicted voltage sag probability P y is used for the power grid control strategy.
Specifically, the outlier handling subroutine includes, but is not limited to, the following: when the abnormal phenomenon of the data appears as high-frequency random noise interference, adopting a self-adaptive multi-frame average filter to carry out smoothing treatment; judging whether to enter a normal evaluation flow or not through the evaluation of the filtering effect, entering the normal evaluation flow if the filtering effect is good, marking the method as invalid if the filtering effect is bad, and outputting a low-level alarm; when the data anomaly has periodicity, separating out periodic characteristics and other items by adopting a signal decomposition method; if the decomposition is successful, filtering out periodic components, entering an evaluation flow, if the decomposition is failed, marking the method as invalid, and outputting a medium-level alarm; when the abnormal gradual amplification of the data is detected, judging whether the gradual accumulation of energy leads to data burst; if yes, resetting the smoothing parameters to realize the drainage control, if not, marking the reason is unknown, and outputting an advanced alarm; when all automatic processes fail, the expert is notified of the intervention, and the subsequent processes are performed under the manual analysis guidance of the expert.
It should be noted that, the low-level alarm indicates that the simple processing method fails, and the repeated attempt is avoided by recording the invalid method corresponding to the slight data abnormality; the middle-level alarm indicates that the complex professional algorithm fails, the corresponding data is serious in abnormality, and an upgrade processing means is required to be prepared; advanced alarms indicate that the automated method is totally disabled, data anomalies are complex, and require manual diagnosis and handling.
Further, the embodiment also provides a voltage sag probability evaluation system based on the hamilton monte carlo method, which comprises an acquisition module, a detection module and a control module, wherein the acquisition module is used for acquiring representative voltage sag event data so as to acquire a voltage waveform sample; the initialization module is used for setting random number seeds, target acceptance rate and gamma prior density distribution function parameters and initializing related variables; the sample generation module is used for generating samples by utilizing a Hamiltonian Monte Carlo sampling method and adjusting parameters to meet the target acceptance rate; and the evaluation module is used for creating a posterior density distribution function and carrying out probability density evaluation by combining Bayesian reasoning.
The embodiment also provides a computer device, which is suitable for the situation of the voltage sag probability evaluation method based on the Hamiltonian Monte Carlo, and comprises a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the voltage sag probability evaluation method based on hamiltonian monte carlo as set forth in the above embodiment.
The computer device may be a terminal comprising a processor, a memory, a communication interface, a display screen and input means connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
The present embodiment also provides a storage medium having stored thereon a computer program which, when executed by a processor, implements a method for implementing a hamiltonian monte carlo based voltage dip probability assessment as proposed in the above embodiments.
In summary, the invention constructs more accurate voltage sag probability distribution by fusing the Bayesian model and the Hamiltonian Monte Carlo high-efficiency sampling algorithm, and the evaluation result reflects the running state of the power grid more accurately and has high reliability; the probability time sequence model is established, so that the time sequence evolution of the voltage abnormality probability can be dynamically captured, the real-time monitoring and early warning of the voltage quality are realized, and the application scene is expanded; through an abnormality identification and grading early warning mechanism, voltage abnormality can be effectively processed in time, a power grid dispatching control strategy is formulated in an auxiliary mode, and the power grid health management level is improved.
Example 2
Referring to fig. 2 to fig. 4, in order to verify the beneficial effects of the present invention, a method for evaluating probability of voltage sag based on hamilton monte carlo is provided in a second embodiment of the present invention, and scientific demonstration is performed through economic benefit calculation and simulation experiments.
Specifically, a certain transformer substation in the area A is selected as a research sample station, and is connected with three 10kV distribution transformers and a plurality of distribution lines. The station area is provided with 5 power distribution terminal sampling points, an intelligent electric energy meter with the model XX is used, the sampling frequency is 1 time/minute, and the test time span is 2023 years, 7 months, 15 days, 7 months and 30 days.
Further, the total effective data amount of half month is 500, the effective data amount is summarized by day, and the times of voltage sag events (lower than 0.9pu and lasting time >1 minute) in the daily power supply time are counted to obtain a voltage sag probability sequence { P 1,P2,P3,...,Pt } as an actual measurement reference.
Further, the initial value of the random number seed is set to 100, and the purpose of the random number seed is to ensure the repeatability of the result; the target acceptance rate is set to 0.989, the acceptance rate is determined by the initial value of the step number of the step, the initial step number is set to 300, and the initial step length is set to 100. The gamma prior density distribution function parameters include a shape parameter Priora and a scale parameter Priorb, which are all 1 according to an empirical formula.
Preferably, for each voltage sag node: using the initial sample mean as a starting point; setting the number of sampling samples to 500 and the number of discarding samples to 0; adjusting the step length and the step number parameters of the sampler by using tuneSampler functions so as to achieve the target acceptance rate; operating a sampler to sample and obtaining a sampling chain, an end point and receiving rate information; recording the acceptance rate and sampling information, and storing a sampling chain; a posterior density distribution function with poisson distribution as likelihood function is created from the mean value of the sampling chain and 5000 samples are generated using the distribution.
It should be noted that, in the simulation process, the step size and the quality matrix of the HMC sampler are automatically adjusted by using tuneSampler functions so as to reach the target acceptance rate of 0.989, the initial step number is set to 300, and the initial step size is set to 100. Setting the initial number of steps of the sampler to 300, the larger the number of steps, which means that more dynamic simulation is performed, the sampler explores the sample space more fully in the state space. However, too large a number of steps may also result in increased sampling time and consumption of computational resources. The iteration number of the step iteration process of the sampler is 100, the step size is too large, so that the sampler can jump too much in a parameter space and is difficult to effectively explore distribution, and the step size is too small, so that the sampler can wander in a local area and the convergence speed is slower. When in iteration, the algorithm can be automatically fine-tuned according to the previous tuning result and strategy selection, and the algorithm acceptance rate is taken as a main consideration factor.
Preferably, the invention has the advantages that due to the introduction of Hamiltonian dynamics, the autocorrelation among samples is reduced, the number of accepted samples is increased, and the HMC has higher efficiency under the condition of high-dimensional space. The voltage sag data generation method based on the Hamiltonian Monte Carlo sampling method is applied to an IEEE-24 node system, a schematic diagram of the distribution situation of the node 9 corresponding to 500 groups of original data is shown in fig. 2, and a schematic diagram of the distribution situation of the data generated by the corresponding node using 5000 times of voltage sag frequency simulation generated by using an HMC method is shown in fig. 3.
Further, statistical analysis is carried out on the generated voltage sag frequency data samples, and the original voltage sag data statistical indexes are as follows: the mean value, the median and the standard deviation are respectively 10.15, 10.01 and 0.32, and the mean value, the median and the standard deviation of 5000 groups of generated sample data are respectively 10.08, 10 and 3.16, so that the voltage sag data generated by the method has reliability.
Further, in the step 4, when the probability density distribution condition of the voltage dip times is estimated by combining bayesian reasoning, probability density histograms of the original data sample and the data sample generated by the HMC method are drawn on the same graph, as shown in fig. 4, the comparison condition of the probability density distribution of the original data sample and the voltage dip times of the generated data sample of the node can be obviously observed, and the simulated data obtained by the HMC method is very similar to the distribution shape of the original data. And the characteristics of the HMC sampling method determine that the data acquired by the data reflect uncertainty and non-uniform distribution characteristics in real data to a certain extent.
Further, the probability density histogram of the generated data sample in fig. 4 is fitted to obtain a corresponding function image as shown by a curve P in fig. 4, and the probability density value of the maximum voltage dip and the corresponding voltage dip number value of different nodes can be intuitively extracted from the image. By analyzing the voltage sag count data, potential power quality problems can be determined and measures taken to improve power quality to meet the needs of the user.
It should be noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention may be modified or substituted without departing from the spirit and scope of the technical solution of the present invention, which is intended to be covered in the scope of the claims of the present invention.

Claims (10)

1. The voltage sag probability evaluation method based on Hamiltonian Monte Carlo is characterized by comprising the following steps of: comprising the steps of (a) a step of,
Collecting representative voltage sag event data to obtain a voltage waveform sample;
setting random number seeds, target acceptance rate and gamma prior density distribution function parameters, and initializing related variables;
Sample generation is carried out by utilizing a Hamiltonian Monte Carlo sampling method, and parameter adjustment is carried out to meet the target acceptance rate;
creating posterior density distribution functions, and carrying out probability density evaluation by combining Bayesian reasoning.
2. The hamiltonian monte carlo-based voltage sag probability evaluation method according to claim 1, wherein: the sample generation by using the hamilton monte carlo sampling method comprises the following steps:
adopting an initial sample mean value obtained by Bayesian neural network prediction as a starting point;
initializing the number of sampling samples and the number of discarded samples determined by adopting an adaptive differential evolution algorithm;
Generating a countermeasure control system by applying a high-order neural network to finely adjust the step length and step number parameters of the Hamiltonian Monte Carlo sampler;
performing sampling by using a Hamiltonian Monte Carlo sampling method accelerated by quanta, and utilizing parallelism of quantum computation;
Monitoring and recording the sampling state by utilizing a real-time data stream analysis and sampling process visualization tool so as to respond to the sampling performance in real time and perform optimization adjustment in time;
parameters of poisson distribution are modified in combination with a deep learning reinforcement learning algorithm, and an accurate posterior density distribution function is created to generate high quality samples.
3. The hamiltonian monte carlo-based voltage sag probability evaluation method according to claim 1, wherein: the sample generation using the hamilton monte carlo sampling method further includes,
The energy function is replaced by the miltonian energy function, and a data sample is generated by adopting joint exponential distribution, wherein the specific formula is as follows:
Wherein H (P, theta) represents the total Hamiltonian energy of the system, K (P), U (theta) respectively represent corresponding kinetic energy and potential energy functions, theta represents the sample position, P (P, theta) represents the data sample function, and Z is a normalization constant.
4. The hamiltonian monte carlo-based voltage sag probability evaluation method according to claim 1, wherein: the probability density evaluation by combining Bayesian reasoning comprises the following steps:
Selecting a priori distribution of unknown parameters lambda as gamma distribution, and simultaneously selecting likelihood functions of data X as poisson distribution to construct a Bayesian model;
Calculating posterior distribution of the unknown parameter lambda according to a Bayesian rule, and generating a sampling sample { lambda 1,...,λN } of the posterior distribution of the unknown parameter lambda based on a Hamiltonian Monte Carlo algorithm;
Traversing all samples lambda i, and calculating probability density values of data X corresponding to each sample lambda i below a threshold value;
Averaging the N probability density values to obtain a probability density evaluation value of the voltage sag
Iterative execution, obtaining different time periodsThe sequence is used for drawing a probability density time sequence chart;
collecting probability sequences calculated by actual data and evaluating The sequences are compared to verify the validity of the model.
5. The hamiltonian monte carlo-based voltage sag probability evaluation method according to claim 4, wherein: the specific formula of the likelihood function is as follows:
Wherein, X= { X 1,X2,...,Xn } represents the observation data of the monitored bus, λ represents an unknown parameter, and θ represents a sample position;
The specific formula of the prior distribution is as follows:
wherein λ represents an unknown parameter, θ represents a sample position, and Prior a、Priorb represents a shape parameter and a scale parameter of the gamma distribution, respectively;
the specific formula of the posterior distribution is as follows:
P(θ|X)∝P(X|θ)×P(θ)
where P (θ|x) represents the posterior probability, P (x|θ) represents the likelihood function, and P (θ) represents the prior distribution.
6. The hamiltonian monte carlo-based voltage sag probability evaluation method according to claim 4, wherein: obtained by said and evaluationThe sequence comparison to verify the validity of the model includes,
Setting high-precision voltage monitoring equipment in a power grid, and collecting voltage time sequence actual measurement data { x 1,x2,...,xt };
Based on a preset voltage sag threshold mu, counting the proportion of x < mu in the actual measurement data to obtain actual voltage sag probability P s;
If the actual voltage sag probability P s suddenly changes to exceed the preset upper limit and the preset lower limit, judging that the current is abnormal and starting an abnormal value processing subroutine;
If the actual voltage sag probability P s is within the preset range, under the same load condition, predicting the voltage sag probability P y by using the constructed Bayes-HMC model;
Calculating a distance score S between the actual voltage sag probability P s and the predicted voltage sag probability P y by using a dynamic time warping algorithm;
According to the distance score S, automatically optimizing parameters of the Bayes-HMC model by using a genetic algorithm, so that the predicted output approximates to the actual measurement probability;
if the distance score S is higher than the acceptance index, executing a model quality improvement subroutine which comprises an updating algorithm, a newly added variable and adjusting the number of samples;
When the model meets the quality requirement, the predicted voltage sag probability P y is used for the power grid control strategy.
7. The hamiltonian monte carlo-based voltage sag probability evaluation method according to claim 6, wherein: the outlier processing subroutine includes the following:
When the abnormal phenomenon of the data appears as high-frequency random noise interference, adopting a self-adaptive multi-frame average filter to carry out smoothing treatment;
judging whether to enter a normal evaluation flow or not through the evaluation of the filtering effect, entering the normal evaluation flow if the filtering effect is good, marking the method as invalid if the filtering effect is bad, and outputting a low-level alarm;
When the data anomaly has periodicity, separating out periodic characteristics and other items by adopting a signal decomposition method;
If the decomposition is successful, filtering out periodic components, entering an evaluation flow, if the decomposition is failed, marking the method as invalid, and outputting a medium-level alarm;
When the abnormal gradual amplification of the data is detected, judging whether the gradual accumulation of energy leads to data burst;
If yes, resetting the smoothing parameters to realize the drainage control, if not, marking the reason is unknown, and outputting an advanced alarm;
When all automatic processes fail, the expert is notified of the intervention, and the subsequent processes are performed under the manual analysis guidance of the expert.
8. A voltage sag probability evaluation system based on a hamilton monte carlo method, based on the hamilton monte carlo based voltage sag probability evaluation method according to any one of claims 1 to 7, characterized in that: also included is a method of manufacturing a semiconductor device,
The acquisition module is used for acquiring representative voltage sag event data so as to acquire a voltage waveform sample;
the initialization module is used for setting random number seeds, target acceptance rate and gamma prior density distribution function parameters and initializing related variables;
the sample generation module is used for generating samples by utilizing a Hamiltonian Monte Carlo sampling method and adjusting parameters to meet the target acceptance rate;
and the evaluation module is used for creating a posterior density distribution function and carrying out probability density evaluation by combining Bayesian reasoning.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that: the processor, when executing the computer program, implements the steps of the method for evaluating probability of voltage sag based on hamiltonian monte carlo according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized by: the computer program, when executed by a processor, implements the steps of the hamiltonian monte carlo based voltage sag probability assessment method of any one of claims 1 to 7.
CN202410025623.8A 2024-01-08 2024-01-08 Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo Pending CN117972343A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410025623.8A CN117972343A (en) 2024-01-08 2024-01-08 Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410025623.8A CN117972343A (en) 2024-01-08 2024-01-08 Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo

Publications (1)

Publication Number Publication Date
CN117972343A true CN117972343A (en) 2024-05-03

Family

ID=90847022

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410025623.8A Pending CN117972343A (en) 2024-01-08 2024-01-08 Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo

Country Status (1)

Country Link
CN (1) CN117972343A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118133161A (en) * 2024-05-08 2024-06-04 武汉新电电气股份有限公司 Power system inertia interval probability prediction method based on variable decibel leaf inference

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118133161A (en) * 2024-05-08 2024-06-04 武汉新电电气股份有限公司 Power system inertia interval probability prediction method based on variable decibel leaf inference
CN118133161B (en) * 2024-05-08 2024-07-12 武汉新电电气股份有限公司 Power system inertia interval probability prediction method based on variable decibel leaf inference

Similar Documents

Publication Publication Date Title
CN112763929B (en) Method and device for predicting health of battery monomer of energy storage power station system
Aizpurua et al. Power transformer dissolved gas analysis through Bayesian networks and hypothesis testing
CN117972343A (en) Voltage sag probability assessment method and system based on Hamiltonian Monte Carlo
CN109033513B (en) Power transformer fault diagnosis method and power transformer fault diagnosis device
CN108399434B (en) Analysis and prediction method of high-dimensional time series data based on feature extraction
CN114819054B (en) Power electronic system state monitoring method based on physical information neural network
KR20190008515A (en) Process Monitoring Device and Method using RTC method with improved SAX method
CN114004162A (en) Modeling method for smelting load harmonic emission level under multi-working-condition scene
Kim et al. Inspection schedule for prognostics with uncertainty management
Wawrzyniak et al. Data-driven models in machine learning for crime prediction
Zhang et al. Partially observable multi-sensor sequential change detection: A combinatorial multi-armed bandit approach
CN117592870B (en) Comprehensive analysis system based on water environment monitoring information
Xu et al. A hybrid approach to predict battery health combined with attention-based transformer and online correction
CN113295399B (en) Converter valve element state evaluation method, device, electronic equipment and storage medium
CN114648060A (en) Fault signal standardization processing and classification method based on machine learning
CN114564487A (en) Meteorological raster data updating method combining forecast prediction
CN114548493A (en) Method and system for predicting current overload of electric energy meter
CN117407675A (en) Lightning arrester leakage current prediction method based on multi-variable reconstruction combined dynamic weight
CN116936966A (en) Battery temperature monitoring method, device and energy storage system
CN116859255A (en) Method, device, equipment and medium for predicting state of health of energy storage battery
Wang et al. A conditional random field based feature learning framework for battery capacity prediction
CN113868957B (en) Residual life prediction and uncertainty quantitative calibration method under Bayes deep learning
Jovic et al. Management of the wind speed data using adaptive neuro-fuzzy methodology
Abdolshah et al. A review of systems reliability analysis using fuzzy logic
Landolfi et al. Cloud telemetry modeling via residual gauss-markov random fields

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication