Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
When the heating station is used for heating the dispersed users, a heating medium is usually heated by using a mode of fire coal, fuel gas, a heat pump and the like, and the heating medium can be steam, water and other fluids. Keeping the heating medium in the main pipe to reach the heating target temperature on the premise of keeping the pressure of the main heating pipe stable, and heating the reflowed heating medium is needed. But the adjustment modes of different heating modes are different, the adjustment lag time is also different, and the price is also different. Heating modes can be divided into a passive heating mode and an active heating mode, wherein the passive heating mode comprises solar heating, namely solar heating is carried out through a solar vacuum tube, but the heating mode has uncertainty and needs to be estimated and calculated.
The active heating mode comprises various modes, such as the cheapest price of coal heating, but the coal supply amount of the boiler needs to be adjusted, and the residual coal amount in the coal-fired boiler is difficult to adjust in time, so that the time after the thermal power of the coal-fired boiler is adjusted is long, and the thermal power cannot be adjusted in time. The heating cost of the gas boiler is moderate, and the dynamic adjustment can be realized only by adjusting the gas supply quantity. The heat pump has low starting speed and low response speed, but has higher response speed than that of coal heating, and has different heating economic performances under different outdoor temperature environments, and specific comprehensive calculation needs to be performed by combining factors such as electricity price, environment temperature, heating power consumption ratio and the like.
Meanwhile, due to different heating and heat preservation conditions of a user and multiple changes of ambient temperature and humidity, the heat dissipation power of a user side and the heat dissipation power of the transmitted heat dissipation power also change, and the estimated calculation is needed.
In order to reduce the heating price as much as possible while responding to the heating demand in time, the present invention provides the following.
Referring to fig. 1 to 2, the present invention provides a multi-energy complementary central heating intelligent control system, which comprises a control end 1 and a heating unit, wherein the heating unit comprises an active heating unit 2 and a passive heating unit. In the specific implementation process, the control terminal 1 first executes step S1 to obtain a heating target temperature, where the heating target temperature is usually a temperature signed by a heating company and a user or a subordinate heating dealer. During operation of the heating network, it is necessary to maintain the heating pressure, which is also signed by the heating company with the user or the subordinate heating distributor. Step S2 may be performed to obtain the heating reflux temperature and the heating flow rate in real time, and record and obtain a corresponding history. Step S3 may be performed to estimate a probability distribution interval of the target total heat power at the next adjustment time of the interval setting time period from the history of the heating target temperature and the heating flow rate. I.e. to estimate the total heat power of the heating target in the future.
In the scheme, the heating unit comprises an active heating unit and a passive heating unit, and the passive heating unit can realize heating without energy consumption or almost without energy consumption, such as solar energy, so that the activation priority of the passive heating unit is higher than that of the active heating unit from the aspect of energy conservation. Step S4 may then be performed to obtain the thermal power per unit of each heating unit, and step S5 may then be performed to obtain the maximum thermal power and the tempering response delay for each active heating unit. Step S6 may be performed to obtain real-time thermal power of each passive heating unit, and a history of thermal power of each passive heating unit may be obtained. Step S7 may be performed to estimate a probability distribution interval of the accumulated thermal power of the active heating unit at the next adjustment time according to the history of the thermal power of each passive heating unit and the probability distribution interval of the target total thermal power at the next adjustment time. And finally, step S8 can be executed to calculate the thermal power of each active heating unit at the next adjustment moment according to the thermal power unit price, the maximum thermal power and the probability distribution interval of the accumulated thermal power of the active heating unit at the next adjustment moment.
After the thermal power of each active heating unit at the next adjustment moment is calculated, the view angle of the active heating unit 2 is used for explaining the scheme, firstly, the active heating unit 2 can execute step S01 to obtain the identification of the active heating unit, then execute step S02 to press the thermal power corresponding to the active heating unit at the next adjustment moment, and finally execute step S03 to adjust the active heating unit at the next adjustment moment according to the corresponding thermal power.
In the implementation process, historical data are recorded, and the target thermal power probability distribution interval of the next adjustment moment is estimated. And meanwhile, the unit price of the thermal power of the heating unit is acquired, and the passive unit is prioritized. And estimating the accumulated thermal power probability distribution interval of the active unit according to the real-time thermal power and the target probability distribution interval. And calculating the thermal power of the active unit at the next adjustment moment by combining the unit price, the maximum power and the accumulated power probability distribution interval. Thereby achieving the technical effects of optimizing the heat power distribution of the heating system and reducing the heating cost.
To supplement the above-described implementation procedures of step S1 to step S8, source codes of part of the functional modules are provided, and a comparison explanation is made in the annotation section. In order to meet the data security requirements of related laws and regulations on heating and ventilation engineering and municipal facilities, partial data which does not influence implementation of a scheme is subjected to desensitization treatment, and the following is the same.
#include<vector>
#include<algorithm>
Interface for a// prediction algorithm
#include "prediction_algorithm.h"
Interface for hardware for/(and acquisition and control
#include "hardware_interface.h"
Class of/(and defined heating units)
class HeatingUnit {
public:
double powerUnitPrice;// thermal power unit price
double maxPower;// maximum thermal power
std: vector < double > powerHistory;// thermal power history
};
Active and passive heating units
std::vector<HeatingUnit>activeUnits;
std::vector<HeatingUnit>passiveUnits;
int main() {
Obtaining/obtaining a target temperature
double targetTemperature = getTargetTemperature();
Obtaining and recording a history of heating reflux temperature and heating flow rate while maintaining heating pressure
std::vector<double>returnTemperatures, flowSpeeds;
while(shouldMaintainPressure()) {
returnTemperatures.push_back(getReturnTemperature());
flowSpeeds.push_back(getFlowSpeed());
}
Probability distribution interval of target total thermal power of next adjustment moment
std::pair<double, double>predictedTotalPowerInterval = predictTotalPower(targetTemperature, returnTemperatures, flowSpeeds);
Obtaining the unit price and the maximum thermal power of the thermal power of each heating unit, and recording the history of the thermal power of the passive heating unit
for (auto&unit : activeUnits) {
unit.powerUnitPrice = getPowerUnitPrice(unit);
unit.maxPower = getMaxPower(unit);
}
for (auto&unit : passiveUnits) {
unit.powerUnitPrice = getPowerUnitPrice(unit);
unit.powerHistory.push_back(getRealTimePower(unit));
}
Probability distribution interval of accumulated thermal power of active heating unit at next adjustment moment
std::pair<double, double>predictedActivePowerInterval = predictActivePower(passiveUnits, predictedTotalPowerInterval);
According to the heat power unit price, the maximum heat power of each active heating unit and the probability distribution interval of the accumulated heat power of the active heating unit at the next adjustment moment, calculating to obtain the heat power of each active heating unit at the next adjustment moment
for (auto&unit : activeUnits) {
unit.maxPower = calculateNextActivePower(unit, predictedActivePowerInterval);
}
return 0;
}
This code describes the flow of a heating system. First, a target temperature of heating is acquired, and then a history of heating reflux temperature and heating flow rate is acquired and recorded while maintaining heating pressure. Then, a probability distribution section of the target total heat power at the next adjustment time is predicted. Then, the thermal power unit price and maximum thermal power of each heating unit (including active and passive heating units) are obtained, and a history of the thermal power of the passive heating units is recorded. Based on the thermal power history of the passive heating unit and the predicted total thermal power interval, a probability distribution interval of the accumulated thermal power of the active heating unit at the next adjustment moment is predicted. And finally, calculating the thermal power of each active heating unit at the next adjustment moment according to the thermal power unit price, the maximum thermal power and the predicted thermal power interval of each active heating unit.
Referring to fig. 3, in order to calculate a probability distribution interval of the target total thermal power estimated at the next adjustment time, step S3 may be executed first in the implementation process, where step S31 estimates the probability distribution interval of the heating reflux temperature and the heating flow rate at the next adjustment time for the interval set time according to the history of the heating reflux temperature and the heating flow rate. Step S32 may be executed to calculate a probability distribution interval of the target total heat power at the next adjustment time from the probability distribution intervals of the heating target temperature, the heating return temperature at the next adjustment time, and the heating flow rate. In a specific implementation, step S32 may be performed by the following steps:
the heating target temperature Ttarget is known.
The probability distribution interval of the heating return temperature Tnext and the flow velocity v at the next adjustment timing is known.
For example, the whole interval of Tnext is equally divided into 10 sub-intervals, and the interval of v is equally divided into 5 sub-intervals.
The joint probability distribution of each Tnext interval and v interval is calculated.
Since Tnext and v are independent, the joint probability of each subinterval, approbotion, is the product of the interval probabilities.
For each joint interval, calculating a corresponding target thermal power:
Qtarget = ρcpv(Ttarget - Tnext) xA
where ρ is the water density, cp is the specific heat capacity, and A is the cross-sectional area of the pipe.
And obtaining a probability distribution interval of the target thermal power Qtarget at the next moment by using the joint probability.
For example, tnet is at (40 ℃,50 ℃) and v is within the (2 m/s,3 m/s) interval, the corresponding Qtarget interval is (500 kW,800 kW), with a probability of 0.1.
And synthesizing the results of all the intervals to obtain the probability distribution interval of the target thermal power at the next adjustment moment.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
Interface for/(and introduction of predictive algorithm
#include "prediction_algorithm.h"
std::pair<double, double>predictNextTotalPower(std::vector<double>&targetTemperatures, std::vector<double>&returnTemperatures, std::vector<double>&flowSpeeds) {
Heating reflux temperature and probability distribution interval of heating flow rate at next adjustment time of preset interval time length according to history record of heating reflux temperature and heating flow rate
std::pair<double, double>nextReturnTemperatureInterval = predictReturnTemperature(returnTemperatures);
std::pair<double, double>nextFlowSpeedInterval = predictFlowSpeed(flowSpeeds);
Calculating the probability distribution interval of the target total heat power at the next adjustment time according to the heating target temperature, the heating reflux temperature at the next adjustment time and the probability distribution interval of the heating flow rate
std::pair<double, double>nextTotalPowerInterval = calculateTotalPower(targetTemperatures, nextReturnTemperatureInterval, nextFlowSpeedInterval);
return nextTotalPowerInterval;
}
Referring to fig. 4, in order to specifically implement the estimation of the heating reflux temperature and the heating flow rate at the next adjustment time, step S31 may be executed to obtain the fitting function of the heating reflux temperature and the heating flow rate with respect to time according to the history of the heating reflux temperature and the heating flow rate in the specific implementation process. Step S312 may be performed next to acquire, as the adjacent monotonic intervals, monotonic intervals in which the current time is located in the fitting function of the heating reflux temperature and the heating flow rate with respect to time, respectively. Step S313 may be performed to obtain desired values of the heating reflux temperature and the heating flow rate at the next adjustment time according to fitting functions of the heating reflux temperature and the heating flow rate with respect to time in the adjacent monotonic interval, respectively. Step S314 may then be performed to calculate differences between the actual values and the predicted values of the sets of heating reflux temperatures and heating flow rates in the adjacent monotonic intervals, respectively, as estimated error values for the heating reflux temperatures and heating flow rates in the adjacent monotonic intervals. Step S315 may be performed to obtain estimated error value distributions of the heating reflux temperature and the heating flow rate according to the estimated error values of the heating reflux temperature and the heating flow rate in the adjacent monotonic interval, respectively. Step S316 may be performed to obtain a probability distribution interval of the heating reflux temperature and the heating flow rate at the next adjustment time from the expected values of the heating reflux temperature and the heating flow rate at the next adjustment time and the estimated error value distribution of the heating reflux temperature and the heating flow rate.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
#include<vector>
#include<algorithm>
#include<numeric>
A// structure for maintaining a history of temperature and flow rate
struct DataRecord {
double time;
double temperature;
double speed;
};
Structure for storing estimated error value
struct EstimationError {
double temperatureError;
double speedError;
};
Calculating estimated error value
EstimationError CalculateEstimationError(const std::vector<DataRecord>&dataRecords) {
Calculating fitting function according to history record, and obtaining adjacent monotone interval, this part has been processed
auto fitFunction = [](double time){ return DataRecord{time, 0.0, 0.0}; };
Calculating the expected value of the next adjustment time
DataRecord expectedValue = fitFunction(dataRecords.back().time + 1);
Calculating estimated error value
EstimationError estimationError;
for (const auto&record : dataRecords) {
DataRecord estimatedValue = fitFunction(record.time);
estimationError.temperatureError += std::abs(record.temperature - estimatedValue.temperature);
estimationError.speedError += std::abs(record.speed - estimatedValue.speed);
}
estimationError.temperatureError /= dataRecords.size();
estimationError.speedError /= dataRecords.size();
return estimationError;
}
Calculating probability distribution interval of next adjustment time
void CalculateNextAdjustmentInterval(const std::vector<DataRecord>&dataRecords) {
Calculating estimated error value
EstimationError estimationError = CalculateEstimationError(dataRecords);
Obtaining probability distribution interval of next adjustment moment according to estimated error value distribution
The specific implementation requires the use of a specialized statistical or data analysis library, to give just one example
double nextTemperatureInterval =estimationerror. Tempeatureerror;// probability distribution interval of heating return temperature
double nextSpeedInterval =estimationerror. Speederror;// probability distribution interval of heating flow rate
Probability distribution interval of next adjustment moment of output
std is the probability distribution interval of the heating reflux temperature at the next adjustment moment of cout < ">: "< < nextTemperatureInterval < < std: endl;
std is the probability distribution interval of heating flow rate at next adjustment moment of cout < ">: "< < next speedinterval < < std:: endl;
}
the code first defines a structure for maintaining a history of heating return temperature and heating flow rate, and defines a structure for maintaining an estimated error value. And then calculating the expected value and the estimated error value of the next adjustment moment, and obtaining a probability distribution interval of the next adjustment moment according to the estimated error value. Finally, it outputs the probability distribution interval of the next adjustment time.
The main purpose of the code is to estimate the probability distribution interval of the heating reflux temperature and the heating flow rate at the next adjustment moment according to the history of the heating reflux temperature and the heating flow rate. Some simple mathematical and statistical methods are used in this process, such as fitting functions, calculating averages and probability distribution intervals, etc.
Referring to fig. 5, because the environmental temperature and the usage habit of the user are similar or identical in the adjacent monotonic interval, the estimated error values of the heating reflux temperature and the heating flow rate should float within a certain range, so that the abnormal values can be eliminated. Specifically, in the implementation process of step S315, step S3151 may be performed first to clearly obtain the relationship between the estimated error value of the heating reflux temperature and the heating flow rate in the adjacent monotonic interval and time. Step S3152 may then be performed to obtain upper and lower boundary fit functions, respectively, of the estimated error values of the heating return temperature and heating flow rate in the vicinity of the monotonic interval with respect to time. Step S3153 may be performed to obtain and retain the difference between the corresponding upper boundary fitting function and lower boundary fitting function among the estimated error values of the heating reflux temperature and heating flow rate in the adjacent monotonic interval, and remove the other difference. Step S3154 may be performed to sequentially program the estimated error values of the heating reflux temperature and the heating flow rate in the adjacent monotonic intervals into an error sequence according to the numerical order. Step S3155 may be performed to calculate average differences between adjacent estimated error values in the error sequence table corresponding to the heating reflux temperature and the heating flow rate, respectively, as estimated error average differences. Step S3156 may be performed to remove the estimated error values in the error sequence table corresponding to the heating reflux temperature and the heating flow rate, where the estimated error values adjacent to the error sequence table are greater than the average error value corresponding to the estimated error, so as to obtain a plurality of corrected estimated error values of the heating reflux temperature and the heating flow rate. After the abnormal data is removed, step S3157 may be performed to calculate the numerical distributions of the corrected estimated error values of the heating reflux temperature and the heating flow rate, respectively, to obtain the estimated error value distributions of the heating reflux temperature and the heating flow rate.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
#include<vector>
#include<algorithm>
#include<numeric>
Structure of value of error and time
struct ErrorData {
double time;
double errorValue;
};
Calculating the estimated error value distribution
std::vector<double>CalculateEstimationErrorDistribution(const std::vector<ErrorData>&errorData) {
The upper and lower boundary fitting functions exist
auto upperFitFunction = [](double time){ return 0.0; };
auto lowerFitFunction = [](double time){ return 0.0; };
Error value remaining between upper and lower boundary fitting functions
std::vector<ErrorData>retainedData;
for (const auto&data : errorData) {
double upper = upperFitFunction(data.time);
double lower = lowerFitFunction(data.time);
if (data.errorValue>= lower&&data.errorValue<= upper) {
retainedData.push_back(data);
}
}
Sequencing by error value
std::sort(retainedData.begin(), retainedData.end(), [](const ErrorData&a, const ErrorData&b) {
return a.errorValue<b.errorValue;
});
Calculating average difference value of adjacent error values
std::vector<double>diff(retainedData.size() - 1);
for (size_t i = 0; i<retainedData.size() - 1; ++i) {
diff[i] = retainedData[i+1].errorValue - retainedData[i].errorValue;
}
double avgDiff = std::accumulate(diff.begin(), diff.end(), 0.0) / diff.size();
Error values greater than the mean difference are/is rejected
std::vector<double>retainedErrors;
for (size_t i = 0; i<retainedData.size() - 1; ++i) {
if (diff[i]<= avgDiff) {
retainedErrors.push_back(retainedData[i].errorValue);
}
}
return retainedErrors;
}
The code first retains the error values between the upper and lower boundary fit functions and then orders the error values. Then, calculating average difference values of adjacent error values, and eliminating error values larger than the average difference values. And finally, returning a result to obtain the corrected estimated error value distribution of the heating reflux temperature and the heating flow rate.
Referring to fig. 6, since the passive heating unit such as the solar vacuum tube is greatly affected by the environment, the thermal power of the passive heating unit needs to be estimated. Specifically, the above-mentioned step S7 in the specific implementation process may first perform step S71 to estimate, according to the history of the thermal power of each passive heating unit, a probability distribution interval of the thermal power of each passive heating unit at the next adjustment time. Finally, step S72 may be executed to calculate a probability distribution interval of the accumulated thermal power of the active heating unit at the next adjustment time according to the target total thermal power at the next adjustment time and the probability distribution interval of the thermal power of each passive heating unit.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
#include<vector>
#include "estimate_distribution.h"
#include "calculate_cumulative_heat_power_distribution.h"
Estimation of heat power distribution and calculation of accumulated heat power
std::vector<double>calculateNextHeatPowerDistribution(std::vector<double>&targetTotalHeatPower, std::vector<std::vector<double>>&passiveUnitHistories) {
std::vector<std::vector<double>>passiveUnitDistributions;
Estimating probability distribution interval of thermal power of each passive heating unit at next adjustment moment according to history record of thermal power of each passive heating unit
for(auto&history : passiveUnitHistories) {
auto distribution = estimateDistribution(history);
passiveUnitDistributions.push_back(distribution);
}
Calculating the probability distribution interval of the accumulated thermal power of the active heating unit at the next adjustment moment according to the target total thermal power at the next adjustment moment and the probability distribution interval of the thermal power of each passive heating unit
auto cumulativeHeatPowerDistribution = calculateCumulativeHeatPowerDistribution(targetTotalHeatPower, passiveUnitDistributions);
return cumulativeHeatPowerDistribution;
}
Referring to fig. 7, on the premise that the passive heating unit is a vacuum solar tube, the vacuum solar tube has a direct relationship with the sunlight angle and the cloud cover shielding state. In a common weather environment with occasional cloud cover, step S711 may be performed to obtain a fitting function of the thermal power of the passive heating unit with respect to time in daytime when the current moment is located according to the history of the thermal power of each passive heating unit. Step S712 may then be performed to calculate an upper envelope of the fitted function image of the thermal power of the passive heating unit with respect to time at the daytime at the current time as a fitted function of the ideal thermal power of the passive heating unit with respect to time at the daytime at the current time in the unobscured state. Step S713 may then be performed to calculate the desired thermal power of the passive heating unit at the next adjustment time according to a fitting function of the desired thermal power of the passive heating unit with respect to time during the daytime in which the current time is in the non-occluded state. Step S714 may be performed to obtain a loss value of the heat power of the passive heating unit under a plurality of sunshade periods of the daytime period of the current time according to the difference between the fitting function of the heat power of the passive heating unit of the daytime period of the current time and the fitting function of the ideal heat power of the passive heating unit of the daytime period of the current time. Step S715 may be performed to calculate occurrence probabilities of different thermal power loss values according to the thermal power loss values of the passive heating unit in the plurality of sunshade periods of the daytime period in which the current time is located. Finally, step S716 may be executed to calculate a probability distribution interval of the thermal power of the passive heating unit at the next adjustment time according to the expected thermal power of the passive heating unit at the next adjustment time and the occurrence probability of different thermal power loss values.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
#include<Eigen/Dense>
#include<vector>
The history of the thermal power of the passive heating unit is assumed to be stored in a two-dimensional vector, each element being a binary group representing a moment in time and the corresponding thermal power
typedef std::pair<double, double>TimeHeatPair;
It is assumed that we have a function called calclueateupenvelope which can calculate the upper envelope of a set of points and return a fitting function
Eigen::VectorXd calculateUpperEnvelope(const std::vector<TimeHeatPair>&data);
It is assumed that we have a function called calculobabactigraphy, which calculates the probability distribution of the loss values
Eigen::VectorXd calculateProbabilityDistribution(const std::vector<double>&losses);
void calculateNextHeatPower(const std::vector<TimeHeatPair>&history) {
Obtaining a fitting function of the heat power of the passive heating units in daytime at the current moment relative to time according to the history of the heat power of each passive heating unit
Eigen::VectorXd fitFunction = calculateFitFunction(history);
Calculating and obtaining an upper envelope of a fitting function image of the thermal power of the passive heating unit of the daytime at the current moment relative to time as a fitting function of the ideal thermal power of the passive heating unit of the daytime at the current moment relative to time in a non-shielding state
Eigen::VectorXd idealFitFunction = calculateUpperEnvelope(history);
Calculating the expected thermal power and loss value for the next adjustment instant
double nextExpectedHeatPower = calculateNextExpectedHeatPower(idealFitFunction);
std::vector<double>losses = calculateLosses(fitFunction, idealFitFunction);
Probability distribution of the calculated loss value
Eigen::VectorXd lossProbDistribution = calculateProbabilityDistribution(losses);
Calculating the probability distribution of the thermal power at the next adjustment time from the probability distribution of the desired thermal power and the loss value
Eigen::VectorXd nextHeatPowerProbDistribution = calculateNextHeatPowerProbDistribution(nextExpectedHeatPower, lossProbDistribution);
}
In the codes, firstly, a fitting function of the heat power of the passive heating unit relative to time in daytime at the current moment is obtained according to historical heat power data by using a calcuitef function, and then, a fitting function of ideal heat power is calculated. The expected thermal power and loss values for the next trim time are then calculated using the calcualatenextgjectedheatpower and calcualatelosses functions. Finally, the probability distribution of the thermal power at the next adjustment moment is calculated according to the probability distribution of the expected thermal power and the loss value by using the calculateProbabilitydistribution function and the calculateNextHeatPowerProbdistribution function.
Referring to fig. 8, since the weather is not uniform throughout the day, for example, the current time is afternoon and the cloud layer in the afternoon is denser, the sun-shading state is more, the cloud layer in the afternoon may be thinner, the sun-shading state is less, and the sun-shading cannot estimate the state of the thermal power loss value at the current time in the afternoon by using the sun-shading period in the afternoon. Specifically, during the daytime period in which the current time is located, step S715 described above may first perform step S7151 of calculating, from the current time, the mode of the time length of each sunshade period so far back to back from one to the next as the current sunshade characteristic time length.
Step S7152 may be performed next to determine, each time the current sunshade characteristic duration is calculated, whether the duration of each sunshade period so far calculated by the current time is smaller than the current sunshade characteristic duration, back to back one by one. If so, the process may then return to step S7152 to continue the calculation of the current sunshade characteristic duration in a forward trace. If not, step S7153 may be performed next to take the sunshade period that has been traced forward as an effective sunshade period. Finally, step S7154 may be performed to obtain occurrence probabilities of different thermal power loss values according to the numerical distribution of the thermal power loss values of the passive heating unit in the effective sunshade period.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
#include<vector>
#include "calculate_mode.h"
#include "calculate_loss_values.h"
#include "calculate_loss_probabilities.h"
Calculating probability of occurrence of different thermal power loss values
std::vector<double>calculateHeatPowerLossProbabilities(std::vector<double>&shadowPeriods, std::vector<double>&heatPowerLossValues) {
std::vector<double>validShadowPeriods;
std::vector<double>lossProbabilities;
while (!shadowPeriods.empty()) {
In daytime period where the current moment is, the mode of the time length of each sunshade period up to now is calculated from the current moment in a backward trace way one by one as the current sunshade characteristic time length
double currentShadowFeatureLength = calculateMode(shadowPeriods);
bool allLessThanFeatureLength = true;
for (auto&period : shadowPeriods) {
if (period>= currentShadowFeatureLength) {
allLessThanFeatureLength = false;
break;
}
}
If not, taking the sun-shading period which is traced forward as an effective sun-shading period;
if (!allLessThanFeatureLength) {
validShadowPeriods = shadowPeriods;
break;
}
if yes, continuing to trace forward to calculate the current sun-shading characteristic duration;
shadowPeriods.pop_back();
}
Obtaining occurrence probability of different thermal power loss values according to numerical distribution of thermal power loss values of passive heating unit under effective sunshade period
if (!validShadowPeriods.empty()) {
auto lossValues = calculateLossValues(validShadowPeriods, heatPowerLossValues);
lossProbabilities = calculateLossProbabilities(lossValues);
}
return lossProbabilities;
}
This function first calculates the mode of the duration of each sunshade period and takes this mode as the current sunshade characteristic duration. The function then checks whether the duration of each sunshade period is less than this characteristic duration. If all the time lengths are smaller than the characteristic time length, the function continues to trace forward and update the characteristic time length. Otherwise, the already traced back sunshade periods are considered valid, the function will calculate the distribution of the thermal power loss values based on these valid periods, and further calculate the occurrence probability of different thermal power loss values.
Referring to fig. 9, in order to plan different active heating units to achieve the technical purpose of saving heating cost, in the specific implementation process of step S81, step S81 may be executed first to obtain, as the target accumulated heat power, the accumulated heat power of the active heating unit required by the probability that the accumulated heat power of the active heating unit at the next adjustment time is greater than the heating target and higher than the set probability, according to the probability distribution interval of the accumulated heat power of the active heating unit at the next adjustment time. Step S82 may be performed next to obtain an activation sequence of each active heating unit according to a thermal power unit price of each active heating unit from low to high. Finally, step S83 may be executed to sequentially start the active heating units according to the maximum thermal power of each active heating unit and the start sequence of each active heating unit, so that the cumulative thermal power of the started active heating units reaches the target cumulative thermal power, and the thermal power of each active heating unit at the next adjustment moment is obtained.
In order to supplement the implementation process of the steps, source codes of partial functional modules are provided, and the explanation is compared in the annotating part.
#include<vector>
#include<algorithm>
struct ActiveHeatingUnit {
double heatPowerPrice;
double maxHeatPower;
double nextHeatPower;
};
Calculating the thermal power of each active heating unit at the next adjustment instant
void calculateNextHeatPower(std::vector<ActiveHeatingUnit>&units, double cumulativeHeatPowerProb) {
Obtaining the accumulated heat power of the active heating unit with the probability that the accumulated heat power of the active heating unit at the next adjustment moment is larger than a heating target and is higher than a set probability according to the probability distribution interval of the accumulated heat power of the active heating unit at the next adjustment moment as the target accumulated heat power
double targetCumulativeHeatPower = getTargetHeatPower(cumulativeHeatPowerProb);
The activation sequence of each active heating unit is obtained from low to high according to the unit price of the thermal power of each active heating unit
std::sort(units.begin(), units.end(), [](const ActiveHeatingUnit&a, const ActiveHeatingUnit&b) {
return a.heatPowerPrice<b.heatPowerPrice;
});
double currentCumulativeHeatPower = 0;
According to the maximum heat power of each active heating unit, sequentially starting the active heating units according to the starting sequence of each active heating unit, so that the accumulated heat power of the started active heating units reaches the target accumulated heat power
for (auto&unit : units) {
if (currentCumulativeHeatPower + unit.maxHeatPower<= targetCumulativeHeatPower) {
unit.nextHeatPower = unit.maxHeatPower;
currentCumulativeHeatPower += unit.maxHeatPower;
} else {
unit.nextHeatPower = targetCumulativeHeatPower - currentCumulativeHeatPower;
break;
}
}
}
In this piece of code, the target cumulative thermal power is first calculated by the getTargetHeatPower function. The active heating units are then ordered by their thermal power unit price to determine the start-up sequence. Finally, the active heating units are sequentially started in this order so that the accumulated thermal power thereof reaches the target accumulated thermal power. If the accumulated thermal power has reached the target value, but there are also active heating units not activated, the thermal power of these units at the next adjustment instant will be set to 0.
In summary, according to the scheme, the two ends of the heating and the heating are estimated at the same time, so that the accurate estimation of the heat load is realized, and the waste of heat energy is avoided. In the implementation process, firstly, the target total heat power probability distribution interval of the next adjustment moment is estimated by recording historical data of heating target temperature, reflux temperature and flow speed. The unit price of the thermal power of the heating unit is obtained. And then, recording and summarizing the real-time thermal power of the passive unit, and estimating the accumulated thermal power probability distribution interval of the active unit at the next adjustment moment. And finally, calculating the thermal power of the active unit at the next adjustment moment according to the thermal power unit price, the maximum power and the accumulated power probability distribution interval. Optimizing the heat power distribution of the heating system, and achieving the aims of optimizing the heating effect and reducing the heating cost.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by hardware, such as circuits or ASICs (application specific integrated circuits, application Specific Integrated Circuit), which perform the corresponding functions or acts, or combinations of hardware and software, such as firmware, etc.
Although the invention is described herein in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a study of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
The embodiments of the present application have been described above, the foregoing description is exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.