# Results A sensitivity analysis was

To guarantee that the DHW needs are satisfied, after running the economic dispatch model, a penalty is introduced to the dispatch costs, in case the overall backup needs are not met or are exceeded. Different weights in the penalties are given to the solution according to its fulfillment with the backup needs, and the summary of the applied penalties are presented by Equations (16), (17) and (18):•If it 10058-F4 meets the overall backup needs, the penalties are lower even if it does not meet the hour it should (Equation (16));•If it does not meet the overall backup needs, the penalties are higher (Equation (17)), since it causes a problem of satisfaction to the end-user;•If it exceeds the backup needs, the penalties are lower than if it does not meet (Equation (18)). Although sperm brings excess of electricity that cannot be absorbed by the grid, that is a small problem to the grid manager but not to the end-user, that has his thermal needs satisfied.equation(16)if∑i=1mxi=Maxbackup∧ ∑i=1dxi=Maxbackup→penalty=0∑i=1dxi<Maxbackup→penalty=p∑i=1dxi≥Maxbackup→penalty=12pequation(17)if∑i=1mxi<Maxbackup∧ ∑i=1dxi=Maxbackup→penalty=12p2∑i=1dxi<Maxbackup→penalty=2p2∑i=1dxi≥Maxbackup→penalty=p2equation(18)if∑i=1mxi≥Maxbackup∧ ∑i=1dxi=Maxbackup→penalty=14p2∑i=1dxi<Maxbackup→penalty=p2∑i=1dxi≥Maxbackup→penalty=12p2where p   is a penalty factor defined by p=2‖Δb‖p=2‖Δb‖.