blockEquipmentEnable

Return array of equipment to be enabled at given stage

Information

This block generates the equipment enable commands based on the active stage index uSta, the equipment available signal u1Ava and the indices of lead/lag alternate equipment, sorted by increasing staging runtime.

A staging matrix staEqu is required as a parameter.

  • Each row of this matrix corresponds to a given stage.
  • Each column of this matrix corresponds to a given equipment.
  • A coefficient staEqu[i, j] equal to 0 means that equipment j shall not be enabled at stage i.
  • A coefficient staEqu[i, j] equal to 1 means that equipment j is required at stage i. If equipment j is unavailable, stage i is deemed unavailable.
  • A coefficient staEqu[i, j] strictly lower than 1 and strictly greater than 0 means that equipment j may be enabled at stage i as a lead/lag alternate equipment. If equipment j is unavailable but another lead/lag alternate equipment is available, then the latter equipment is enabled. Stage i is only deemed unavailable if all lead/lag alternate equipment specified for stage i are unavailable.
  • The sum of the coefficients in a given row ∑_j staEqu[i, j] gives the number of equipment required at stage i. If this number cannot be achieved with the available equipment, stage i is deemed unavailable.
  • The condition ∑_j staEqu[i+1, j] ≥ ∑_j staEqu[i, j] is required for all i < size(staEqu, 1).

The state of the enable signals is only updated at stage change, or if the number of previously enabled equipment that is available is strictly less than the number of equipment required to run. This avoids hot swapping equipment, e.g., an equipment would not be started and another stopped during operation just to fulfill the priority order. However, when a lead/lag alternate equipment becomes unavailable and another lead/lag alternate equipment can be enabled to meet the number of required equipment, then the state of the enable signals is updated.

Parameters

TypeNameDefaultDescription
Real[:,:]staEquStaging matrix – Equipment required for each stage
IntegernEquAltif nEqu == 1 then 1 else max({sum({(if staEqu[i, j] > 0 and staEqu[i, j] < 1 then 1 else 0) for j in 1:nEqu}) for i in 1:nSta})Number of lead/lag alternate equipment
IntegernStasize(staEqu, 1)Number of stages
IntegernEqusize(staEqu, 2)Number of equipment
Real[nEqu,nSta]traStaEqu{{staEqu[i, j] for i in 1:nSta} for j in 1:nEqu}Transpose of staging matrix

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput[nEquAlt]uIdxAltSorIndices of lead/lag alternate equipment sorted by increasing runtime
Buildings.Controls.OBC.CDL.Interfaces.IntegerInputuStaStage index
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nEqu]u1AvaEquipment available signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput[nEqu]y1Equipment enable command

Components

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[nEqu,nSta]traMatStaEquTranspose of staging matrix
Buildings.Controls.OBC.CDL.Routing.RealExtractor[nEqu]reqEquStaExtract equipment required at given stage
Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicatorintScaRepReplicate signal
Buildings.Controls.OBC.CDL.Reals.MultiSumnEquStaReaReturn the number of equipment required
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold[nEqu]isReqReturn true if equipment required without lead/lag alternate
Buildings.Controls.OBC.CDL.Logical.And[nEqu]isReqAvaReturn true if equipment required without lead/lag alternate and available
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold[nEqu]isReqPosAltReturn true if equipment required (with or without lead/lag alternate)
Buildings.Controls.OBC.CDL.Reals.LessThreshold[nEqu]isNotReqNoAltReturn true if equipment not required or required with lead/lag alternate
Buildings.Controls.OBC.CDL.Logical.MultiAnd[nEqu]isReqAltAvaReturn true if lead/lag alternate equipment required and available
Buildings.Controls.OBC.CDL.Logical.Or[nEqu]enaEnable equipment required without lead/lag alternate and available or lead/lag alternate equipment to meet stage requirement
Buildings.Controls.OBC.CDL.Conversions.RealToIntegernEquStaNumber of equipment required
Buildings.Controls.OBC.CDL.Integers.SubtractnAltReqNumber of lead/lag alternate equipment to run to meet stage requirement
Buildings.Controls.OBC.CDL.Logical.And[nEqu]isReqAltAvaNeeReturn true if equipment required with lead/lag alternate and available and needed to meet stage requirement
Buildings.Controls.OBC.CDL.Integers.ChangechaDetect stage index change
Buildings.Controls.OBC.CDL.Logical.Pre[nEqu]y1PreLeft limit of signal in discrete time
Buildings.Controls.OBC.CDL.Logical.Switch[nEqu]logSwiSwitch to newly computed value at stage change
Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicatorbooScaRepReplicate signal
Utilities.CountTruenReqCount the number of required equipment without lead/lag alternate, not necessarily available
Utilities.CountTruenEnaAvaPreCount the number of previously enabled equipment that are available
Buildings.Controls.OBC.CDL.Integers.LessintLesCompare to required number of equipment
Buildings.Controls.OBC.CDL.Logical.OrswiEnaEvaluate condition to switch to newly computed enable signal
Buildings.Controls.OBC.CDL.Logical.And[nEqu]isEnaPreAvaReturn true if equipment previously enabled and available
Utilities.TrueArrayConditionaltruArrConGenerate array of size nEqu with nAltReq true elements at uIdxAltSor indices
Buildings.Controls.OBC.CDL.Integers.Sources.ConstantoneConstant
Buildings.Controls.OBC.CDL.Integers.MaxmaxIntMaximum between stage index and 1
Buildings.Controls.OBC.CDL.Integers.GreaterThresholdgreZerCheck if stage index is greater than zero
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaCast to real
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicatorreaScaRepReplicate signal
Buildings.Controls.OBC.CDL.Reals.Multiply[nEqu]voiStaZerVoid if stage is equal to zero

Revisions

  • March 29, 2024, by Antoine Gautier:
    First implementation.