A hydraulic simulation parameter correction method and system based on an optimization algorithm
By optimizing the algorithm to correct the parameters of the hydraulic simulation model, the problems of parameter drift and low efficiency of traditional algorithms are solved, and high-precision simulation results are achieved that match the actual data, providing reliable decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI FORYON INTELLIGENT CONTROL CO LTD
- Filing Date
- 2026-05-19
- Publication Date
- 2026-06-19
Smart Images

Figure CN122242068A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydraulic simulation technology, and more specifically to a method and system for correcting hydraulic simulation parameters based on optimization algorithms. Background Technology
[0002] Hydraulic simulation models are widely used in water supply networks, drainage systems, irrigation projects, and industrial pipeline transportation. Through numerical simulation, they predict hydraulic parameters such as flow rate, pressure, and water level of the network, providing decision support for system design, operation scheduling, and fault diagnosis. In actual pipe networks, key parameters such as pipe roughness coefficient, local resistance coefficient, and pump characteristic curve often deviate from the design values. Moreover, with changes in factors such as pipe aging, deposition, and corrosion, these parameters will dynamically drift, causing the error between the simulation model output and the measured data to gradually increase, which seriously affects the reliability and application value of the model. Therefore, correction is necessary. When performing traditional corrections, the measured data often contains outliers and noise, which can cause model distortion or even divergence if directly used for parameter correction, resulting in a final correction effect that does not meet expectations. Traditional optimization algorithms are prone to premature convergence or low iteration efficiency during parameter optimization and lack reasonable termination conditions. Existing objective functions are difficult to quantify the comprehensive differences between simulation and measurement at different measurement points and time steps, causing the correction results to deviate from the critical region. Summary of the Invention
[0003] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present invention provide a hydraulic simulation parameter correction method and system based on optimization algorithm to solve the technical problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method and system for correcting hydraulic simulation parameters based on optimization algorithms, comprising the following steps: Step S1: Obtain the initial parameter set of the hydraulic simulation model to be corrected, and collect the measured operating data of the real pipeline system at multiple time steps; Step S2: Use the initial parameter set as the initial population of the optimization algorithm, and set the parameter optimization boundary and the algorithm termination condition. Step S3: For each individual in the current population, substitute its corresponding parameter value into the hydraulic simulation model to perform simulation calculations and obtain the simulation data of each measuring point at the corresponding time step. Step S4: Construct the objective function to quantify the difference between the simulation data and the measured running data; Step S5: Calculate the objective function values of all individuals in the current population and generate a new generation population; Step S6: Repeat steps S3 to S5 until the algorithm termination condition is met, and output the optimal parameter set that minimizes the objective function value. Step S7: Update the optimal parameter set into the hydraulic simulation model to complete the parameter correction.
[0005] In a preferred embodiment, the measured operating data collected in step S1 includes pressure data, flow data, water level data, pump speed and valve opening percentage. In step S1, the collected data is preprocessed. During preprocessing, values that exceed the sensor range or are physically impossible are removed. After removal, anomaly identification and anomaly handling are performed.
[0006] In a preferred embodiment, when performing anomaly identification in step S1, the mean and standard deviation of the time series of each measurement point are calculated, and points that deviate from the mean by more than 3 times the standard deviation are marked as anomalies. For non-normally distributed data, a density-based local outlier factor algorithm is used to identify isolated points. The maximum allowable rate of change between adjacent sampling points is set, and if the rate of change exceeds the threshold, it is determined to be a jump anomaly. When performing anomaly processing, the points marked as anomalies are corrected by linear interpolation, and continuous anomaly periods are removed and recorded as a whole.
[0007] In a preferred embodiment, in step S2, a list of parameters to be corrected is extracted from the hydraulic simulation model. The given initial parameter set is used as the first individual in the optimization algorithm population. The remaining individuals are generated within a preset physical boundary using a random sampling method, which together constitute the initial population. Based on hydraulic principles and engineering experience, a clear optimization boundary is set for each parameter. A boundary over-boundary handling strategy is specified, and a combination of algorithm termination conditions is set, including the maximum number of iterations, the improvement of the objective function value for multiple consecutive generations being less than the convergence threshold, the population diversity being lower than the lower limit, or the optimal individual stagnating for more than the upper limit. The iteration stops when any of the conditions is met.
[0008] In a preferred embodiment, in step S3, for each individual in the current population, the core module of the optimization algorithm maps and replaces the parameter values of that individual according to the input format of the hydraulic simulation model, generates a new model configuration file or parameter table, and calls the simulation calculation engine to perform time-delay simulation calculation on the hydraulic model. The simulation time step is consistent with the sampling interval of the measured data. During the simulation, the simulation engine iteratively solves the head and flow rate of each node based on the basic hydraulic equations. After the simulation is completed, the simulation data of all measuring points at each time step is extracted from the simulation results and sent to step S4 in the form of data frames.
[0009] In a preferred embodiment, step S4 constructs an objective function to quantify the difference between the simulation data and the measured data. This function adopts the form of weighted root mean square error, which is the square root of the weighted sum of the squared relative errors between the simulation values and the measured values at different time steps for each measurement point.
[0010] In a preferred embodiment, in step S4, the objective function constructed is a weighted root mean square error function, the expression of which is: In the formula, F is the calculated function value, N is the total number of measurements, i is the current i-th measurement point, Ki is the weight coefficient of the i-th measurement point, Li is the simulation data of the i-th measurement point, and Si is the actual measured data of the i-th measurement point.
[0011] In a preferred embodiment, step S5 uses the simulation data obtained in step S3 and the objective function value calculated in step S4 for all individuals in the current population, and then uses a genetic algorithm to execute selection, crossover, and mutation operators to generate a new generation of population.
[0012] In a preferred embodiment, when correcting the hydraulic simulation model parameters in steps S1 to S7, a web-based dashboard is used to display the current iteration number, the optimal fitness curve, the parameter distribution histogram, and the error comparison chart before and after model correction in real time.
[0013] A hydraulic simulation parameter correction system based on optimization algorithms includes an acquisition unit, a processing unit, a simulation unit, a function unit, an optimization unit, and a correction unit. The acquisition unit is used to acquire the initial parameter set of the corrected hydraulic simulation model and the operating data of the actual pipeline network system. The processing unit preprocesses, identifies, and handles anomalies in the data acquired by the acquisition unit. The simulation unit calls the hydraulic simulation model and outputs simulation data. The function unit receives the simulation data and the measured operating data to construct an objective function and calculates the objective function value of the current population. The optimization unit calculates the objective function value of all individuals in the current population and generates a new generation population. The correction unit receives the optimal parameter set and writes it into the configuration file of the hydraulic simulation model to complete the model correction.
[0014] The technical effects and advantages of this invention are as follows: 1. This invention improves the quality and reliability of input data by preprocessing, identifying and processing the collected measured operation data, removing values that are beyond the range or physically impossible, identifying outliers based on statistical or density clustering algorithms, correcting isolated outliers with linear interpolation, and removing continuous outlier periods as a whole. This avoids misleading the parameter optimization process by outlier data, thereby ensuring the accuracy and stability of hydraulic simulation parameter correction. 2. This invention sets a combination of algorithm termination conditions, including the maximum number of iterations, the improvement of the objective function value for multiple consecutive generations being less than the convergence threshold, the population diversity being lower than the lower limit, or the optimal individual stagnating for more than the upper limit. When any of these conditions are met, the iteration stops. This can achieve a good balance between global search capability and computational efficiency, avoid invalid computation, and ensure that a parameter set close to the global optimum is obtained. 3. This invention constructs an objective function expressed in the form of weighted root mean square error. It takes the square root of the weighted sum of the relative error squares of the difference between the simulated and measured values of each measuring point at different time steps. This allows for the assignment of different weight coefficients according to the importance of the measuring points, thereby selectively correcting the hydraulic model parameters. This significantly improves the simulation accuracy at key locations, and the overall correction effect is more in line with the actual needs of engineering. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the hydraulic simulation parameter correction method of the present invention.
[0016] Figure 2 This is a schematic diagram of the hydraulic simulation parameter correction system of the present invention. Detailed Implementation
[0017] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. In addition, the forms of the various structures described in the following embodiments are merely illustrative. The hydraulic simulation parameter correction method and system based on optimization algorithms involved in the present invention are not limited to the structures described in the following embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Reference Figure 1 This invention provides a method and system for correcting hydraulic simulation parameters based on optimization algorithms, comprising the following steps: Step S1: Obtain the initial parameter set of the hydraulic simulation model to be corrected, and collect the measured operating data of the real pipeline system at multiple time steps; Step S2: Use the initial parameter set as the initial population of the optimization algorithm, and set the parameter optimization boundary and the algorithm termination condition. Step S3: For each individual in the current population, substitute its corresponding parameter value into the hydraulic simulation model to perform simulation calculations and obtain the simulation data of each measuring point at the corresponding time step. Step S4: Construct the objective function to quantify the difference between the simulation data and the measured running data; Step S5: Calculate the objective function values of all individuals in the current population and generate a new generation population; Step S6: Repeat steps S3 to S5 until the algorithm termination condition is met, and output the optimal parameter set that minimizes the objective function value. Step S7: Update the optimal parameter set into the hydraulic simulation model to complete the parameter correction.
[0019] In this embodiment, the intelligent optimization algorithm is deeply coupled with the hydraulic simulation model to form an automatic update and iteration correction mechanism, replacing the traditional parameter adjustment method that relies on repeated trial and error based on human experience. This improves the automation level and efficiency of parameter correction. The algorithm of this application seeks optimization in the global scope, avoiding the defect that manual adjustment is prone to getting trapped in local optima. The final optimal parameter set can make the output of the hydraulic simulation model match the actual pipeline network operation state more closely, providing more reliable decision support.
[0020] Reference Figure 1 In step S1, the collected measured operating data includes pressure data, flow data, water level data, pump speed, and valve opening percentage. In step S1, the collected data is preprocessed. During preprocessing, values that exceed the sensor's range or are physically impossible are removed. After removal, anomaly identification and handling are performed. In step S1, when identifying anomalies, the mean and standard deviation of the time series of each measuring point are calculated. Points that deviate from the mean by ±3 times the standard deviation are marked as anomalies. For non-normally distributed data, a density-based local outlier factor algorithm is used to identify isolated points. A maximum allowable rate of change between adjacent sampling points is set. If the rate of change exceeds this threshold, it is judged as a jump anomaly. When handling anomalies, the points marked as anomalies are corrected using linear interpolation. Continuous abnormal periods are removed and recorded as a whole.
[0021] In this embodiment, the application collects various types of measured data, including pressure data, flow data, water level data, pump speed, and valve opening percentage, to ensure the comprehensiveness and reliability of the input data. Preprocessing is performed to remove values exceeding the sensor's range or physically impossible values, thus eliminating obviously erroneous data and providing a high-quality data foundation for subsequent optimization. An anomaly identification method combining statistical thresholds, density clustering, and rate of change thresholds is employed to effectively detect isolated and abrupt anomalies. Further processing using linear interpolation or continuous time period elimination significantly improves the usability of the measured data and reduces interference with parameter correction.
[0022] Reference Figure 1In step S2, a list of parameters to be corrected is extracted from the hydraulic simulation model. The given initial parameter set is used as the first individual in the optimization algorithm population. The remaining individuals are generated within the preset physical boundary using a random sampling method, which together constitute the initial population. Based on hydraulic principles and engineering experience, a clear optimization boundary is set for each parameter (e.g., the Hyzen-Williams coefficient C value for the pipeline is set to 50-150). A boundary absorption over-boundary handling strategy is specified, and a combination of algorithm termination conditions is set, including the maximum number of iterations, the improvement of the objective function value for multiple consecutive generations being less than the convergence threshold, the population diversity being lower than the lower limit, or the optimal individual stagnating for more than the upper limit. The iteration stops when any of the conditions is met.
[0023] In this embodiment, the initial parameter set is used as the first individual in the population and the initial population is generated by random sampling. An optimization boundary and out-of-bounds handling strategy that conform to the hydraulic principle are set. At the same time, a combined termination condition is adopted, which includes the maximum number of iterations, the improvement of the objective function for multiple consecutive generations being less than the convergence threshold, the population diversity being too low or the optimal individual stagnating for more than the limit. The algorithm stops when any condition is met, which improves the global search capability and convergence efficiency of the optimization algorithm and avoids premature convergence or invalid iteration.
[0024] Reference Figure 1 In step S3, for each individual in the current population, the core module of the optimization algorithm maps and replaces the parameter values of that individual according to the input format of the hydraulic simulation model, generates a new model configuration file or parameter table, and calls the simulation calculation engine to perform time-delay simulation calculation on the hydraulic model. The simulation time step is consistent with the sampling interval of the measured data. During the simulation, the simulation engine iteratively solves the head and flow rate of each node based on the basic hydraulic equations. After the simulation is completed, the simulation data of all measuring points at each time step is extracted from the simulation results and sent to step S4 in the form of data frames.
[0025] In this embodiment, the application maps and replaces parameters according to the input format of the simulation model, automatically generating new model configuration files or parameter tables. This decouples parameters from the model structure, facilitating expansion to different types of simulation engines. The simulation engine is called to perform time-delay simulations with sampling intervals consistent with measured data, ensuring strict alignment between simulation results and measured data on the time axis. The simulation engine iteratively solves for the head and flow rate at each node based on fundamental hydraulic equations, ensuring physical consistency. After simulation, simulation data for all measuring points at each time step is extracted from the results and sent to the objective function calculation module in the form of data frames. This provides a standardized input interface for subsequent error quantification, improving processing efficiency.
[0026] Reference Figure 1Step S4 involves constructing an objective function to quantify the difference between simulated data and measured data. This function uses a weighted root mean square error (RMSE) form, taking the square root of the weighted sum of the squared relative errors between the simulated and measured values at different time steps for each measurement point. The objective function constructed in step S4 is a weighted root mean square error function, expressed as follows: In the formula, F is the calculated function value, N is the total number of measurements, i is the current i-th measurement point, Ki is the weight coefficient of the i-th measurement point, Li is the simulation data of the i-th measurement point, and Si is the actual measured data of the i-th measurement point.
[0027] In this embodiment, the objective function is in the form of weighted root mean square error, which can comprehensively quantify the differences between simulation and actual measurement at different time steps for each measurement point. By adjusting the importance of different measurement points through weight coefficients, the parameter correction is made more targeted, improving the simulation accuracy of key areas. The specific weighted root mean square error calculation formula clearly states that the error calculation method is the square root of the weighted sum of relative error squares, eliminating the influence of dimensions, facilitating the comparison of errors between different measurement points, and the weight coefficients can be flexibly configured to enhance the adaptability of the objective function.
[0028] Reference Figure 1 In step S5, for all individuals in the current population, the objective function value of each individual is obtained using the simulation data obtained in step S3 and the calculation in step S4. Then, a genetic algorithm is used to execute selection operators, crossover operators, and mutation operators to generate a new generation of population.
[0029] In this embodiment, the application uses selection, crossover, and mutation operators of a genetic algorithm to generate a new generation of population. First, the selection operator is executed based on the objective function value of each individual in the current population to ensure that excellent individuals have a higher probability of passing their genes to the next generation. The crossover operator is executed on the selected individuals with a certain probability to simulate biological chromosome recombination and conduct local exploration in the parameter space to generate new parameter combinations. The mutation operator is executed with a lower probability to randomly fine-tune some parameters of some individuals to maintain population diversity and prevent the algorithm from getting trapped in local optima too early. These three operators work together to enable the population to continuously evolve towards the global optimal solution region during the iteration process, while avoiding premature convergence.
[0030] Reference Figure 1 When correcting the parameters of the hydraulic simulation model in steps S1 to S7, a web-based dashboard is used to display the current iteration number, the optimal fitness curve, the parameter distribution histogram, and the error comparison chart before and after model correction in real time.
[0031] In this embodiment, a web-based dashboard is used to display the number of iterations, fitness curves, parameter distribution, and error comparison charts in real time, making the parameter correction process transparent and visual. The correction results are more intuitive, making it easier for engineers to monitor the optimization process, analyze the convergence status, and quickly locate anomalies.
[0032] Reference Figure 2 A hydraulic simulation parameter correction system based on optimization algorithms includes an acquisition unit, a processing unit, a simulation unit, a function unit, an optimization unit, and a correction unit. The acquisition unit is used to acquire the initial parameter set of the corrected hydraulic simulation model and the operating data of the actual pipeline network system. The processing unit preprocesses, identifies, and handles anomalies in the data acquired by the acquisition unit. The simulation unit calls the hydraulic simulation model and outputs simulation data. The function unit receives the simulation data and the measured operating data to construct an objective function and calculates the objective function value of the current population. The optimization unit calculates the objective function value of all individuals in the current population and generates a new generation population. The correction unit receives the optimal parameter set and writes it into the configuration file of the hydraulic simulation model to complete the model correction.
[0033] In this embodiment, the present application constructs a fully automated correction system from data acquisition, preprocessing, simulation calculation, error quantification, population optimization to model update through the collaborative work of the acquisition unit, processing unit, simulation unit, function unit, optimization unit and correction unit. This achieves the engineering integration of the methods of claims 1 to 9 and improves the automation and practicality of hydraulic simulation parameter correction.
[0034] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. The units and algorithm steps of the various examples described in the embodiments can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0035] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0036] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0037] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for correcting hydraulic simulation parameters based on optimization algorithms, characterized in that: Includes the following steps: Step S1: Obtain the initial parameter set of the hydraulic simulation model to be corrected, and collect the measured operating data of the real pipeline system at multiple time steps; Step S2: Use the initial parameter set as the initial population of the optimization algorithm, and set the parameter optimization boundary and the algorithm termination condition. Step S3: For each individual in the current population, substitute its corresponding parameter value into the hydraulic simulation model to perform simulation calculations and obtain the simulation data of each measuring point at the corresponding time step. Step S4: Construct the objective function to quantify the difference between the simulation data and the measured running data; Step S5: Calculate the objective function values of all individuals in the current population and generate a new generation population; Step S6: Repeat steps S3 to S5 until the algorithm termination condition is met, and output the optimal parameter set that minimizes the objective function value. Step S7: Update the optimal parameter set into the hydraulic simulation model to complete the parameter correction.
2. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: In step S1, the collected measured operating data includes pressure data, flow data, water level data, pump speed and valve opening percentage. In step S1, the collected data is preprocessed. During preprocessing, values that exceed the sensor range or are physically impossible are removed. After removal, anomaly identification and anomaly handling are performed.
3. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: In step S1, when identifying anomalies, the mean and standard deviation of the time series of each measurement point are calculated. Points that deviate from the mean by more than 3 times the standard deviation are marked as anomalies. For non-normally distributed data, a density-based local outlier factor algorithm is used to identify isolated points. The maximum allowable rate of change between adjacent sampling points is set. If the rate of change exceeds the threshold, it is judged as a jump anomaly. When handling anomalies, the points marked as anomalies are corrected by linear interpolation. Continuous abnormal periods are removed and recorded as a whole.
4. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: In step S2, a list of parameters to be corrected is extracted from the hydraulic simulation model. The given initial parameter set is used as the first individual in the optimization algorithm population. The remaining individuals are generated within the preset physical boundary using a random sampling method, which together constitute the initial population. Based on hydraulic principles and engineering experience, a clear optimization boundary is set for each parameter. The boundary absorption out-of-bounds handling strategy is specified, and a combination of algorithm termination conditions is set, including the maximum number of iterations, the improvement of the objective function value for multiple consecutive generations being less than the convergence threshold, the population diversity being lower than the lower limit, or the optimal individual stagnating for more than the upper limit. The iteration stops when any of the conditions is met.
5. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: In step S3, for each individual in the current population, the core module of the optimization algorithm maps and replaces the parameter values of that individual according to the input format of the hydraulic simulation model, generating a new model configuration file or parameter table. The simulation calculation engine is then called to perform time-delay simulation calculations on the hydraulic model. The simulation time step is consistent with the sampling interval of the measured data. During the simulation, the simulation engine iteratively solves the head and flow rate of each node based on the basic hydraulic equations. After the simulation is completed, the simulation data of all measuring points at each time step is extracted from the simulation results and sent to step S4 in the form of data frames.
6. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: Step S4 constructs an objective function to quantify the difference between the simulation data and the measured data. This function adopts the form of weighted root mean square error, which is the square root of the weighted sum of the squared relative errors of the difference between the simulation value and the measured value at different time steps for each measurement point.
7. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 5, characterized in that: In step S4, the objective function constructed is the weighted root mean square error function, the expression of which is: In the formula, F is the calculated function value, N is the total number of measurements, i is the current i-th measurement point, Ki is the weight coefficient of the i-th measurement point, Li is the simulation data of the i-th measurement point, and Si is the actual measured data of the i-th measurement point.
8. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: In step S5, for all individuals in the current population, the objective function value of each individual is obtained using the simulation data obtained in step S3 and the calculation in step S4. Then, a genetic algorithm is used to execute selection operators, crossover operators, and mutation operators to generate a new generation of population.
9. The hydraulic simulation parameter correction method based on optimization algorithm according to claim 1, characterized in that: When correcting the parameters of the hydraulic simulation model in steps S1 to S7, a web-based dashboard is used to display the current iteration number, the optimal fitness curve, the parameter distribution histogram, and the error comparison chart before and after model correction in real time.
10. A hydraulic simulation parameter correction system based on an optimization algorithm, employing a hydraulic simulation parameter correction method based on an optimization algorithm as described in any one of claims 1-9, characterized in that: The system includes a data acquisition unit, a processing unit, a simulation unit, a function unit, an optimization unit, and a correction unit. The data acquisition unit is used to acquire the initial parameter set of the hydraulic simulation model and the operating data of the actual pipeline network system. The processing unit preprocesses, identifies, and handles anomalies in the data acquired by the data acquisition unit. The simulation unit calls the hydraulic simulation model and outputs simulation data. The function unit receives the simulation data and the measured operating data to construct an objective function and calculates the objective function value of the current population. The optimization unit calculates the objective function value of all individuals in the current population and generates a new generation of population. The correction unit receives the optimal parameter set, writes it into the configuration file of the hydraulic simulation model, and completes the model correction.