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 equipmentjshall not be enabled at stagei. - A coefficient
staEqu[i, j]equal to 1 means that equipmentjis required at stagei. If equipmentjis unavailable, stageiis deemed unavailable. - A coefficient
staEqu[i, j]strictly lower than 1 and strictly greater than 0 means that equipmentjmay be enabled at stageias a lead/lag alternate equipment. If equipmentjis unavailable but another lead/lag alternate equipment is available, then the latter equipment is enabled. Stageiis only deemed unavailable if all lead/lag alternate equipment specified for stageiare unavailable. -
The sum of the coefficients in a given row
∑_j staEqu[i, j]gives the number of units required at stagei. If this number cannot be achieved with the available equipment, stageiis deemed unavailable. -
The condition
∑_j staEqu[i+1, j] ≥ ∑_j staEqu[i, j]is required for alli < size(staEqu, 1).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,:] | staEqu | Staging matrix – Equipment required for each stage | |
| Integer | nEquAlt | if 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 |
| Integer | nSta | size(staEqu, 1) | Number of stages |
| Integer | nEqu | size(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
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Interfaces.IntegerInput[nEquAlt] | uIdxAltSor | Indices of lead/lag alternate equipment sorted by increasing runtime | |
| Buildings.Controls.OBC.CDL.Interfaces.IntegerInput | uSta | Stage index | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nEqu] | u1Ava | Equipment available signal | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput[nEqu] | y1 | Equipment enable command |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant[nEqu,nSta] | traMatStaEqu | Transpose of staging matrix | |
| Buildings.Controls.OBC.CDL.Routing.RealExtractor[nEqu] | reqEquSta | Extract equipment required at given stage | |
| Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicator | intScaRep | Replicate signal | |
| Buildings.Controls.OBC.CDL.Logical.Or[nEqu] | ena | Enable equipment required without lead/lag alternate and available or lead/lag alternate equipment to meet stage requirement | |
| Buildings.Controls.OBC.CDL.Logical.And[nEqu] | isReqAltAvaNee | Return true if equipment indexed as lead/lag alternate and available and needed to meet stage requirement | |
| Buildings.Controls.OBC.CDL.Integers.Sources.Constant | one | Constant | |
| Buildings.Controls.OBC.CDL.Integers.Max | maxInt | Maximum between stage index and 1 | |
| Buildings.Controls.OBC.CDL.Integers.GreaterThreshold | greZer | Check if stage index is greater than zero | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | booToRea | Cast to real | |
| Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator | reaScaRep | Replicate signal | |
| Buildings.Controls.OBC.CDL.Reals.Multiply[nEqu] | voiStaZer | Void if stage is equal to zero | |
| BaseClasses.SelectSortedAvailable | selSorAva | Select lead/lag alternate units by priority order and availability | |
| BaseClasses.SelectEquipmentAtStage | selEquSta | Select available units at stage |
Revisions
-
June 10, 2026, by Antoine Gautier:
Added logic to remove unavailable equipment from staging order. Removed restriction on enable state updates. Modularized the implementation.
This is for #4624. -
March 29, 2024, by Antoine Gautier:
First implementation.