Lixi Liu
- Course ID: CMPLXSYS 530,
- Course Title: Computer Modeling of Complex Systems
- Term: Winter, 2018
LS COMMENTS: This looks like a very good setup overall. Just a few comments and questions included below. Your pseudocode looks pretty close to operable Python code currently, so the main thing right now will be to get everything translated into a model so you can see if you can get something running and start working the bugs out. Good job :)
With increasing energy efficiency and smart features that can adapt to occupants' preferences and communicate with other appliances, smart lighting can improve the quality of modern life while reducing energy consumption and cost. This study explores how smart lighting sensors interact with Heating Ventilation and Air Conditioning (HVAC) control to maximize occupancy comfort and building energy savings.
Agent-based modeling is useful for exploring the nexus between smart/connected lighting, other smart sensors, and occupants’ preference/comfort in that it provides model customizability and can reveal how well smart sensors manipulate room conditions to meet occupants' comfort level according to their control. Understanding these governing interactions between occupants, sensors, and the built environment can maximize the value of smart sensor implementation in buildings to reduce energy use and cost while enhancing ergonomic comfort.
This study explores how the interactions 1) among smart sensors and 2) between occupants and sensors affect the system-level energy consumption from lighting and HVAC. The primary focus is on how the daylight controller decides the lighting load reduction potential from daylight harvesting against the added cooling needs from the daylight harvest.
The environment consists of a single office room serving a speficic function (e.g. room with individual work spaces/cubicles, conference room, pantry, restroom). Its layout (e.g. size, window and door locations) will be defined in the setup.
-
Boundary conditions: fixed (enclosed by walls)
-
Dimensionality: 2D
-
List of environment-owned variables:
- current harvested lux [lux = lumen/sq m] (amount of daylight entering the room through controllable window blinds)
- current lamp lux (from overhead lamps)
- current total lux (total in-door brightness from overhead lamps and harvested daylight)
- current room temperature [deg F]
- previous harvested lux
- previous lamp lux
- previous total lux
- previous room temperature [def F]
- Light energy [kWh]
- HVAC energy [kWh]
-
List of environment-owned methods/procedures:
- update lux (embedded within agent-specific procedures)
- update room temp (based on previous indoor states, outdoor conditions, and sensor inputs)
- calculate energy (after update to indoor states)
### Pseudocode ###
def initialize_room():
gridlen = 15 # x[m] includes some space outside of office
gridwid = 10 # y[m] includes some space outside of office
RoomX = range(1,13) # x = 12[m] office length
RoomY = range(1,9) # y = 8[m] office width
#set walls for office
#set windows
#set door
for x in roomX:
for y in roomY:
Cur_harv_lux = 0 # blinds closed, no harvest
Cur_lamp_lux = 0 #
Cur_total_lux = Cur_harv_lux + Cur_lamp_lux
Cur_room_temp = 70 # [deg F]
Pre_harv_lux = Cur_harv_lux
Pre_lamp_lux = Cur_harv_lux
Pre_total_lux = Cur_harv_lux
Pre_room_temp = Cur_room_temp
Light_energy = [0]
HVAC_energy = [0]
def Update_room_temp():
Cur_room_temp = f(Pre_room_temp,Outdoor_temp,insulation,Sensors['HVAC'][2],AC_load]
def calc_energy():
Light_energy.append = f(lamp_efficacy,lamp_distribution,Cur_lamp_lux)
HVAC_energy.append = AC_load*Sensors['HVAC'][2]
### LS COMMENTS ###
# How you specify these functions is going to be very important to how your model ends up behaving. Do you have any ideas so far on
# what you think they will look like? Is there anything in the literature that could potentially guide you here?
There are two main types of agents. The first type is occupants in the building, each with a specific schedule, preferences, and comfort level.
- List of occupant-owned variables:
- ID
- schedule (e.g. when to enter and leave room)
- brightness preference
- thermal preference
- discomfort level (preference satisfaction, equally weighted between brightness and temperature)
- current position
- previous position
- List of occupant-owned methods/procedures:
- enter room
- exit room
- move (with some probability of being still, e.g. sitting at a meeting, working at a desk)
- check discomfort
The second type of agents is sensors, which include: motion sensors, daylight controllers, dimmers and HVAC controller.
- Motion sensors turn lights on based on occupants' movement and keep them on for some time after the last detected movement. Motion sensors are best for high-motion, low traffic rooms such as restrooms or pantry.
- List of motion sensor-owned variables:
- motion detected (binary)
- timer (number of time steps since the last detected motion)
- List of motion sensor-owned methods/procedures:
- check motion
- turn lights on
- turn lights off
- Daylight controllers control how much sunlight enters the room by adjusting the window blinds.
- List of daylight sensor-owned variables:
- None
- List of daylight sensor-owned methods/procedures:
- adjust blinds (% daylight harvested)
-
Dimmers instaneously adjust the indoor light level based on the daylight sensor input and the desired indoor lumen level. The dimming is embedded within the motion sensor-owned procedures.
-
HVAC controller controls the room temperature based on the daylight sensor input and the desired indoor temperature. In the cooling mode, when the room temperature rises above a thermostat threshold, the ventilation or AC system would kick in to cool the room until the temperature falls below another thermostat threshold, after which point, the room could heat up again with time and the cycle perpectuates until either the thermostat is turned off or the room temperature ceases to fluctuate beyond the thermostat threholds.
- List of HVAC controller-owned variables:
- AC on (binary)
- List of HVAC controller-owned methods/procedures:
- check temp
### Psudocode ###
from random import randint
# Define Agent Variables
def Initialize_agents():
Population = 4
Occupants = {}
Schedule = {}
Cur_position = {}
Discomfort = {}
For i in range(Population):
Occupants[i] = [randint(500,1200),randint(60,78)] # [brightness pref(lux), thermal pref(deg F)]
Schedule[i] = [randint(0,10), randint(300,1200)] # [enter time, time to begin leaving room]
Cur_Position[i] = [0,5,90] # [x,y,orientation] (e.g. at entrance of door)
Discomfort[i] = 0
Pre_position = Cur_position
Sensors = {
'MoS':[0,0] #[Motion-detected,Timer]
'DLC':[...]
'Dim':[...]
'HVAC':[1,8, 0] #[loc-x, loc-y, AC-on]
}
# Define Agent Procedures
def Movement(Schedule):
Pre_position = Cur_position
for i in Schedule:
if time == Schedule[i][0]: # Enter_room
Cur_position[i][0] += 1
elif time > Schedule[i][1]: # Exist_room
# begin head out room
else: # Random_Walk within fixed boundary
if Cur_position[i][0] == RoomX[0] or Cur_position[i][0] == RoomX[len(RoomX)-1]...
Cur_position[i][1] == RoomY[0] or Cur_position[i][1] == RoomX[len(RoomY)-1]:
# turn around 180 and walk
elif :
if randint(0,1) > 0:
# random_walk
def Check_discomfort(Occupants,Cur_position, Total_lux,Room_temp):
for i in Occupants:
for x in RoomX:
for y in RoomY:
if Cur_position[i][0] == x and Cur_position[i][1] == y:
Discomfort[i].append = 0.5*abs(Total_lux-Occupants[i][0])/Occupants[i][0]...
+0.5*(Room_temp-Occupants[i][1])/Occupants[i][1]
def Check_motion(Pre_position,Sensors):
for i in Cur_Position:
if Cur_position Cur_position[0]-Prev_position[0] > 0 or Cur_position[1]-Prev_position[1] > 0:
Motion_detected = 1
if Motion_detected > 0 and Timer < 600:
Timer += 1
Adjust_blinds
Turn_lights_on
else:
Turn_lights_off
def Adjust_blinds(RoomX,RoomY,Pre_total_lux,Desired_lux,Outdoor_lux):
for x in RoomX:
for y in RoomY:
Cur_harv_lux = min(max(Desired_lux - Pre_total_lux,0),Outdoor_lux)
def Turn_lights_on(RoomX,RoomY,Cur_harv_lux,Desired_lux,Max_lamp_lux): # includes dimming
for x in RoomX:
for y in RoomY:
Cur_lamp_lux = min(max(Desired_lux - Cur_harv_lux,0),Max_lamp_lux)
Cur_total_lux = Cur_harv_lux + Cur_lamp_lux
def Turn_lights_off(RoomX,RoomY,Cur_harv_lux):
for x in RoomX:
for y in RoomY:
Cur_lamp_lux = 0
Cur_total_lux = Cur_harv_lux + Cur_lamp_lux
def Check_temp(Sensors,Pre_room_temp):
Therm_x = Sensors['HVAC'][0]
Therm_y = Sensors['HVAC'][1]
if Pre_room_temp(Therm_x,Therm_y) > Desired_temp:
AC-on = 1
LS COMMENTS: Currently I am not sure how you are dealing with different individuals' preferences for light and heat in the same room? How are these different preferences being combined to produce your "Desired_lux" and "Desired_temp" variables? One option would be to average everything. Another would be to create several different rooms and allow different individual agents to wander through them at different time. In that case, you'd probably want to create a Room "Class" and create several. In any case, this is also something to think about as it will be driving a lot of your model as well.
I was also wondering how fine a degree of control you are anticipating having over the light and temperature in each part of the room? I would assume that you could only really have control of the overall room temp and light levels. You might could think of it in terms of diffusion (as you mention a bit below with convection), but this will definitely make your model more complicated.
Interaction Topology
The interactions within the systems are predominantly sensor-sensor and sensor-environment, although one occupant-sensor interaction exists. The sensor-sensor communications are network-linked and instantaneous. Updating the state of each patch requires information from the sensors. For the temperature state, it may also require information from neighborhood patches to model convection. The interaction between the occupants and the motion sensor is spatial and temporal (currently, it is assumed that the motion sensing range is of the entire room).
Action Sequence
What does an agent, cell, etc. do on a given turn? Provide a step-by-step description of what happens on a given turn for each part of your model
- Occupants move/stay put according to rules and their schedule.
- Motion sensor checks for motion and enables other sensors if motion is detected.
- Daylight controller adjusts blinds.
- Dimmer adjusts light output from lamp.
- HVAC controller checks for room temperature and decides whether to turn on AC.
- Environment calculates light and HVAC energy use.
- Environment updates indoor luminous level and room temperature.
Global parameters include:
- time (time step) - [sec]
- outdoor lux - hourly solar insolation relative to time (based on external sources).
- outdoor temp - [deg F] hourly temperature relative to time (will be used to determine HVAC load)
- desired lux - desired indoor luminous level = average of all occupants' brightness preferences.
- desired temp - [deg F] desired indoor temperature = average of all occupants' thermal preferences.
Agent-specific parameters include:
- max lamp lux - [lux] maximum lumen output of overhead lamps.
- lamp_efficacy - [lm/W] amount of lumen output per W of power consumed.
- thermostat location (shown in Sensors dictionary)
- AC load
- building insulation
To initialize model, set time = 0 and run initialize_room and initialize_agents from code.
The step function of the model will consist of advancing the time step by 1 and the action sequence described in Section 3.
The quantitative metrics of interest in the model are:
- Total energy use for light and HVAC
- Occupants' comfort level
The parameters intended to be swept through are as follows along with their respective value ranges:
- occupants' random brightness preference [lux]: [500,1000], which affects the desired lux
- occupants' random temperature preference [deg F]: [65,75], which affects the desired temp
Besides parameter sweep, different control strategies (e.g. how the sensors update and how their updates are sequenced) may be explored to better understand the interactions between sensors.