Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

Here is the solution:

EnergyManagementSystem:Program,
Window_Jones_2017,       !- Name
if Window1_S1_act == Null,
set Wind_Cur_State = 0,
else,
set Wind_Cur_State = Window1_S1_act,
ENDIF,
if Wind_Cur_State == 0.0,  !- Program Line 2
  if OCC_KXS1>0,           !- A4
    set handle=A1+B1*Tin_KXS1+B2*RHin_KXS1-B3*Tout-B4*RHout+B5*WS+B6*Rain,  !- A5
    set handle=@Exp handle,  !- A6
    set handle=handle/(handle+1),  !- A7
    set R=@RandomUniform 0 1,!- A8
    if handle>R,             !- A9
      set Window1_S1_act=1,  !- A10
    endif,                   !- A11
  else,                    !- A12
    set Window1_S1_act=0,  !- A13
  endif,                   !- A14
endif,                   !- A15
if Wind_Cur_State == 1,  !- A16
  if OCC_KXS1>0,           !- A17
    set handle=A2+B7*Tin_KXS1+B8*RHin_KXS1+B9*Tout+B10*WS+B11*Rain,  !- A18
    set handle=@Exp handle,  !- A19
    set handle=handle/(handle+1),  !- A20
    set R=@RandomUniform 0 1,!- A21
    if handle>R,             !- A22
      set Window1_S1_act=0,  !- A23
    endif,                   !- A24
  else,                    !- A25
    set Window1_S1_act=0,  !- A26
  endif,                   !- A27
endif;                   !- A28