Action disabled: source

Create jEPlus Project for Optimisation

jEPlus project for optimisation

The concept of jEPlus+EA is using Evolutionary Algorithms search through the design space defined by a jEPlus project. A few rules have to be followed when preparing the project.

Project file name and location

If you are going to run simulations on the local computer, there is not any restrictions on naming of the project file. If you plan to use remote simulation, however, the rules for naming the project file, and the location of the model files must be followed:

  1. The jEPlus project file must be named “project.jep” (all letters in lower case)
  2. All the files used in a jEPlus project must be stored under one folder, together with the project file. These files normally include IDF models, weather files, RVI/MVI file, etc.
  3. Within the jEPlus project, and in the IMF models containing included parts, all paths must be in relative form, relative to the location of the project file.

Parameter tree

jEPlus+EA recognizes only the first branch of the parameter tree. If your project needs to change multiple parameters synchronously, please use the combinatorial parameter syntax (see jEPlus User's Manual). The screenshots below illustrate the method.

Parameter tree using branches
Parameter tree using combinatorial parameter

Other limitations

The optimisation project only considers the IDF models and the parameters in the parameter tree as design variables. Weather files is not a design option, for obvious reasons. If multiple weather files are defined in the project, only the first one will be used in the simulations.

Extracting simulation results

jEPlus+EA uses jEPlus to run simulations and extract results. The result data to be collected are controlled by the extended RVI file. Its format is explained in jEPlus User's Manual. Below is the output of the CostExample project.

The RVI file below extracts Electicity:Facility from the eplusout.eso files, and chiller capacity and construction cost from the eplusout.sql files.

eplusout.mtr
eplusout.csv
Electricity:Facility 
0

!-sqlite
! Output file name; Column headers; SQL command
ChillerCap; Chiller Nominal Capacity [W]; select Value from ComponentSizes WHERE (CompType='Chiller:Electric' AND CompName='CHILLER PLANT CHILLER' AND Description='Nominal Capacity')
ConsCost; Construction Cost [$/m2]; select Value from TabularDataWithStrings WHERE (ReportName='Construction Cost Estimate Summary' AND ReportForString='Entire Facility' AND TableName='Construction Cost Estimate Summary' AND RowName='Cost Per Conditioned Building Area (~~$~~/m2)' AND ColumnName='Current Bldg. Model' AND Units='' AND RowId=10)
!-end sqlite

!-user spreadsheet
! Output file name; User spreadsheet file name; columns to extract (e.g. 3, 5, 6, 7)

!-end user spreadsheet

!-objectives
! Name of the objective; unit; formula (c0, c1, c2... are columns in the result table generated from the statements above)
Electricity; kWh; c0/1000/3600
Chiller Capacity; kW; c1/1000
Construction Cost; $/m2; c2
!-end objectives

Here are the contents of SimResults.csv, ChillerCap.csv and ConsCost.csv:

#	 Job_ID					Date/Time	Electricity:Facility [J](RunPeriod)
0	 EP_G-T_0-W_0-P1_3-P2_2-P3_6-P4_10	 simdays=062	2.45006E+11
1	 EP_G-T_0-W_0-P1_12-P2_7-P3_9-P4_7	 simdays=062	2.48272E+11
2	 EP_G-T_0-W_0-P1_26-P2_7-P3_9-P4_3	 simdays=062	2.40981E+11
3	 EP_G-T_0-W_0-P1_28-P2_9-P3_12-P4_15	 simdays=062	2.56798E+11
...
#	 Job_ID					Reserved	Chiller Nominal Capacity [W]
0	 EP_G-T_0-W_0-P1_3-P2_2-P3_6-P4_10	  		198041.9565
1	 EP_G-T_0-W_0-P1_12-P2_7-P3_9-P4_7	  		205437.5095
2	 EP_G-T_0-W_0-P1_26-P2_7-P3_9-P4_3	  		178832.5217
3	 EP_G-T_0-W_0-P1_28-P2_9-P3_12-P4_15	  		239298.8464
...
#	 Job_ID	 				Reserved	Construction Cost [$/m2]
0	 EP_G-T_0-W_0-P1_3-P2_2-P3_6-P4_10		  	1134.64
1	 EP_G-T_0-W_0-P1_12-P2_7-P3_9-P4_7	  		1353.2
2	 EP_G-T_0-W_0-P1_26-P2_7-P3_9-P4_3	  		1346.23
3	 EP_G-T_0-W_0-P1_28-P2_9-P3_12-P4_15	  		1577.55
...

Defining objective functions

The objective functions of the optimisation project are specified in the extended RVI file, too. The objective function definition must be placed within the block between the “!-objectives” and “!-end objectives” markers. Each objective occupies one row, and is defined with the following syntax:

<Name of the objective>; <unit>; <formula>

The formula of an object can include arithmetic calculations, math functions, and conditional tests. It is used to perform simple calculations from the model simulation results for the objective value.

Firstly, the model simulation results (data columns in the result tables described in the previous section) are referenced as C0, C1, C2 and so on. To verify the references, you can use the “Create Combined Table…” command in jEPlus to aggregate the results. In the column headers of the combined table, the variable references will be marked. The command and the result table are shown in the screenshots below.

Command for creating a combined result table
Combined table column headers showing result variable IDs

Here are some example formulae of the objective functions.

Simple unit conversion:

Electricity; kWh; c0/1000/3600
Chiller Capacity; kW; c1/1000

Calculation from multiple columns:

Carbon Emission; kg CO2e; (c0+c1+c2/2.9)/1000/3600*0.685 + (c3+c4)/0.86/1000/3600*0.195

Conditional calculation - area-weighted mean discomfort hours in multiple zones, with a threshold of 200 hours.

Discomfort; Hours; ((c5*365.1454 + c6*42 + c7*42 + c8*42 + c9*42 + c10*37.898 + c11*365.1654 + c12*42 + c13*42 + c14*42 + c15*42 + c16*37.898)/1142.0868 > 200) * (c5*365.1454 + c6*42 + c7*42 + c8*42 + c9*42 + c10*37.898 + c11*365.1654 + c12*42 + c13*42 + c14*42 + c15*42 + c16*37.898)/1142.0868