CN116738617A - Power system modeling method and device, electronic equipment and storage medium - Google Patents
Power system modeling method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116738617A CN116738617A CN202310754024.5A CN202310754024A CN116738617A CN 116738617 A CN116738617 A CN 116738617A CN 202310754024 A CN202310754024 A CN 202310754024A CN 116738617 A CN116738617 A CN 116738617A
- Authority
- CN
- China
- Prior art keywords
- elastic network
- power system
- error result
- regression calculation
- data
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000005094 computer simulation Methods 0.000 title claims abstract description 19
- 238000004364 calculation method Methods 0.000 claims abstract description 92
- 239000011159 matrix material Substances 0.000 claims description 29
- 230000008569 process Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 17
- 238000011084 recovery Methods 0.000 claims description 14
- 230000004069 differentiation Effects 0.000 claims description 13
- 238000001914 filtration Methods 0.000 claims description 8
- 238000007781 pre-processing Methods 0.000 claims description 8
- 238000004422 calculation algorithm Methods 0.000 claims description 7
- 238000009499 grossing Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 11
- 230000001360 synchronised effect Effects 0.000 description 9
- 230000005291 magnetic effect Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000003068 static effect Effects 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 101150111571 mreg gene Proteins 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 101100127656 Caenorhabditis elegans lam-2 gene Proteins 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005294 ferromagnetic effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/10—Geometric CAD
- G06F30/17—Mechanical parametric or variational design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/11—Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
- G06F17/13—Differential equations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/18—Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2111/00—Details relating to CAD techniques
- G06F2111/08—Probabilistic or stochastic CAD
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Geometry (AREA)
- General Engineering & Computer Science (AREA)
- Operations Research (AREA)
- Evolutionary Computation (AREA)
- Algebra (AREA)
- Computer Hardware Design (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Probability & Statistics with Applications (AREA)
- Feedback Control In General (AREA)
Abstract
The application discloses a power system modeling method, a power system modeling device, electronic equipment and a storage medium. The method comprises the steps of obtaining an input and output data set of a power system; determining an initial parameter value of an elastic network regularization parameter of the power system, and performing elastic network regression calculation on data in the data set based on the initial parameter value to obtain an initial model coefficient and an error result of the power system; determining a secondary parameter value of an elastic network regularization parameter for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum; and acquiring an optimal model coefficient corresponding to the minimum error result, and determining a model corresponding to the optimal model coefficient as a model of the power system. The application can automatically construct the dynamic system model, and ensure that the constructed model has better learning quality and anti-overfitting capability.
Description
Technical Field
The present application relates to the field of model building technologies, and in particular, to a power system modeling method, a device, an electronic apparatus, and a storage medium.
Background
The power system is a physical system with the state of the system changing along with time, and needs to be specifically described according to the initial state and the evolution rule. Because of the many limitations and influencing factors present in the engineering environment, power systems in engineering often appear as complex systems that are nonlinear. To accurately express the specific relationship of each position in such systems over time, partial differential equations are often used to model the power system.
In the prior art, an elastic network is often used for carrying out regression calculation to obtain a partial differential equation so as to realize a system modeling process. The modeling mode needs to select proper regularization parameters, the regularization parameters are often determined based on experience on the premise of no priori data, a certain amount of manpower and time are required to be consumed, and meanwhile, the automatic processing principle of the flow is also violated.
Disclosure of Invention
In order to solve the technical problem that regularization parameters need to be determined manually according to experience in a dynamic system modeling process based on an elastic network, the embodiment of the application provides a dynamic system modeling method, a dynamic system modeling device, electronic equipment and a storage medium.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a power system modeling method, which comprises the following steps: acquiring an input and output data set of a power system; determining an initial parameter value of the regularization parameter of the elastic network of the power system, and performing elastic network regression calculation on the data in the data set based on the initial parameter value to obtain an initial model coefficient and an error result of the power system; determining a secondary parameter value of an elastic network regularization parameter for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum; and acquiring an optimal model coefficient corresponding to the error result when the error result is minimum, and determining a model corresponding to the optimal model coefficient as a model of the power system.
In an embodiment, after the acquiring the powertrain input-output data set, the powertrain modeling method further includes: preprocessing the data in the data set to remove noise and bad values in the data; the performing elastic network regression calculation on the data in the data set includes: and carrying out elastic network regression calculation on the preprocessed data.
In an embodiment, the preprocessing the data in the data set to remove noise and bad values in the data includes: carrying out smoothing treatment on bad values in the data by adopting a windowing smoothing method; and constructing grid data by adopting a polynomial interpolation method, and filtering noise in the data based on a wavelet filtering method.
In an embodiment, the performing elastic network regression calculation on the data in the dataset based on the initial parameter value to obtain an initial model coefficient and an error result of the power system includes: performing elastic network regression calculation on the data in the data set by using a preset expression based on the initial parameter value to obtain an initial model coefficient of the power system; and carrying out differentiation processing on the preset expression substituted into the initial model coefficient, calculating based on the differentiation processing result, and determining an error result of the initial model.
In an embodiment, the differentiating the preset expression substituted into the initial model coefficient, calculating based on the differentiation result, and determining the error result of the initial model includes: substituting the first-order differential pair into a preset expression of the initial model coefficient to conduct differentiation processing to obtain a recovery equation; calculating the left side of the recovery equation to obtain a first matrix; calculating the right side of the recovery equation to obtain a second matrix; determining an error result of the initial model based on the first matrix and the second matrix using the following formula:
where δ represents the error result, L represents the first matrix, and R represents the second matrix.
In an embodiment, the determining the secondary parameter value of the elastic network regularization parameter of the elastic network regression calculation according to the error result includes: judging whether to perform next elastic network regression calculation according to the error result; under the condition that the next elastic network regression calculation is determined, determining a stepping value of parameter adjustment by utilizing a minimum angle regression algorithm; and according to the step value, carrying out value adjustment on the basis of the initial parameter value to obtain a secondary parameter value of the regularization parameter of the elastic network for carrying out elastic network regression calculation next time.
In an embodiment, the determining whether to perform the next elastic network regression calculation according to the error result includes: comparing the error result with the error result of the last elastic network regression calculation; if the error result of the elastic network regression calculation is smaller than the error result of the elastic network regression calculation of the last time, determining to perform the next elastic network regression calculation; if the error result of the elastic network regression calculation is greater than or equal to the error result of the last elastic network regression calculation, determining that the next elastic network regression calculation is not performed.
The embodiment of the application also provides a power system modeling device, which comprises: the acquisition module is used for acquiring an input and output data set of the power system; the regression calculation module is used for determining initial parameter values of the regularization parameters of the elastic network of the power system, carrying out elastic network regression calculation on the data in the data set based on the initial parameter values, and obtaining initial model coefficients and error results of the power system; the iteration module is used for determining secondary parameter values of the regularization parameters of the elastic network for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum; and the determining module is used for acquiring the optimal model coefficient corresponding to the minimum error result and determining the model corresponding to the optimal model coefficient as the model of the power system.
The embodiment of the application also provides electronic equipment, which comprises: a processor and a memory for storing a computer program capable of running on the processor; wherein the processor is adapted to execute the steps of any of the methods described above when the computer program is run.
The embodiment of the application also provides a storage medium, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of any one of the methods are realized.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the method provided by the embodiment of the application carries out the selection of the regularization parameters of the elastic network of the power system in an iterative mode, can ensure the effectiveness of the selected parameters, and realizes the self-adaptive selection of the regularization parameters of the elastic network of the power system. The automatic selection mode does not need to consume manpower and time, is easy to realize and has low complexity. And the power system model established according to regularization parameters acquired in an automatic process can be ensured to have better learning quality and overfitting resistance.
Drawings
FIG. 1 is a schematic flow chart of a modeling method of a power system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a power system learning algorithm based on an elastic network according to an embodiment of the present application;
FIG. 3 is a schematic diagram showing a comparison of a theoretical value solution and a learned value solution of the K-S equation according to the embodiment of the present application;
FIG. 4 is a schematic diagram of a modeling apparatus for a powertrain system according to an embodiment of the present application;
fig. 5 is an internal structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the accompanying drawings and examples.
The embodiment of the application provides a modeling method of a power system, as shown in fig. 1, comprising the following steps:
step 101: acquiring an input and output data set of a power system;
step 102: determining an initial parameter value of the regularization parameter of the elastic network of the power system, and performing elastic network regression calculation on the data in the data set based on the initial parameter value to obtain an initial model coefficient and an error result of the power system;
step 103: determining a secondary parameter value of an elastic network regularization parameter for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum;
step 104: and acquiring an optimal model coefficient corresponding to the error result when the error result is minimum, and determining a model corresponding to the optimal model coefficient as a model of the power system.
The embodiment is an elastic network method based on self-adaptive selection of regularization parameters, and partial differential equation expression describing a power system is learned through a data driving method, so that power system model creation is completed.
The embodiment mainly aims at the following power systems:
in the embodiment, the optimal model coefficient is determined by adopting a loop iteration mode, and then the power system model is determined according to the optimal model coefficient. The loop iteration mode can be set to stop when the error result is minimum. In addition, if the loop iteration cannot be stopped all the time, the loop iteration can be stopped by additionally setting an interrupt condition. For example stopping when a preset number of times is reached.
Specifically, the input-output data set of the power system in the present embodiment may include a time matrix t with a length of at least 100, a space matrix x with a length of at least 100, and an output signal u with a size of at least 100×100 for each group.
The present embodiment may utilize a sensor device to acquire a powertrain input output dataset.
Because the input and output data sets of the power system acquired based on the sensor device often have noise and bad values, in one embodiment, after the input and output data sets of the power system are acquired, data in the data sets may be preprocessed to remove the noise and bad values in the data sets. And subsequently, when elastic network regression calculation is performed on the data in the data set, elastic network regression calculation can be performed on the preprocessed data. The regression calculation of the elastic network is performed by using the data from which the noise and the bad value are removed, so that the accuracy of the partial differential equation of the power system established based on the mode can be ensured, and the dynamic system has stronger comprehensive performance.
In the actual application process, in an embodiment, preprocessing is performed on the data in the data set, and removing noise and bad values in the data can be performed in the following manner:
carrying out smoothing treatment on bad values in the data by adopting a windowing smoothing method;
and constructing grid data by adopting a polynomial interpolation method, and filtering noise in the data based on a wavelet filtering method.
Here, it should be noted that, the windowing smoothing method, the polynomial interpolation method and the wavelet filtering method are all commonly used processing methods, and the processing method is only required to be adopted in this embodiment, and detailed descriptions thereof are omitted here.
In this embodiment, before performing loop iteration, an initial parameter value of a regularization parameter of an elastic network of the power system is determined, where the initial parameter value may be randomly set based on a situation.
After determining the initial parameter value, in an embodiment, performing elastic network regression calculation on the data in the data set based on the initial parameter value to obtain an initial model coefficient and an error result of the power system, including:
performing elastic network regression calculation on the data in the data set by using a preset expression based on the initial parameter value to obtain an initial model coefficient of the power system;
and carrying out differentiation processing on the preset expression substituted into the initial model coefficient, calculating based on the differentiation processing result, and determining an error result of the initial model.
Here, the preset expression may be
In practical application, in an embodiment, the differentiating the preset expression substituted into the initial model coefficient, calculating based on the differentiation result, and determining the error result of the initial model includes:
substituting the first-order differential pair into a preset expression of the initial model coefficient to conduct differentiation processing to obtain a recovery equation;
calculating the left side of the recovery equation to obtain a first matrix;
calculating the right side of the recovery equation to obtain a second matrix;
determining an error result of the initial model based on the first matrix and the second matrix using the following formula:
where δ represents the error result, L represents the first matrix, and R represents the second matrix.
Specifically, the first-order differential expression used in the present embodiment may be as follows:
and carrying out differentiation processing by substituting the first-order differential pair into the preset expression of the initial model coefficient, so as to obtain the following recovery equation: u (u) t =f (u, x). The left side of the recovery equation is calculated to obtain a first matrix L, and the right side of the recovery equation is calculated to obtain a second matrix R. Based on the first matrix L and the second matrix R, it can be determined using the above formulaAnd error results of the initial model. The smaller the relative error between the matrices, the higher the accuracy of the calculation.
In an embodiment, the determining the secondary parameter value of the elastic network regularization parameter of the elastic network regression calculation according to the error result includes:
judging whether to perform next elastic network regression calculation according to the error result;
under the condition that the next elastic network regression calculation is determined, determining a stepping value of parameter adjustment by utilizing a minimum angle regression algorithm;
and according to the step value, carrying out value adjustment on the basis of the initial parameter value to obtain a secondary parameter value of the regularization parameter of the elastic network for carrying out elastic network regression calculation next time.
Further, in an embodiment, the determining whether to perform the next elastic network regression calculation according to the error result includes:
comparing the error result with the error result of the last elastic network regression calculation;
if the error result of the elastic network regression calculation is smaller than the error result of the elastic network regression calculation of the last time, determining to perform the next elastic network regression calculation;
if the error result of the elastic network regression calculation is greater than or equal to the error result of the last elastic network regression calculation, determining that the next elastic network regression calculation is not performed.
Here, it should be noted that, since the first elastic network regression calculation process does not have an error result of the last elastic network regression calculation, the next elastic network regression calculation is directly required by default for the first elastic network regression calculation process.
In addition, there are two parameters α and β in the partial differential equation of the present application. Therefore, in the cyclic iteration process, one of alpha and beta is selected at will, the elastic network regression calculation after a plurality of numerical value adjustments is carried out on the selected alpha, the elastic network regression calculation is stopped when the error result is minimum, the elastic network regression calculation after a plurality of numerical value adjustments is carried out on beta, and the elastic network regression calculation is stopped when the error result is minimum, so that the optimal alpha and beta values are determined, the model corresponding to the power system is obtained based on the alpha and beta, and the model construction of the power system is completed.
The power system model obtained by the embodiment has stronger comprehensive performance in regression quality and overfitting resistance.
According to the modeling method of the power system, provided by the embodiment of the application, an input and output data set of the power system is obtained; determining an initial parameter value of the regularization parameter of the elastic network of the power system, and performing elastic network regression calculation on the data in the data set based on the initial parameter value to obtain an initial model coefficient and an error result of the power system; determining a secondary parameter value of an elastic network regularization parameter for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum; and acquiring an optimal model coefficient corresponding to the error result when the error result is minimum, and determining a model corresponding to the optimal model coefficient as a model of the power system. The scheme provided by the application carries out the selection of the regularization parameters of the elastic network of the power system in an iterative mode, can ensure the effectiveness of the selected parameters, and realizes the self-adaptive selection of the regularization parameters of the elastic network of the power system. The automatic selection mode does not need to consume manpower and time, is easy to realize and has low complexity. And the power system model established according to regularization parameters acquired in an automatic process can be ensured to have better learning quality and overfitting resistance.
The following describes the embodiment in detail based on a practical application scenario.
The embodiment provides a dynamic system partial differential equation learning method based on self-adaptive parameter selection of an elastic network. The method of the embodiment can ensure more balanced learning quality and overfitting resistance, and realize effective learning of any power system which can be described in the following form under the relatively low complexity with an automatic flow:
because manual intervention is not needed in the learning process of the method, an algorithm tool library can be integrated to perform generalized calculation.
Referring to fig. 2, the system modules used in the method of the present embodiment and the power system modeling process performed based on the modules will be described below:
the scheme of the embodiment specifically comprises the following modules:
(1) Preprocessing and grid construction module
This module is responsible for preprocessing the input learning data. Namely, the possible bad values in the input data are corrected, and the possible noise in the environment is filtered, so that the learning quality can be improved.
Noise and bad values are the two most prone problems, since the input data in engineering is not ideal. Therefore, the bad value can be smoothed through windowing based on the module, meanwhile, the grid data is constructed by adopting a polynomial interpolation method, and filtering is carried out through conventional wavelet methods and the like, so that the influence of noise on a data learning result is effectively reduced.
(2) Elastic network learning module
The module can carry out regression calculation on input data based on the following expression according to preset regularization parameters, and the coefficient of each numerical value in the partial differential equation is obtained through regression of an elastic network method:
for power systemsIt is apparent that its learning process can be converted into a regression calculation process of the following equation:
in the above formula, Θ is a sparse coefficient matrix to be solved, and the values of α and β control penalty strength and anti-overfitting performance respectively, which need to be given manually in the prior art. In the application, an automatic parameter setting mechanism is provided by combining a learning error analysis module, and the numerical values of alpha and beta are determined in a self-adaptive manner. After the values of α and β are determined, an elastic network-based iterative process may be further determined by:
solution x 1 #
2.n,d=X0.shape
3.X=np.zeros((n,d),dtype=np.complex64)
4.Y=Y.reshape(n,1)
5.
6.# initialization parameters
7.if w.size!=d:
8.w=np.zeros((d,1),dtype=np.complex64)
9.w_old=np.zeros((d,1),dtype=np.complex64)
10.converge=0
11.objective=np.zeros((maxit,1))
12.
Data were normalized 13.# and processed
14.if normalize!=0:
15.Mreg=np.zeros((d,1))
16.for i in range(0,d):
17.Mreg[i]=1.0/(np.linalg.norm(X0[:,i],normalize))
18.X[:,i]=Mreg[i]*X0[:,i]
19.else:
20.X=X0
21.
Lipschitz constant for calculating the gradient of the smooth part of the loss function
23.L=np.linalg.norm(X.T.dot(X),2)+lam2
24.
Loop # 25 until convergence or maximum number of iterations is reached
26.for iters in range(0,maxit):
27.
Update w for each iteration of 28 #
29.z=w+iters/float(iters+1)*(w-w_old)
30.w_old=w
31.z=z-(lam2*z+X.T.dot(X.dot(z)-Y))/L
32.for j in range(d):
33.w[j]=np.multiply(np.sign(z[j]),np.max([abs(z[j])-lam1/L,0]))
If convergence is not expected, special interrupt conditions may be additionally set
35.
Recovery of original data at 36.# and the like
37.if normalize!=0:
38.return np.multiply(Mreg,w)
39.else:
40.return w
(3) Learning error analysis module
The module can perform first-order differentiation processing on the partial differential equation obtained by learning, and analyze the error of a certain elastic network learning result on the basis of no prior data so as to facilitate subsequent loop iteration.
Since the learning result is a partial differential equation, and discrete time and space data cannot be directly substituted, the partial differential system needs to be meshed, that is, differential processing, where a first order difference is used:
then for the post-recovery equation u t The left side of =f (u, x) is calculated to obtain matrix L, the right side is calculated to obtain matrix R, and obviously the smaller the relative error between the matrices is, the higher the accuracy of the calculation is. The relative error δ between the matrices can be derived using the following relationship:
(4) Program main circulation module
The module can select a stepping value through a minimum angle regression algorithm after setting initial parameters of regular items in the elastic network, analyze learning errors after each learning, automatically set regularization parameters in the next iteration until a loop exit condition is reached, and output a partial differential equation learning result at the moment.
The module can synthesize an elastic network learning method and a learning error analysis method, and give out a parameter selection mechanism of parameters alpha and beta, as follows:
(1) Determining an initial parameter alpha 0 And beta 0 Determining initial recognition error delta based on the initial value 0 ;
(2) Optionally selecting alpha or beta, e.g. selecting alpha updates the parameters based on a minimum angle regression algorithm, and calculates an error value delta n Recording an error value;
(3) If delta n <δ n-1 Continuously aiming at the alpha step and calculating to obtain an error value delta, otherwise, selecting the beta step and calculating the error value delta, and continuously recording the error value;
d) When both α and β have completed the traversal, δ=δ min And the values of alpha and beta are the optimal values, and the coefficient matrix Θ obtained by learning based on the group of alpha and beta is the target coefficient matrix.
According to the embodiment, through the modularized flow process, the steps of input data preprocessing, elastic network learning, learning error analysis, main circulation and the like are combined, so that the power system can be effectively learned, and a specific numerical coefficient describing a partial differential equation of the system is obtained.
In addition, referring to FIG. 3, the present embodiment uses the K-S equation (u t =-u xxxx -uu x -u xx ) The learning effect of the above flow is verified, and the verification result is shown in fig. 3.
After sufficient data of a specific power system is collected based on the sensor, the embodiment can accurately and efficiently model the description equation of the power system through the process, and is convenient for other works such as system simulation and the like.
In order to implement the method according to the embodiment of the present application, the embodiment of the present application further provides a power system modeling apparatus, as shown in fig. 4, a power system modeling apparatus 400 includes: an acquisition module 401, a regression calculation module 402, an iteration module 403, and a determination module 404; wherein,,
an acquisition module 401, configured to acquire a power system input/output data set;
the regression calculation module 402 is configured to determine an initial parameter value of the power system elastic network regularization parameter, perform elastic network regression calculation on the data in the data set based on the initial parameter value, and obtain an initial model coefficient and an error result of the power system;
an iteration module 403, configured to determine, according to the error result, a secondary parameter value of an elastic network regularization parameter for performing elastic network regression calculation next time; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum;
and the determining module 404 is configured to obtain an optimal model coefficient corresponding to the time when the error result is minimum, and determine a model corresponding to the optimal model coefficient as the model of the power system.
In actual use, the acquisition module 401, the regression calculation module 402, the iteration module 403, and the determination module 404 may be implemented by a processor in a power system modeling apparatus.
It should be noted that: the above-mentioned apparatus provided in the above-mentioned embodiment is only exemplified by the division of the above-mentioned program modules when executing, and in practical application, the above-mentioned process allocation may be performed by different program modules according to needs, i.e. the internal structure of the terminal is divided into different program modules to complete all or part of the above-mentioned processes. In addition, the apparatus provided in the foregoing embodiment and the method embodiment belong to the same concept, and specific implementation processes of the apparatus and the method embodiment are detailed in the method embodiment and are not repeated herein.
To implement the method of the embodiments of the present application, the embodiments of the present application also provide a computer program product comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the steps of the method described above.
Based on the hardware implementation of the program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an electronic device (computer device). In particular, in one embodiment, the computer device may be a terminal, the internal structure of which may be as shown in fig. 5. The computer apparatus includes a processor a01, a network interface a02, a display screen a04, an input device a05, and a memory (not shown in the figure) which are connected through a system bus. Wherein the processor a01 of the computer device is adapted to provide computing and control capabilities. The memory of the computer device includes an internal memory a03 and a nonvolatile storage medium a06. The nonvolatile storage medium a06 stores an operating system B01 and a computer program B02. The internal memory a03 provides an environment for the operation of the operating system B01 and the computer program B02 in the nonvolatile storage medium a06. The network interface a02 of the computer device is used for communication with an external terminal through a network connection. Which when executed by a processor a01, performs the method of any of the embodiments described above. The display screen a04 of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device a05 of the computer device may be a touch layer covered on the display screen, or may be a key, a track ball or a touch pad arranged on a casing of the computer device, or may be an external keyboard, a touch pad or a mouse.
It will be appreciated by those skilled in the art that the structure shown in FIG. 5 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The device provided by the embodiment of the application comprises a processor, a memory and a program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the method of any one of the embodiments.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash memory (flashRAM). Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transshipment) such as modulated data signals and carrier waves.
It will be appreciated that the memory of embodiments of the application may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Wherein the nonvolatile Memory may be Read Only Memory (ROM), programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable programmable Read Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable Read Only Memory (EEPROM, electrically Erasable Programmable Read-Only Memory), magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk Read Only Memory (CD-ROM, compact Disc Read-Only Memory); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (ddr SDRAM, double Data Rate Synchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, direct Rambus Random Access Memory). The memory described by embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (10)
1. A power system modeling method, characterized in that the power system modeling method comprises:
acquiring an input and output data set of a power system;
determining an initial parameter value of the regularization parameter of the elastic network of the power system, and performing elastic network regression calculation on the data in the data set based on the initial parameter value to obtain an initial model coefficient and an error result of the power system;
determining a secondary parameter value of an elastic network regularization parameter for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum;
and acquiring an optimal model coefficient corresponding to the error result when the error result is minimum, and determining a model corresponding to the optimal model coefficient as a model of the power system.
2. The powertrain modeling method of claim 1, wherein after the acquisition of the powertrain input-output dataset, the powertrain modeling method further comprises:
preprocessing the data in the data set to remove noise and bad values in the data;
the performing elastic network regression calculation on the data in the data set includes:
and carrying out elastic network regression calculation on the preprocessed data.
3. The method of modeling a powertrain system of claim 2, wherein preprocessing the data in the dataset to remove noise and bad values in the data comprises:
carrying out smoothing treatment on bad values in the data by adopting a windowing smoothing method;
and constructing grid data by adopting a polynomial interpolation method, and filtering noise in the data based on a wavelet filtering method.
4. The modeling method of a power system according to claim 1, wherein performing elastic network regression calculation on the data in the dataset based on the initial parameter value to obtain an initial model coefficient and an error result of the power system comprises:
performing elastic network regression calculation on the data in the data set by using a preset expression based on the initial parameter value to obtain an initial model coefficient of the power system;
and carrying out differentiation processing on the preset expression substituted into the initial model coefficient, calculating based on the differentiation processing result, and determining an error result of the initial model.
5. The modeling method of power system according to claim 4, wherein said differentiating the preset expression substituted into the initial model coefficient, calculating based on the result of the differentiating process, and determining the error result of the initial model includes:
substituting the first-order differential pair into a preset expression of the initial model coefficient to conduct differentiation processing to obtain a recovery equation;
calculating the left side of the recovery equation to obtain a first matrix;
calculating the right side of the recovery equation to obtain a second matrix;
determining an error result of the initial model based on the first matrix and the second matrix using the following formula:
where δ represents the error result, L represents the first matrix, and R represents the second matrix.
6. The modeling method of a power system according to claim 1, wherein determining the secondary parameter value of the elastic network regularization parameter for the next elastic network regression calculation according to the error result includes:
judging whether to perform next elastic network regression calculation according to the error result;
under the condition that the next elastic network regression calculation is determined, determining a stepping value of parameter adjustment by utilizing a minimum angle regression algorithm;
and according to the step value, carrying out value adjustment on the basis of the initial parameter value to obtain a secondary parameter value of the regularization parameter of the elastic network for carrying out elastic network regression calculation next time.
7. The modeling method of claim 6, wherein determining whether to perform a next elastic network regression calculation based on the error result comprises:
comparing the error result with the error result of the last elastic network regression calculation;
if the error result of the elastic network regression calculation is smaller than the error result of the elastic network regression calculation of the last time, determining to perform the next elastic network regression calculation;
if the error result of the elastic network regression calculation is greater than or equal to the error result of the last elastic network regression calculation, determining that the next elastic network regression calculation is not performed.
8. A power system modeling apparatus, characterized in that the power system modeling apparatus comprises:
the acquisition module is used for acquiring an input and output data set of the power system;
the regression calculation module is used for determining initial parameter values of the regularization parameters of the elastic network of the power system, carrying out elastic network regression calculation on the data in the data set based on the initial parameter values, and obtaining initial model coefficients and error results of the power system;
the iteration module is used for determining secondary parameter values of the regularization parameters of the elastic network for carrying out elastic network regression calculation next time according to the error result; performing elastic network regression calculation on the data in the data set based on the secondary parameter value to obtain a secondary model coefficient and an error result of the power system; iterating until the error result is minimum;
and the determining module is used for acquiring the optimal model coefficient corresponding to the minimum error result and determining the model corresponding to the optimal model coefficient as the model of the power system.
9. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor; wherein,,
the processor being adapted to perform the steps of the method of any of claims 1 to 7 when the computer program is run.
10. A storage medium having a computer program stored therein, which, when executed by a processor, implements the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310754024.5A CN116738617A (en) | 2023-06-25 | 2023-06-25 | Power system modeling method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310754024.5A CN116738617A (en) | 2023-06-25 | 2023-06-25 | Power system modeling method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116738617A true CN116738617A (en) | 2023-09-12 |
Family
ID=87900909
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310754024.5A Pending CN116738617A (en) | 2023-06-25 | 2023-06-25 | Power system modeling method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116738617A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117910392A (en) * | 2024-03-19 | 2024-04-19 | 上海华模科技有限公司 | Method and device for correcting pneumatic model, flight simulator and storage medium |
CN118313054A (en) * | 2024-03-19 | 2024-07-09 | 上海华模科技有限公司 | Method and device for determining pneumatic model, flight simulator and storage medium |
-
2023
- 2023-06-25 CN CN202310754024.5A patent/CN116738617A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117910392A (en) * | 2024-03-19 | 2024-04-19 | 上海华模科技有限公司 | Method and device for correcting pneumatic model, flight simulator and storage medium |
CN118313054A (en) * | 2024-03-19 | 2024-07-09 | 上海华模科技有限公司 | Method and device for determining pneumatic model, flight simulator and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116738617A (en) | Power system modeling method and device, electronic equipment and storage medium | |
CN103309233A (en) | Designing method of fuzzy PID (Proportion-Integration-Differential) controller | |
CN115097920B (en) | Method and device for adjusting temperature of server case, server and medium | |
CN112232426A (en) | Training method, device and equipment of target detection model and readable storage medium | |
Gallegos et al. | Convergence of fractional adaptive systems using gradient approach | |
CN114168318A (en) | Training method of storage release model, storage release method and equipment | |
CN113705929B (en) | Spring festival holiday load prediction method based on load characteristic curve and typical characteristic value fusion | |
CN111832693B (en) | Neural network layer operation and model training method, device and equipment | |
CN113743650B (en) | Power load prediction method, device, equipment and storage medium | |
US20220067495A1 (en) | Intelligent processor, data processing method and storage medium | |
CN107615183A (en) | In Model Predictive Control application program relative to best performance values premium properties system and method | |
CN111079082B (en) | Method and system for improving calculation rate related to sparse matrix | |
CN114492251B (en) | Low-speed flow field divergence processing method, device, equipment and medium in supercomputing environment | |
CN115940202A (en) | Multi-inverter power distribution control method, device and equipment based on artificial intelligence | |
CN112860779B (en) | Batch data importing method and device | |
CN110658722B (en) | Self-equalization multi-model decomposition method and system based on gap | |
CN113449433A (en) | Constraint optimization method and device for objective function corresponding to cement production process model | |
Fujii | Momentum-space approach to asymptotic expansion for stochastic filtering | |
CN112433682A (en) | Method for acquiring control parameters in solid state disk, storage medium and electronic device | |
CN112668223A (en) | Electromechanical equipment simulation method and system based on digital twin lightweight model | |
CN111863104A (en) | Eye pattern determination model training method, eye pattern determination device, eye pattern determination apparatus, and medium | |
JPH07191967A (en) | Function approximation device and power demand estimation device | |
CN117454948B (en) | FP32 model conversion method suitable for domestic hardware | |
WO2021082851A1 (en) | Quantization method and device for neural network model, and computer-readable storage medium | |
CN118426300A (en) | Nonlinear system predictive control optimizing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |