blockEquipmentEnable
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 equipment 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).
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
| 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.Reals.MultiSum | nEquStaRea | Return the number of equipment required | |
| Buildings.Controls.OBC.CDL.Reals.GreaterThreshold[nEqu] | isReq | Return true if equipment required without lead/lag alternate | |
| Buildings.Controls.OBC.CDL.Logical.And[nEqu] | isReqAva | Return true if equipment required without lead/lag alternate and available | |
| Buildings.Controls.OBC.CDL.Reals.GreaterThreshold[nEqu] | isReqPosAlt | Return true if equipment required (with or without lead/lag alternate) | |
| Buildings.Controls.OBC.CDL.Reals.LessThreshold[nEqu] | isNotReqNoAlt | Return true if equipment not required or required with lead/lag alternate | |
| Buildings.Controls.OBC.CDL.Logical.MultiAnd[nEqu] | isReqAltAva | Return true if lead/lag alternate equipment required and available | |
| 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.Conversions.RealToInteger | nEquSta | Number of equipment required | |
| Buildings.Controls.OBC.CDL.Integers.Subtract | nAltReq | Number of lead/lag alternate equipment to run to meet stage requirement | |
| Buildings.Controls.OBC.CDL.Logical.And[nEqu] | isReqAltAvaNee | Return true if equipment required with lead/lag alternate and available and needed to meet stage requirement | |
| Buildings.Controls.OBC.CDL.Integers.Change | cha | Detect stage index change | |
| Buildings.Controls.OBC.CDL.Logical.Pre[nEqu] | y1Pre | Left limit of signal in discrete time | |
| Buildings.Controls.OBC.CDL.Logical.Switch[nEqu] | logSwi | Switch to newly computed value at stage change | |
| Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator | booScaRep | Replicate signal | |
| Utilities.CountTrue | nReq | Count the number of required equipment without lead/lag alternate, not necessarily available | |
| Utilities.CountTrue | nEnaAvaPre | Count the number of previously enabled equipment that are available | |
| Buildings.Controls.OBC.CDL.Integers.Less | intLes | Compare to required number of equipment | |
| Buildings.Controls.OBC.CDL.Logical.Or | swiEna | Evaluate condition to switch to newly computed enable signal | |
| Buildings.Controls.OBC.CDL.Logical.And[nEqu] | isEnaPreAva | Return true if equipment previously enabled and available | |
| Utilities.TrueArrayConditional | truArrCon | Generate array of size nEqu with nAltReq true elements at uIdxAltSor indices | |
| 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 |
Revisions
-
March 29, 2024, by Antoine Gautier:
First implementation.