blockStageAvailability

Compute stage availability

Information

A stage is deemed available if all of the following are true:

  • Each unit required to run at that stage without lead/lag alternate is available.
  • The number of units required to run at that stage – with or without lead/lag alternate – that are available is greater than or equal to the number of units required to run at that stage.
  • The number of units required to run at that stage – with or without lead/lag alternate – is nonzero. This condition is used by Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.StagingParameters to encode that a stage is not feasible.

Otherwise, the stage is deemed unavailable.

Parameters

TypeNameDefaultDescription
Booleanhave_phpfalseSet to true for plants with polyvalent heat pumps
Real[:,:]staEquStaging matrix – Equipment required for each stage
IntegernStaif have_php then integer((1 + sqrt(1 + 4*size(staEqu, 1)))/2) - 1 else size(staEqu, 1)Number of stages
IntegernEqusize(staEqu, 2)Number of equipment

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nEqu]u1AvaEquipment available signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput[nSta]y1Stage available signal
Buildings.Controls.OBC.CDL.Interfaces.IntegerInputuStaOppStage index of opposite mode

Components

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[nSta,nEqu]matStaEquStaging matrix
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicatorbooVecRepReplicate equipment available signal
Buildings.Controls.OBC.CDL.Logical.MultiAnd[nSta]isAvaReturn true if stage available
Buildings.Controls.OBC.CDL.Integers.GreaterEqual[nSta]isReqAltAvaGreReqReturn true if number of required available equipment higher than number of required equipment
Utilities.CountTrue[nSta]nReqOrAltAvaNumber of units required (with or without lead/lag alternate) and available
BaseClasses.SelectEquipmentAtStage[nSta]selEquStaSelect equipment at stage
PolyvalentHeatPumps.ExtractStagingMatrixextStaExtract staging matrix for the opposite mode stage index
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold[nSta]notZerTrue if the number of units required (with or without lead/lag alternate) is nonzero
Utilities.CountTrue[nSta]nReqAndAvaNumber of units required (without lead/lag alternate) and available
Buildings.Controls.OBC.CDL.Integers.Equal[nSta]allReqAvaTrue if all units required (without lead/lag alternate) are available

Revisions

  • July 10, 2026, by Antoine Gautier:
    Refactored to support plants with polyvalent heat pumps.
    This is for #4512.
  • March 29, 2024, by Antoine Gautier:
    First implementation.