title: Sensitivity analysis of an EnergyPlus model
text: # Sensitivity analysis of an EnergyPlus model
  
  Sensitivity analysis identifies how uncertainties in input parameters affect important measures of building performance, such as cost, indoor thermal comfort, or $CO_2$ emissions. Input parameters for buildings fall into roughly three categories:
  
  * Discrete design alternatives, e.g. different glazing options, number of storeys, etc.
  * Variance in physical parameters such as U-values, air tightness and location of leakages, and variance/uncertainty in economic parameters such as interest rate, energy prices, or service-life.
  * Stochastic behaviour-related parameters such as occupancy pattern (number, timing, and location), and use of hot water, window airing, lighting and electrical equipment. Differing personal preferences for air temperature and lighting level.
  
  Each parameter has a different distribution of possible values. Sensitivity analysis is an effective way of identifying which parameters influence simulation results the most, and thus need more attention during design. More specifically, sensitivity analysis qualifies how much each parameter affects the results, either individually or in combination (synergistic or antagonistic), and quantifies the variance in possible outcomes, such as energy costs, and is thus a very powerful quantitative tool for decision making.
  
  ## EnergyPlus
  
  EnergyPlus is a whole-building energy simulation program that engineers, architects, and researchers use to model both energy consumption — for heating, cooling, ventilation, lighting, and process and plug loads — and water use in buildings. Its development is funded by the U.S. Department of Energy Building Technologies Office. EnergyPlus is a console-based program that reads input and writes output to text files. Several comprehensive graphical interfaces for EnergyPlus are also available.
  
  ### Main features
  
  * Integrated, simultaneous solution of thermal zone conditions and HVAC system response that does not assume that the HVAC system can meet zone loads and can simulate un-conditioned and under-conditioned spaces.
  * Sub-hourly, user-definable time steps for interaction between thermal zones and the environment; with automatically varied time steps for interactions between thermal zones and HVAC systems
  * Heat balance-based solution of radiant and convective effects that produce surface temperatures thermal comfort and condensation calculations
  * Atmospheric pollutant calculations
  * Anisotropic sky model
  * Combined heat and mass transfer model that accounts for air movement between zones.
  * Heat transfer model
  * Simulation based on climate zone
  * Advanced fenestration models including controllable window blinds, electrochromic glazings, and layer-by-layer heat balances that calculate solar energy absorbed by window panes.
  * Component-based HVAC that supports both standard and novel system configurations.
  
  ### Stand-alone vs coupled simulation
  
  EnergyPlus is normally used as a stand-alone command-line application or together with one of many free or commercial GUIs. However, EnergyPlus can be linked with other applications to simulate more advanced numerical models. One method is BCVTB (Building Controls Virtual Test Bed), which allows users to couple different simulation programs for co-simulation, and to couple simulation programs with actual hardware. For example, the BCVTB can simulate a building in EnergyPlus and the HVAC and control system in Modelica, exchanging data between them as they simulate. Programs that can be linked to BCVTB include EnergyPlus, Modelica (OpenModelica or Dymola), Functional Mock-up Units, MATLAB, and Simulink, Ray tracing (physics)|ray-tracing, ESP-r, TRNSYS, BACnet stack.
  
  ## Applications for sensitivity analysis with EnergyPlus
  
  There exist many software tools that can automate sensitivity analysis to various degrees. Here is a non-exhaustive list. Most of these tools have multiple options, including one-at-a-time sensitivity analysis, multidimensional discrete parametric, continuous low-discrepancy distributions, and pareto-front optimization (listed alphabetically):
  
  * EnergyPlus parametric IDF objects. This simple method is limited to discrete parametric analysis, using the auxiliary ParametricPreprocessor program that is bundled with EnergyPlus.
  * EPlusR (EnergyPlus R): A research-level scripting toolkit for EnergyPlus in R (programming language).
  * EpXL (EnergyPlus Excel): A simple Excel spreadsheet application with options for sensitivity/parametric analysis and pareto-front optimization.
  * GenOpt (Generic Optimization Program), optionally with the free GenOpt GUI ExcalibBEM
  * jEPlus (Jython EnergyPlus): A simulation manager for parametric analysis with EnergyPlus.
  * OpenStudio Analysis Framework and Spreadsheet: A front-end for the OpenStudio Server, allowing for users to create large-scale cloud analyses using OpenStudio measures.
  * SALib: A Python library for general sensitivity analysis, which can be used with user-defined scripts to run EnergyPlus and extract results.
  * ... or pretty much any other scripting language
  
  ## Examples of sensitivity analyses
  
  ### Example 1: Simulation of dwelling
  
  A modern house which is located in Upper Austria is considered for the sensitivity analysis of construction materials. The building to be simulated is a modern two-story house with a cellar. The volume of the building is approximately 761 m^3. The house is located at Hagenberg in Upper Austria. The walls are made of 25 cm thick bricks without insulation except for the cellar. The windows and glassdoors are standard double glazed with an intermediate layer of air We have used EnergyPlus for simulating the house model. For building our simulation framework we have used the software tool Building Controls Virtual Test Bed (BCVTB). We can define for example a heating control of an EnergyPlus building model with the control logic implemented in MATLAB.
  
  ### Example 2: Simulation of school
  
  An elementary school is considered for the sensitivity analysis of occupancy. Schedules were selected to model typical variation in school daily operations, although the authors acknowledge that schools can also operate on twelve-month calendars or with extended night school hours. Variability for energy model inputs is defined by assigning different sets of 24-hour diversity factors for weekdays, weekends, holidays, etc. to the maximum load of each end-use (occupants, lighting, equipment, etc.).
  
  ### Example 3: Experiments on material properties
  
  The experiments were performed in the following way: Influence of the material properties in the house were tested. First a framework using BCVTB, EnergyPlus and MATLAB have been created so that the values can be sent to EnergyPlus online to overwrite the outside temperature. Secondly, a batch file is set up to do the following:
  
  * change the EnergyPlus input file with a different value of the material property
  * call BCVTB to run the co-simulation between EnergyPlus and MATLAB
  * run a script to calculate the MAE of the real and simulated indoor temperature
  * move to the next value of the range (if not finished) and go to (1).
  
  Following this procedure mean absolute error (MAE) can be calculated for all values of all ranges. It assumed that the material properties are independent of each other. Therefore, each material property will be varied at a time, leaving the others constant at the default values (from EnergyPlus) and measured the mean absolute error (MAE) between the real indoor and the simulated temperatures. The range of material properties was given by an expert. The specific room under study has a lot of fenestration, so it is not so surprising to see that the influence of the solar transmittance of the windows is the most influential of all material properties analyzed. The next influential factor is the conductivity of the bricks, followed by the thermal absorptance and the specific heat of the bricks. The most influential properties of the materials analyzed (bricks and glasses) are the solar transmittance of the glasses and the conductivity of the bricks.
  
  ### Example 4: Experiments of occupancy variance
  
  Uncertainties regarding behavior of building occupants limit the ability of energy models to accurately predict actual building performance. The first step in crude uncertainty analysis is the assessment of plausible ranges of values for model parameters. In this case, it was first necessary to identify the salient model parameters characterizing the building occupant. The parameters that had the most impact on total energy use are listed according to importance for both warm and cold climates.
  
  Important parameters in a warm climate zone:
  
  * Equipment load (High)
  * Ventilation rate (High)
  * Equipment load (Low)
  * Infiltration rate (High)
  * Ventilation rate (Low)
  
  Important parameters in a cold climate zone:
  
  * Infiltration rate (Low)
  * Ventilation rate (Low)
  * Occupant schedule (High)
  * Equipment load (Low)
  * Equipment load (High)
  
  In order to insure that the correct numbers of occupants are present at any given hour, it is necessary to multiply all diversity factors by all occupant loads for each space and sum the total occupant count for the building. Analysis shows that the elementary school model is sensitive to occupant inputs to approximately the same degree in both cold and warm climates (results for all-high and allow inputs vary by approximately +65% / -40% from the all-medium case in both climates). Peak demand is somewhat more sensitive to occupant inputs in cold climates (+25% / -30%) than warm (+/- 20%).
  
  