• No results found

Chapter 2 Research Hypothesis and Methodology

2.2. Tool Development

2.2.2. Optimizer

2.2.2.1. Optimization Initializer

The optimization initializer module of PEPSO reads all required data from the project file and stores it in a suitable structure for optimization. It reads and stores all information that is provided through the forms that were introduced in Section2.2.1, in addition to information of WDS that is provided by the EPANET hydraulic model and emission factors that are provided by the LEEM report. A copy of all imported data into the optimization data structure will be written into the first section of the optimization text report. It helps users to better understand characteristics of the optimization run when they are using the final text report. The optimization project data structure keeps the address of the project folder and name of all input and output files. By default the project folder stores the project file (*.prj), ANN models of the WDS (*.net), text output (*.txt), graphical outputs (*.fig and *.jpg) and EPANET optimized model (*.inp).

Address of the Project Folder Address of the EPANET Model

Address of the Text Output

Max Constraints Table Address of the ANN Training Set

Optimization Start Time Unit System 1

List of Electricity Meter 2

EPANET Water Network Model3

Pump Constraints 4

Tank Constraints 5

Strategic Junction Constraints 6

Strategic Pipe Constraints7

List of Pumps List of Tanks List of Strategic Junctions

List of Strategic Pipes List of Demand Patterns

Optimization Options 8 Reporting Options 9 Initial Population 10

Final Pareto Frontier 10

Figure 17- Diagram of the optimization data structure (for more information see Appendix B)

As previously mentioned, the optimization structure also read and stores information of the EPANET hydraulic model, including the number of WDS components,

pattern, report and start times, and unit system that is used in the EPANET hydraulic model. Figure 17 shows the main diagram of the optimization data structure. All numbered items in this diagram are sub-structures that have been expanded in Appendix B.

All inputs, including water demand pattern, pump status, electricity tariff, emission factors and all outputs in the form of time series must have the same time reference, time step and duration as the optimization time reference, time step and duration. The optimization initializer module uses the start time of optimization, optimization time step, hydraulic model time step, hydraulic pattern start time and time steps, and hydraulic simulation start time to adjust the timing of all inputted energy cost and emission factor patterns and prepares them for use in the optimization process.

In the current version of PEPSO, the optimization duration and time step, which are defined by users via the optimization options form, dictate duration and time step of all the above mentioned time series. However, the start clock-time of the EPANET hydraulic model defines the time reference and start point of the time series, including the pump schedule. If the duration of the defined energy cost pattern is less than the duration of optimization, the same pattern will be repeated to cover the whole optimization duration. In the case of the emission factor, this correction is a little bit more complicated. LEEM 2.5 currently provides between 6 to 37 hours of emission factor prediction (based on time and location of data query). Therefore, if the duration of predicted emission factors data is shorter than the optimization duration, emission factors of the same clock time of the previous day will be used to fill the lack of predicted emission data. It is assumed that emission factors of the previous day are not considerably different from emission factors of the same clock time of the next day and are acceptable candidates to fill the lack of prediction data without changing the final result drastically. However, errors are expected

especially when this assumption covers days that are holidays, weekends, drastic temperature/climate changes, and so on.

If the optimization time step is larger than energy cost pattern or emission factor time steps, all energy cost and emission factor values that fall into an optimization time step will be averaged based on their contribution time. For instance if the optimization time step is one hour and for 15 minutes of an hour energy price is 0.1 ($/kWh) and for the other 45 minutes is 0.16 ($/kWh) the weighted average energy price of that time step is (15 / 60) × 0.1 + (45 / 60) × 0.16 = 0.145 ($/kWh). If the optimization time step is shorter than the energy cost pattern or emission factor time steps, these will be broken into the smaller time steps with equal length to the optimization time step. For instance, assume that the optimization time step is three hours and emission factor of CO2 at the first hour

is 1.5 (lb/MWh) and for the next two hours is 0.9 (lb/MWh). The emission factor value of that three hour time block is calculated as: (1 / 3) × 1.5 + (2 / 3) × 0.9 = 1.1 (lb/MWh). Sometimes it may happen that LEEM cannot provide an emission factor value for a time step. In this case, PEPSO fills the missing value with average emission factor during the optimization period.

All PEPSO calculations use the time unit of seconds. So all non-second input time values will be converted to second. All requested non-second output values will also be converted before reporting. In addition to the time unit, all other physical units of PEPSO calculations are SI units. Although it is possible for users to use the US customary unit system for inputting and receiving outputs, PEPSO converts these units to SI system, before using in the calculation and converts the result back again to the US customary before reporting. Pressure unit in PEPSO calculation is the meter of water head, and

discharge unit is cubic meter per second. However, for input data, PEPSO accepts all units that are accepted by EPANET V2.0.12 (Rossman 2000).

The optimization initializer module also creates an initial population of solutions and appends it to the optimization structure. This function that creates the initial population is explained in the following section.