CN113094984A - Random residential water consumption mode simulation method and system based on genetic algorithm - Google Patents
Random residential water consumption mode simulation method and system based on genetic algorithm Download PDFInfo
- Publication number
- CN113094984A CN113094984A CN202110339573.7A CN202110339573A CN113094984A CN 113094984 A CN113094984 A CN 113094984A CN 202110339573 A CN202110339573 A CN 202110339573A CN 113094984 A CN113094984 A CN 113094984A
- Authority
- CN
- China
- Prior art keywords
- water
- random
- water consumption
- time
- resident
- 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.)
- Granted
Links
Images
Classifications
-
- 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
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- 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/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2111/00—Details relating to CAD techniques
- G06F2111/10—Numerical modelling
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Mathematical Analysis (AREA)
- Data Mining & Analysis (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Computing Systems (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Geometry (AREA)
- Algebra (AREA)
- Computer Hardware Design (AREA)
- Databases & Information Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a method and a system for simulating a random water consumption mode of residents based on a genetic algorithm. The method comprises the following steps: continuously monitoring the water consumption of the residential users at set monitoring time intervals, and determining the cumulative frequency of the daily water consumption; building a simulation model of the random water consumption mode of the residents according to the accumulated frequency; based on the multi-family resident random water consumption mode flow matrix and the multi-family resident random water consumption mode water quantity matrix, utilizing a genetic algorithm to take the minimum sum of squares of errors of simulated water quantity and measured water quantity as an objective function, and calibrating the optimal parameters of the random water consumption mode simulation model; determining a random water consumption mode of the residents by utilizing the random water consumption mode simulation model of the residents according to the optimal parameters; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition. The invention can reduce the consumption of the equipment battery and the storage cost while ensuring the simulation precision.
Description
Technical Field
The invention relates to the field of simulation of random water consumption patterns of residents, in particular to a method and a system for simulating random water consumption patterns of residents based on a genetic algorithm.
Background
The leakage of the pipe network comprises real leakage, metering loss and other loss. The metering loss is determined by a metering error curve of the water meter and a water consumption mode of a resident user, and the water consumption mode of the resident user is influenced by the population number of the resident, the sex of the resident, the age of the resident and the working property of the resident, so that the water consumption mode of the resident user has high randomness. The simulation model of the random water consumption mode of the residents is usually established through high-frequency monitoring and water consumption data distribution analysis, but the method has high data acquisition cost and a complicated water consumption data distribution analysis process.
The existing resident water consumption mode simulation method is to directly monitor water consumption data and establish a Poisson rectangular pulse type water consumption mode model, and the scheme of the method is as follows: the method comprises the following steps of continuously monitoring the water consumption signal of a residential user at high frequency, wherein the monitoring time interval is usually 1s, converting the water consumption signal into equivalent rectangular pulses through signal smoothing and separation, wherein each pulse has three basic properties: the method is used for counting and finding that the time arrival rate of the water pulse conforms to Poisson distribution, and the intensity and the duration of the water pulse conform to lognormal distribution. Firstly, simulating the arrival rate of pulses according to Poisson distribution, and converting the arrival rate into pulse generation time; simulating the intensity and duration of the pulse according to the lognormal distribution; and finally, overlapping the instantaneous concurrent pulses to obtain the water consumption mode of the resident user. However, the simulation method is used for directly monitoring water consumption of a user at high frequency, the time interval is usually 1s, the data acquisition time interval is 1s, and 86400s are generated in 24 hours a day, that is, 86400 pieces of data are generated in one day, generally, the data are uploaded 4 times a day, 21600 pieces of data are transmitted each time, the battery of the device is consumed too fast and needs to be replaced frequently, the transmission and storage capacity of the data are increased accordingly, and corresponding high cost is generated.
Disclosure of Invention
The invention aims to provide a method and a system for simulating a random water consumption mode of residents based on a genetic algorithm, which aim to solve the problems of large battery consumption and high storage cost of equipment caused by large data transmission quantity of the conventional method for simulating the water consumption mode of residents.
In order to achieve the purpose, the invention provides the following scheme:
a random resident water use mode simulation method based on genetic algorithm comprises the following steps:
continuously monitoring the water consumption of the residential users at set monitoring time intervals, and determining the cumulative frequency of the daily water consumption;
building a simulation model of the random water consumption mode of the residents according to the accumulated frequency; the resident random water consumption mode simulation model comprises a multi-family resident random water consumption mode flow matrix and a multi-family resident random water consumption mode water quantity matrix;
based on the multi-family resident random water consumption mode flow matrix and the multi-family resident random water consumption mode water quantity matrix, utilizing a genetic algorithm to take the minimum sum of squares of errors of simulated water quantity and measured water quantity as an objective function, and calibrating the optimal parameters of the random water consumption mode simulation model; the optimal parameters comprise average water consumption times in one day, average value of flow pulse, standard deviation of flow pulse, average value of water consumption time and standard deviation of water consumption time;
determining a random water consumption mode of the residents by utilizing the random water consumption mode simulation model of the residents according to the optimal parameters; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition.
Optionally, the cumulative frequency of the daily water consumption is:
wherein, FiThe cumulative frequency of daily water consumption; f. ofjThe frequency of water usage for any period of time; j is the sequence number of any time period, i is the sequence number of the time period, i 1, 2.
Optionally, the constructing a simulation model of the random water consumption pattern of the residents according to the accumulated frequency specifically includes:
simulating the daily water consumption times K of the residential users with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi]Number n of random numbers in intervaliAs any period ziInternal random water use times; lambda is the average water consumption time in one day;
generating any time interval z in sequenceiInner niEach of the combinations (300 × (i-1),300 × i]Uniformly distributed random integers are arranged according to an ascending order to determine the random water use generation time t of the residential usersk(k=1,2,...,K);
Generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofkAnd K parameters are mu2、σ2Duration of water use of Dk(ii) a Wherein K is the number of water used at any time, K is 1,21Is a flow pulse I in a lognormal distributionkAverage value of (d); sigma1Is a flow pulse I in a lognormal distributionkStandard deviation of (d); mu.s2Water consumption time D in lognormal distributionkAverage value of (d); sigma2Water consumption time D in lognormal distributionkStandard deviation of (d);
decomposing the whole day into 86400 moments in units of seconds, and sequentially dividing D into DkIndividual flow rate IkFill in to tkAt the initial moment, determining a flow matrix I of a random water consumption mode of single-family residents1×86400;
According to the random water consumption of a plurality of single-family residentsMode traffic matrix Im×86400Summing up the simulation results for multiple times at the same time to determine a flow matrix A of the random water consumption pattern of the residents of multiple households1×86400(ii) a m is the simulation times;
according to the set monitoring time interval, a random water consumption mode flow matrix A is adopted for the residents of multiple households1×86400The flow summation in the process of determining the water quantity matrix Q of the random water consumption mode of the residents of multiple householdsa=[qa1,qa2,...,qa288];qai(i 1, 2.., 288) is the amount of water used per session;
according to a plurality of multi-family resident random water consumption pattern water quantity matrixes Qa=[qa1,qa2,...,qa288]Averaging multiple simulation results at the same time to determine an average water quantity matrix Q of a multi-user random water consumption modeb=[qb1,qb2,...,qb288];qbi(i 1, 2.., 288) is the average of the water usage for multiple simulations over any period of time.
Optionally, the objective function is:
wherein SS is an objective function, qiThe measured water consumption of all users in any time period.
A random residential water use pattern simulation system based on genetic algorithm comprises:
the accumulated frequency determination module of the daily water consumption is used for continuously monitoring the water consumption of the residential users at set monitoring time intervals and determining the accumulated frequency of the daily water consumption;
the resident random water consumption mode simulation model building module is used for building a resident random water consumption mode simulation model according to the accumulated frequency; the resident random water consumption mode simulation model comprises a multi-family resident random water consumption mode flow matrix and a multi-family resident random water consumption mode water quantity matrix;
the optimal parameter calibration module is used for calibrating the optimal parameters of the random water usage mode simulation model by utilizing a genetic algorithm and taking the minimum sum of squares of errors of simulated water volume and measured water volume as an objective function based on the multi-family resident random water usage mode flow matrix and the multi-family resident random water usage mode water volume matrix; the optimal parameters comprise average water consumption times in one day, average value of flow pulse, standard deviation of flow pulse, average value of water consumption time and standard deviation of water consumption time;
the resident random water consumption mode determining module is used for determining a resident random water consumption mode by utilizing the resident random water consumption mode simulation model according to the optimal parameters; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition.
Optionally, the cumulative frequency of the daily water consumption is:
wherein, FiThe cumulative frequency of daily water consumption; f. ofjThe frequency of water usage for any period of time; j is the sequence number of any time period, i is the sequence number of the time period, i 1, 2.
Optionally, the building module for building the simulation model of the random water consumption pattern of the residents specifically includes:
a random water consumption number determining unit for simulating the daily water consumption number K of the residential user with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi]Number n of random numbers in intervaliAs any period ziInternal random water use times; lambda is the average water consumption time in one day;
a resident user random water use occurrence time determination unit for sequentially generating any time period ziInner niEach of the combinations (300 × (i-1),300 × i]Uniformly distributed random integers are arranged according to an ascending order to determine the random water use generation time t of the residential usersk(k=1,2,...,K);
A flow pulse and water consumption time generating unit for generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofkAnd KOne parameter is mu2、σ2Duration of water use of Dk(ii) a Wherein K is the number of water used at any time, K is 1,21Is a flow pulse I in a lognormal distributionkAverage value of (d); sigma1Is a flow pulse I in a lognormal distributionkStandard deviation of (d); mu.s2Water consumption time D in lognormal distributionkAverage value of (d); sigma2Water consumption time D in lognormal distributionkStandard deviation of (d);
a flow matrix determining unit for determining the random water consumption pattern of single household resident, which is used for decomposing the whole day into 86400 moments by taking seconds as a unit and sequentially dividing DkIndividual flow rate IkFill in to tkAt the initial moment, determining a flow matrix I of a random water consumption mode of single-family residents1×86400;
A flow matrix determining unit for determining flow matrix I according to multiple random water usage patterns of single-family residentsm×86400Summing up the simulation results for multiple times at the same time to determine a flow matrix A of the random water consumption pattern of the residents of multiple households1×86400(ii) a m is the simulation times;
a multi-family resident random water consumption pattern water quantity matrix determining unit for determining a multi-family resident random water consumption pattern water quantity matrix A according to a set monitoring time interval1×86400The flow summation in the process of determining the water quantity matrix Q of the random water consumption mode of the residents of multiple householdsa=[qa1,qa2,...,qa288];qai(i 1, 2.., 288) is the amount of water used per session;
a multi-user random water usage pattern average water quantity matrix determining unit for determining a water quantity matrix Q according to a plurality of multi-user resident random water usage patternsa=[qa1,qa2,...,qa288]Averaging multiple simulation results at the same time to determine an average water quantity matrix Q of a multi-user random water consumption modeb=[qb1,qb2,...,qb288];qbi(i 1, 2.., 288) is the average of the water usage for multiple simulations over any period of time.
Optionally, the objective function is:
wherein SS is an objective function, qiThe measured water consumption of all users in any time period.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects: the invention provides a resident random water consumption mode simulation method and system based on genetic algorithm, the invention carries on the continuous monitoring to the water consumption of the resident user with presuming the monitoring time interval, collect the monitoring data of interval 5min to use for rating the model parameter, after simulating the water consumption mode of user one day according to the model, merge it into the water consumption of interval every 5min, there are 288 merged water volume data all day, compare the 288 simulated water consumption with 288 measured water consumption, when their comprehensive coincidence effect is the best, have obtained the optimum parameter of the model, for prior art, the invention carries on the reverse deduction through the monitoring data of longer time interval (5min), also the water consumption mode of the back deduction precision 1s finally; the continuous measurement is carried out at the set monitoring interval, 288 pieces of data are generated in one day, 72 pieces of data are transmitted at one time, and the magnitude of the data is much smaller than that of the data acquired at the prior art with the acquisition interval of 1s, so that the consumption and the storage cost of the equipment battery are reduced; therefore, the invention reduces the consumption of the equipment battery and the storage cost while ensuring the simulation precision.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a random water usage pattern simulation method for residents based on genetic algorithm provided by the invention;
FIG. 2 is a diagram of a simulation system for random water usage pattern of residents based on genetic algorithm according to the present invention;
FIG. 3 is a graph showing the relationship between time and flow rate of the random water usage pattern of the single household residents according to the present invention;
FIG. 4 is a graph showing the relationship between time and flow rate of a random water usage pattern for 1000 households according to the present invention;
FIG. 5 is a graph of a relationship between genetic algebra and objective function in the genetic algorithm provided by the present invention;
FIG. 6 is a graph of the time-water usage relationship in the genetic algorithm provided by the present invention;
FIG. 7 is a graph of time-absolute error relationship in a genetic algorithm provided by the present invention;
FIG. 8 is a graph of time versus relative error in a genetic algorithm provided by the present invention;
FIG. 9 is a schematic diagram of a single household resident random water usage pattern using the calibrated parameters simulation according to the present invention;
fig. 10 is a schematic diagram of a 1000-family random water usage pattern of the parameter simulation after the utilization rate determination provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a random water use mode simulation method for residents based on a genetic algorithm, which can reduce the consumption of equipment batteries and the storage cost while ensuring the simulation precision.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Fig. 1 is a flow chart of a random residential water consumption pattern simulation method based on a genetic algorithm, as shown in fig. 1, the random residential water consumption pattern simulation method based on the genetic algorithm includes:
step 101: the water consumption of the resident user is continuously monitored at set monitoring time intervals, and the cumulative frequency of the daily water consumption is determined. Wherein, the set monitoring time interval can be 5min, 7min, 10min or other time intervals.
The cumulative frequency of the daily water consumption is as follows:wherein, FiThe cumulative frequency of daily water consumption; f. ofjThe frequency of water usage for any period of time; j is the sequence number of any time period, i is the sequence number of the time period, i 1, 2.
Step 102: building a simulation model of the random water consumption mode of the residents according to the accumulated frequency; the random water consumption model simulation model for the residents comprises a flow matrix of a random water consumption model for the residents of multiple households and a water quantity matrix of a random water consumption model for the residents of multiple households.
The step 102 specifically includes: simulating the daily water consumption times K of the residential users with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi]Number n of random numbers in intervaliAs any period ziInternal random water use times; lambda is the average water consumption time in one day; generating any time interval z in sequenceiInner niEach of the combinations (300 × (i-1),300 × i]Uniformly distributed random integers are arranged according to an ascending order to determine the random water use generation time t of the residential usersk(K ═ 1,2,. K); generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofkAnd K parameters are mu2、σ2Duration of water use of Dk(ii) a Wherein K is the number of water used at any time, K is 1,21Is a flow pulse I in a lognormal distributionkAverage value of (d); sigma1Is a flow pulse I in a lognormal distributionkStandard deviation of (d); mu.s2Water consumption time D in lognormal distributionkAverage value of (d); sigma2Water consumption time D in lognormal distributionkIs markedTolerance; decomposing the whole day into 86400 moments in units of seconds, and sequentially dividing D into DkIndividual flow rate IkFill in to tkAt the initial moment, determining a flow matrix I of a random water consumption mode of single-family residents1×86400(ii) a According to a plurality of single-family resident random water usage pattern flow matrix Im×86400Summing up the simulation results for multiple times at the same time to determine a flow matrix A of the random water consumption pattern of the residents of multiple households1×86400(ii) a m is the simulation times; according to the set monitoring time interval, a random water consumption mode flow matrix A is adopted for the residents of multiple households1×86400The flow summation in the process of determining the water quantity matrix Q of the random water consumption mode of the residents of multiple householdsa=[qa1,qa2,...,qa288];qai(i 1, 2.., 288) is the amount of water used per session; according to a plurality of multi-family resident random water consumption pattern water quantity matrixes Qa=[qa1,qa2,...,qa288]Averaging multiple simulation results at the same time to determine an average water quantity matrix Q of a multi-user random water consumption modeb=[qb1,qb2,...,qb288];qbi(i 1, 2.., 288) is the average of the water usage for multiple simulations over any period of time.
Step 103: based on the multi-family resident random water consumption mode flow matrix and the multi-family resident random water consumption mode water quantity matrix, utilizing a genetic algorithm to take the minimum sum of squares of errors of simulated water quantity and measured water quantity as an objective function, and calibrating the optimal parameters of the random water consumption mode simulation model; the optimal parameters comprise average water consumption times in a day, average value of flow pulse, standard deviation of flow pulse, average value of water consumption time and standard deviation of water consumption time.
The objective function is:wherein SS is an objective function, qiThe measured water consumption of all users in any time period.
Step 104: determining a random water consumption mode of the residents by utilizing the random water consumption mode simulation model of the residents according to the optimal parameters; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition.
Based on the random water use mode simulation method for residents based on the genetic algorithm, the steps are further explained as follows:
the technical scheme of the invention is as follows: selecting a certain number of resident users to continuously monitor the water consumption, solving the average water consumption of the users within a monitoring interval of 5min, and calculating the cumulative frequency of the water consumption; constructing a simulation model of the random water consumption mode of residents to obtain a flow matrix of the random water consumption mode of residents of a single family or a plurality of families and a water matrix of the random water consumption mode of residents; utilizing a genetic algorithm to calibrate five parameters of a random water model simulation model by taking the minimum sum of squares of errors of the simulated water quantity and the measured water quantity as a target function; and substituting the parameters into a random water use model to obtain the random water use mode of single-family and multi-family residents.
The method comprises the following specific implementation steps:
step 1, selecting a certain number of residential users (more than 500 users are suitable), continuously monitoring the water consumption of each user for several days all day, wherein the monitoring time interval is preferably 5min, dividing the all day into 288 time intervals according to the monitoring time interval, and recording as zi(i 1, 2.., 288), solving for ziUser average water consumption q of all users in time periodi(i=1,2,...,288)。
calculating the cumulative frequency F of the daily water consumption according to the frequencyiThe formula is as follows:
step 3, constructing a simulation model of the random water consumption mode of the residential user, which comprises the following specific steps:
(1)simulating the daily water consumption times K of the residential users with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi](i 1, 2.., 288) the number n of random numbers in the intervali(i 1, 2.., 288), as the number of random water uses over the period of time; where λ is a parameter of the poisson distribution, representing the average number of water uses in a day.
(2) Sequentially generating ziN within a time intervaliEach of the combinations (300 × (i-1),300 × i](300 seconds in 5min) and arranging the random integers in ascending order to obtain the random water use generation time t of the residential userk(k=1,2,...,K)。
(3) Generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofk(K ═ 1,2,. K), K parameters μ2、σ2Duration of water use of Dk(K ═ 1,2,. K); wherein, mu1、σ1Is a parameter of lognormal distribution, and respectively represents a flow pulse IkMean and standard deviation of; mu.s2、σ2Is also a lognormal distribution parameter, and respectively represents the water consumption time length DkMean and standard deviation of (d).
(4) Decomposing the whole day into 86400 moments in units of seconds, and sequentially dividing D into DkIndividual flow rate IkFill in to tkAt the initial moment, obtaining a flow matrix I of the random water use mode of the single-family residents1×86400。
(5) Repeating the steps (1), (2), (3) and (4) m times, and constructing a flow matrix I of a plurality of single-family resident random water consumption patternsm×86400Summing up the m times of simulation results at the same time to obtain a flow matrix A of the multi-family resident random water consumption pattern1×86400。
(6) At 5min intervals, for A1×86400The flow in (1) is summed, and the water consumption in each time interval is qai(i 1, 2.., 288), obtaining a water quantity matrix Q of the m-family resident random water consumption modea=[qa1,qa2,...,qa288](ii) a Wherein A is1×86400The flow matrix is a multi-family random water consumption pattern flow matrix, and m single-family random water consumption patternsFlow matrix Im×86400The summation is column-wise, i.e. m users per acquisition time are summed with the water amount.
(1) determining an objective function:the smaller the objective function, the better the parameters. Wherein q isbiIs a random water usage pattern average water quantity matrix Qb=[qb1,qb2,...,qb288]Water consumption in the ith time period, qiThe measured water consumption of all users in the ith time period.
(2) Initializing a population: the number of population individuals is n, the value range of each parameter is that lambda is more than or equal to 120 and less than or equal to 300 and mu is more than or equal to 11≤2、0.3≤σ1≤0.8、2≤μ2≤3、0.9≤σ2≤1.4。
(3) And (3) fitness evaluation: and constructing a population fitness value by using the objective function, and calculating and evaluating the fitness of each individual.
(4) Selection, crossover and mutation operations: selecting individuals with high fitness value in the population according to a certain probability to form a sub-population, and selecting the individuals with high fitness value as a roulette method in the selection operation of a genetic algorithm; and finishing the crossing and mutation operations of the individuals according to different crossing and mutation probabilities.
(5) And (4) judging termination conditions: when the evolution algebra reaches a certain number (such as 20) and the fitness value is not changed for a plurality of continuous generations (such as 20), the evolution is stopped, and the optimal parameters are output.
And 6, substituting the parameters determined by the rate in the step 5 into the step 3 to obtain the random water consumption mode of the residents of one household and multiple households.
Fig. 2 is a structural diagram of a random water consumption pattern simulation system for residents based on a genetic algorithm according to the present invention, and as shown in fig. 2, a random water consumption pattern simulation system for residents based on a genetic algorithm includes:
and the cumulative frequency determining module 201 is used for continuously monitoring the water consumption of the residential users at set monitoring time intervals and determining the cumulative frequency of the daily water consumption.
The cumulative frequency of the daily water consumption is as follows:wherein, FiThe cumulative frequency of daily water consumption; f. ofjThe frequency of water usage for any period of time; j is the sequence number of any time period, i is the sequence number of the time period, i 1, 2.
The building module 202 of the random water consumption model of the residents is used for building the random water consumption model of the residents according to the accumulated frequency; the random water consumption model simulation model for the residents comprises a flow matrix of a random water consumption model for the residents of multiple households and a water quantity matrix of a random water consumption model for the residents of multiple households.
The building module 202 for building the random water consumption pattern simulation model of the residents specifically comprises: a random water consumption number determining unit for simulating the daily water consumption number K of the residential user with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi]Number n of random numbers in intervaliAs any period ziInternal random water use times; lambda is the average water consumption time in one day; a resident user random water use occurrence time determination unit for sequentially generating any time period ziInner niEach of the combinations (300 × (i-1),300 × i]Uniformly distributed random integers are arranged according to an ascending order to determine the random water use generation time t of the residential usersk(k=1K, 2); a flow pulse and water consumption time generating unit for generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofkAnd K parameters are mu2、σ2Duration of water use of Dk(ii) a Wherein K is the number of water used at any time, K is 1,21Is a flow pulse I in a lognormal distributionkAverage value of (d); sigma1Is a flow pulse I in a lognormal distributionkStandard deviation of (d); mu.s2Water consumption time D in lognormal distributionkAverage value of (d); sigma2Water consumption time D in lognormal distributionkStandard deviation of (d); a flow matrix determining unit for determining the random water consumption pattern of single household resident, which is used for decomposing the whole day into 86400 moments by taking seconds as a unit and sequentially dividing DkIndividual flow rate IkFill in to tkAt the initial moment, determining a flow matrix I of a random water consumption mode of single-family residents1×86400(ii) a A flow matrix determining unit for determining flow matrix I according to multiple random water usage patterns of single-family residentsm×86400Summing up the simulation results for multiple times at the same time to determine a flow matrix A of the random water consumption pattern of the residents of multiple households1×86400(ii) a m is the simulation times; a multi-family resident random water consumption pattern water quantity matrix determining unit for determining a multi-family resident random water consumption pattern water quantity matrix A according to a set monitoring time interval1×86400The flow summation in the process of determining the water quantity matrix Q of the random water consumption mode of the residents of multiple householdsa=[qa1,qa2,...,qa288];qai(i 1, 2.., 288) is the amount of water used per session; a multi-user random water usage pattern average water quantity matrix determining unit for determining a water quantity matrix Q according to a plurality of multi-user resident random water usage patternsa=[qa1,qa2,...,qa288]Averaging multiple simulation results at the same time to determine an average water quantity matrix Q of a multi-user random water consumption modeb=[qb1,qb2,...,qb288];qbi(i 1, 2.., 288) is the average of the water usage for multiple simulations over any period of time.
An optimal parameter calibration module 203, configured to calibrate an optimal parameter of the random water usage pattern simulation model based on the multi-family resident random water usage pattern flow matrix and the multi-family resident random water usage pattern water quantity matrix, by using a genetic algorithm and taking a minimum sum of squares of errors between a simulated water quantity and an actually measured water quantity as an objective function; the optimal parameters comprise average water consumption times in a day, average value of flow pulse, standard deviation of flow pulse, average value of water consumption time and standard deviation of water consumption time.
The objective function is:wherein SS is an objective function, qiThe measured water consumption of all users in any time period.
The resident random water consumption mode determining module 204 is configured to determine a resident random water consumption mode by using the resident random water consumption mode simulation model according to the optimal parameter; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition.
The practical case is as follows:
step 1, 776 residential users are selected in a certain community, the water consumption of each user is monitored for 22 consecutive days, the monitoring time interval is 5min, the whole day is divided into 288 time intervals, and the user water consumption q in each time interval is calculated:
step 3, constructing a simulation model of the random water consumption mode of the residential user:
(1) simulating the number of times of water use per day of the resident user with the parameter λ ═ 165 (the value of λ is automatically generated by the genetic algorithm of step 6, and 165 is taken as an example only) according to the poisson distribution, and the result is 141 times; generating 141 random numbers uniformly distributed according to (0,1), and counting (F)i-1,Fi](i 1, 2.., 288), as the number of times of random water use n per period:
(2) sequentially generating n in each time intervaliRandom integers which are uniformly distributed according to (300 x (i-1),300 x i) are arranged in ascending order, and the random water use generation time t of the residential user is obtained:
(3) generating 141 parameters of mu according to lognormal distribution1=1.52、σ1=0.49(μ1、σ1The value of (b) is automatically generated by the genetic algorithm of step 6, here by way of example only) for the flow pulse I (L/min):
from lognormal distribution generation141 parameters are mu2=2.31、σ2=1.08(μ2、σ2The value of (d) is automatically generated by the genetic algorithm of step 6, here by way of example only) for an integer water usage duration d(s):
(4) decomposing the whole day into 86400 times in units of seconds, and sequentially dividing 141 flow rates IkFill in to tkAt the time of initiation, each flow has a duration DkObtaining a flow matrix I of the single-family resident random water usage pattern1×86400As shown in fig. 3.
(5) Repeating the steps (1), (2), (3) and (4)1000 times, and constructing a flow matrix I of 1000 single-family resident random water use patterns1000×86400Summing up 1000 times of simulation results at the same time to obtain a flow matrix A of the multi-family resident random water consumption pattern1×86400As shown in fig. 4.
(6) At 5min intervals, for A1×86400The flow summation in the process of the two steps is carried out to obtain a water quantity matrix q of a 1000-family resident random water consumption modea(m3):
And 6, substituting the parameters determined by the rate in the step 5 into the step 3, and simulating the random water consumption modes of residents of a single family and 1000 families, wherein the results are shown in figures 9-10.
The invention adopts a longer data acquisition time interval of 5min, has smaller data transmission and storage amount, longer battery life and no need of frequent replacement.
In practical application, the following changes are made on the basis of the technical scheme of the invention, so that the technical effect of the invention can be achieved:
(1) the time interval of water monitoring by the user is not necessarily limited to 5min in the present invention, and may be other time intervals, and when other time intervals are adopted, the number of the monitoring periods and the subscripts of the statistics need to be adjusted to corresponding values, for example, "300" of "(300 × (i-1),300 × i)" is replaced with the number of seconds corresponding to the other time intervals, and "5 min" is replaced with the other time intervals adopted. When the time interval is 15min, the daily monitoring time interval is 96, the maximum value of the subscript of each corresponding statistic is 96, random numbers uniformly distributed among (900 x (i-1) and 900 x i) are generated, and the flow is summed according to the 15min interval.
(2) When the parameters are calibrated by using the genetic algorithm, the range of the parameters can be modified according to the research results of other documents, the population scale, selection, intersection and mutation operators can be adjusted according to the actual situation, and the termination condition of the genetic algorithm evolution can be that the objective function does not change after the evolution is carried out for multiple generations, such as: and taking the target function smaller than a set value as a termination condition.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.
Claims (8)
1. A random resident water use mode simulation method based on genetic algorithm is characterized by comprising the following steps:
continuously monitoring the water consumption of the residential users at set monitoring time intervals, and determining the cumulative frequency of the daily water consumption;
building a simulation model of the random water consumption mode of the residents according to the accumulated frequency; the resident random water consumption mode simulation model comprises a multi-family resident random water consumption mode flow matrix and a multi-family resident random water consumption mode water quantity matrix;
based on the multi-family resident random water consumption mode flow matrix and the multi-family resident random water consumption mode water quantity matrix, utilizing a genetic algorithm to take the minimum sum of squares of errors of simulated water quantity and measured water quantity as an objective function, and calibrating the optimal parameters of the random water consumption mode simulation model; the optimal parameters comprise average water consumption times in one day, average value of flow pulse, standard deviation of flow pulse, average value of water consumption time and standard deviation of water consumption time;
determining a random water consumption mode of the residents by utilizing the random water consumption mode simulation model of the residents according to the optimal parameters; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition.
2. The random residential water pattern simulation method based on a genetic algorithm as claimed in claim 1, wherein the cumulative frequency of the daily water consumption is:
3. The method for simulating the random residential water use pattern based on the genetic algorithm as claimed in claim 2, wherein the constructing the random residential water use pattern simulation model according to the cumulative frequency specifically comprises:
simulating the daily water consumption times K of the residential users with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi]Number n of random numbers in intervaliAs any period ziInternal random water use times; lambda is the average water consumption time in one day;
generating any time interval z in sequenceiInner niEach of the combinations (300 × (i-1),300 × i]Uniformly distributed random integers are arranged according to an ascending order to determine the random water use generation time t of the residential usersk(k=1,2,...,K);
Generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofkAnd K parameters are mu2、σ2Duration of water use of Dk(ii) a Wherein k is the number of water used at any time, and k is 1,2,...,K,μ1Is a flow pulse I in a lognormal distributionkAverage value of (d); sigma1Is a flow pulse I in a lognormal distributionkStandard deviation of (d); mu.s2Water consumption time D in lognormal distributionkAverage value of (d); sigma2Water consumption time D in lognormal distributionkStandard deviation of (d);
decomposing the whole day into 86400 moments in units of seconds, and sequentially dividing D into DkIndividual flow rate IkFill in to tkAt the initial moment, determining a flow matrix I of a random water consumption mode of single-family residents1×86400;
According to a plurality of single-family resident random water usage pattern flow matrix Im×86400Summing up the simulation results for multiple times at the same time to determine a flow matrix A of the random water consumption pattern of the residents of multiple households1×86400(ii) a m is the simulation times;
according to the set monitoring time interval, a random water consumption mode flow matrix A is adopted for the residents of multiple households1×86400The flow summation in the process of determining the water quantity matrix Q of the random water consumption mode of the residents of multiple householdsa=[qa1,qa2,...,qa288];qai(i 1, 2.., 288) is the amount of water used per session;
according to a plurality of multi-family resident random water consumption pattern water quantity matrixes Qa=[qa1,qa2,...,qa288]Averaging multiple simulation results at the same time to determine an average water quantity matrix Q of a multi-user random water consumption modeb=[qb1,qb2,...,qb288];qbi(i 1, 2.., 288) is the average of the water usage for multiple simulations over any period of time.
5. A random residential water use pattern simulation system based on genetic algorithm is characterized by comprising:
the accumulated frequency determination module of the daily water consumption is used for continuously monitoring the water consumption of the residential users at set monitoring time intervals and determining the accumulated frequency of the daily water consumption;
the resident random water consumption mode simulation model building module is used for building a resident random water consumption mode simulation model according to the accumulated frequency; the resident random water consumption mode simulation model comprises a multi-family resident random water consumption mode flow matrix and a multi-family resident random water consumption mode water quantity matrix;
the optimal parameter calibration module is used for calibrating the optimal parameters of the random water usage mode simulation model by utilizing a genetic algorithm and taking the minimum sum of squares of errors of simulated water volume and measured water volume as an objective function based on the multi-family resident random water usage mode flow matrix and the multi-family resident random water usage mode water volume matrix; the optimal parameters comprise average water consumption times in one day, average value of flow pulse, standard deviation of flow pulse, average value of water consumption time and standard deviation of water consumption time;
the resident random water consumption mode determining module is used for determining a resident random water consumption mode by utilizing the resident random water consumption mode simulation model according to the optimal parameters; and the resident random water use mode is used for reflecting the water use change rule of the user so as to formulate a water supply scheme and analyze the water supply leakage condition.
6. The system according to claim 5, wherein the cumulative frequency of the daily water consumption is:
7. The system according to claim 6, wherein the module for constructing the random water use pattern simulation model of the residents comprises:
a random water consumption number determining unit for simulating the daily water consumption number K of the residential user with the parameter of lambda according to Poisson distribution, generating K random numbers which accord with (0,1) uniform distribution, and counting (F)i-1,Fi]Number n of random numbers in intervaliAs any period ziInternal random water use times; lambda is the average water consumption time in one day;
a resident user random water use occurrence time determination unit for sequentially generating any time period ziInner niEach of the combinations (300 × (i-1),300 × i]Uniformly distributed random integers are arranged according to an ascending order to determine the random water use generation time t of the residential usersk(k=1,2,...,K);
A flow pulse and water consumption time generating unit for generating K parameters of mu according to lognormal distribution1、σ1Flow rate pulse I ofkAnd K parameters are mu2、σ2Duration of water use of Dk(ii) a Wherein K is the number of water used at any time, K is 1,21Is a flow pulse I in a lognormal distributionkAverage value of (d); sigma1Is a flow pulse I in a lognormal distributionkStandard deviation of (d); mu.s2Water consumption time D in lognormal distributionkAverage value of (d); sigma2Water consumption time D in lognormal distributionkStandard deviation of (d);
a flow matrix determining unit for determining the random water consumption pattern of single household resident, which is used for decomposing the whole day into 86400 moments by taking seconds as a unit and sequentially dividing DkIndividual flow rate IkFill in to tkAt the initial moment, determining a flow matrix I of a random water consumption mode of single-family residents1×86400;
A flow matrix determining unit for determining flow matrix I according to multiple random water usage patterns of single-family residentsm×86400Summing up the simulation results for multiple times at the same time to determine a flow matrix A of the random water consumption pattern of the residents of multiple households1×86400(ii) a m is the simulation times;
a multi-family resident random water consumption pattern water quantity matrix determining unit for determining a multi-family resident random water consumption pattern water quantity matrix A according to a set monitoring time interval1×86400The flow summation in the process of determining the water quantity matrix Q of the random water consumption mode of the residents of multiple householdsa=[qa1,qa2,...,qa288];qai(i 1, 2.., 288) is the amount of water used per session;
a multi-user random water usage pattern average water quantity matrix determining unit for determining a water quantity matrix Q according to a plurality of multi-user resident random water usage patternsa=[qa1,qa2,...,qa288]Averaging multiple simulation results at the same time to determine an average water quantity matrix Q of a multi-user random water consumption modeb=[qb1,qb2,...,qb288];qbi(i 1, 2.., 288) is the average of the water usage for multiple simulations over any period of time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110339573.7A CN113094984B (en) | 2021-03-30 | 2021-03-30 | Resident random water consumption mode simulation method and system based on genetic algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110339573.7A CN113094984B (en) | 2021-03-30 | 2021-03-30 | Resident random water consumption mode simulation method and system based on genetic algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113094984A true CN113094984A (en) | 2021-07-09 |
CN113094984B CN113094984B (en) | 2023-05-05 |
Family
ID=76670853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110339573.7A Active CN113094984B (en) | 2021-03-30 | 2021-03-30 | Resident random water consumption mode simulation method and system based on genetic algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113094984B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113553684A (en) * | 2021-07-21 | 2021-10-26 | 中国科学院生态环境研究中心 | Residential random water use mode-based community faucet water quality simulation method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108764473A (en) * | 2018-05-23 | 2018-11-06 | 河北工程大学 | A kind of BP neural network water demands forecasting method based on correlation analysis |
CN109146196A (en) * | 2018-09-07 | 2019-01-04 | 河北工程大学 | A kind of residential communities hourly water demand forcast method |
US20200319057A1 (en) * | 2019-04-03 | 2020-10-08 | Tongji University | Method for acquiring water leakage amount of leakage area in water distribution system |
-
2021
- 2021-03-30 CN CN202110339573.7A patent/CN113094984B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108764473A (en) * | 2018-05-23 | 2018-11-06 | 河北工程大学 | A kind of BP neural network water demands forecasting method based on correlation analysis |
CN109146196A (en) * | 2018-09-07 | 2019-01-04 | 河北工程大学 | A kind of residential communities hourly water demand forcast method |
US20200319057A1 (en) * | 2019-04-03 | 2020-10-08 | Tongji University | Method for acquiring water leakage amount of leakage area in water distribution system |
Non-Patent Citations (5)
Title |
---|
QIANG ZHIMIN等: "Development of systems for detection, early warning, and control of pipeline leakage in drinking water distribution: A case study", 《JOURNAL OF ENVIRONMENTAL SCIENCES》 * |
刘书明;王欢欢;徐鹏;徐速;: "多目标大规模供水管网监测点的优化选址", 清华大学学报(自然科学版) * |
刘强,邹立芝,李虎: "遗传算法在地下水资源管理中的应用──以松原市区的地下水资源管理为例", 世界地质 * |
强志民等: "供水管网漏损研究知识结构与发展趋势分析", 《给水排水》 * |
马啸;李露;: "基于线性回归法预测南方居民夜间合法用水量研究", 给水排水 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113553684A (en) * | 2021-07-21 | 2021-10-26 | 中国科学院生态环境研究中心 | Residential random water use mode-based community faucet water quality simulation method and system |
CN113553684B (en) * | 2021-07-21 | 2023-06-16 | 中国科学院生态环境研究中心 | Residential area faucet water quality simulation method and system based on resident random water use mode |
Also Published As
Publication number | Publication date |
---|---|
CN113094984B (en) | 2023-05-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108593990B (en) | Electricity stealing detection method based on electricity consumption behavior mode of electric energy user and application | |
CN109376925B (en) | Dynamic self-adaptive optimization method for node flow of water supply pipe network | |
CN108446794A (en) | One kind being based on multiple convolutional neural networks combination framework deep learning prediction techniques | |
CN115693757A (en) | Photovoltaic energy optimization regulation and control method based on digital twinning technology | |
CN114780622B (en) | Intelligent heat supply data analysis method and system based on big data platform | |
CN108288231B (en) | method for evaluating influence of distributed photovoltaic access on load characteristics of power distribution station | |
CN111078787B (en) | Block chain consensus method based on random number mapping | |
CN112130109A (en) | Method for detecting metering performance abnormity of intelligent electric energy meter | |
CN116593896B (en) | State detection method and system of battery energy storage system and electronic equipment | |
CN106684885A (en) | Multi-scene analysis-based reactive power optimization method for power distribution network of wind power generation set | |
CN113094984A (en) | Random residential water consumption mode simulation method and system based on genetic algorithm | |
CN108733351A (en) | A kind of random digit generation method based on block chain | |
CN115498628A (en) | Reliability assessment method and system for power distribution network containing energy storage | |
CN111027886B (en) | Low-voltage treatment scheme evaluation method considering unit cost effectiveness | |
CN110533291B (en) | Medium voltage distribution network weak link identification method based on risk assessment | |
CN115267645A (en) | Error calculation method, monitoring system and equipment of low-power-factor electric energy meter | |
CN117200271A (en) | Power grid energy management method and system based on hybrid energy storage | |
CN104537448A (en) | Method for improving state division of wind power Markov chain model based on longitudinal moments | |
CN106897771B (en) | New energy sample board machine selection method and system based on chaotic genetic algorithm | |
CN113159468A (en) | Energy consumption data quality comprehensive evaluation method and system | |
CN113094652B (en) | Water meter water quantity metering loss determining method and system | |
CN109919362A (en) | A kind of Medium-and Long-Term Runoff Forecasting method for considering hydraulic engineering scheduling and influencing | |
CN114707860A (en) | ECI-based user power utilization information management system | |
CN109376494A (en) | A kind of Probabilistic Load Flow based on electric system determines method and system | |
CN117057516B (en) | Carbon accounting parameter analysis and prediction method based on system dynamics |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |