Buildings.Controls.OBC.CDL.Logical.Validation

Collection of models that validate the logical blocks of the CDL

Information

This package contains models that validate the blocks in Buildings.Controls.OBC.CDL.Logical.

The examples plot various outputs, which have been verified against analytical solutions. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.

Package Content

Name Description
Buildings.Controls.OBC.CDL.Logical.Validation.And And Validation model for the And block
Buildings.Controls.OBC.CDL.Logical.Validation.Change Change Validation model for the Change block.
Buildings.Controls.OBC.CDL.Logical.Validation.Edge Edge Validation model for the Edge block
Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge FallingEdge Validation model for the falling edge block
Buildings.Controls.OBC.CDL.Logical.Validation.Latch Latch Validation model for the Latch block
Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd MultiAnd Model to validate the application of MultiAnd block
Buildings.Controls.OBC.CDL.Logical.Validation.MultiOr MultiOr Model to validate the application of MultiOr block
Buildings.Controls.OBC.CDL.Logical.Validation.Nand Nand Validation model for the Nand block
Buildings.Controls.OBC.CDL.Logical.Validation.Nor Nor Validation model for the Nor block
Buildings.Controls.OBC.CDL.Logical.Validation.Not Not Validation model for the Not block
Buildings.Controls.OBC.CDL.Logical.Validation.Or Or Validation model for the Or block
Buildings.Controls.OBC.CDL.Logical.Validation.Proof Proof Validation model for the Proof block
Buildings.Controls.OBC.CDL.Logical.Validation.Switch Switch Validation model for the Switch block
Buildings.Controls.OBC.CDL.Logical.Validation.Timer Timer Validation model for the Timer block
Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulating TimerAccumulating Validation model for the timer that accumulates the time
Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulatingNegativeStartTime TimerAccumulatingNegativeStartTime Validation model for the timer that accumulates the time, with a negative start time
Buildings.Controls.OBC.CDL.Logical.Validation.TimerNegativeStartTime TimerNegativeStartTime Validation model for the Timer block with a negative start time
Buildings.Controls.OBC.CDL.Logical.Validation.Toggle Toggle Validation model for the Toggle block
Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay TrueDelay Validation model for the TrueDelay block
Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold TrueFalseHold Validation model for the TrueFalseHold block
Buildings.Controls.OBC.CDL.Logical.Validation.TrueHold TrueHold Validation model for the TrueHold block
Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulse VariablePulse Validation model for producing boolean pulse output
Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulseMinHold VariablePulseMinHold Validation model for producing boolean pulse output
Buildings.Controls.OBC.CDL.Logical.Validation.Xor Xor Validation model for the Xor block

Buildings.Controls.OBC.CDL.Logical.Validation.And Buildings.Controls.OBC.CDL.Logical.Validation.And

Validation model for the And block

Buildings.Controls.OBC.CDL.Logical.Validation.And

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.And.

Modelica definition

model And "Validation model for the And block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.And and1 "Logical and"; equation connect(booPul2.y,and1.u2); connect(booPul1.y,and1.u1); end And;

Buildings.Controls.OBC.CDL.Logical.Validation.Change Buildings.Controls.OBC.CDL.Logical.Validation.Change

Validation model for the Change block.

Buildings.Controls.OBC.CDL.Logical.Validation.Change

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Change.

Modelica definition

model Change "Validation model for the Change block." Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( width=0.5, period=1.0) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Change change "Outputs true if the input changes"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Triggered sampler"; equation connect(booPul.y,change.u); connect(ramp2.y,triggeredSampler.u); connect(change.y,triggeredSampler.trigger); end Change;

Buildings.Controls.OBC.CDL.Logical.Validation.Edge Buildings.Controls.OBC.CDL.Logical.Validation.Edge

Validation model for the Edge block

Buildings.Controls.OBC.CDL.Logical.Validation.Edge

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Edge.

Modelica definition

model Edge "Validation model for the Edge block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( width=0.5, period=1.0) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Edge edge1 "Outputs true if the input has a rising edge"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Triggered sampler"; equation connect(booPul.y,edge1.u); connect(edge1.y,triggeredSampler.trigger); connect(ramp2.y,triggeredSampler.u); end Edge;

Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge

Validation model for the falling edge block

Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.FallingEdge.

Modelica definition

model FallingEdge "Validation model for the falling edge block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( width=0.5, period=1.0) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.FallingEdge falEdg "Output true when input changes from true to false"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Trigger sampling of continuous signal"; equation connect(booPul.y,falEdg.u); connect(ramp2.y,triggeredSampler.u); connect(falEdg.y,triggeredSampler.trigger); end FallingEdge;

Buildings.Controls.OBC.CDL.Logical.Validation.Latch Buildings.Controls.OBC.CDL.Logical.Validation.Latch

Validation model for the Latch block

Buildings.Controls.OBC.CDL.Logical.Validation.Latch

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Latch. Following tests are implemented:

Modelica definition

model Latch "Validation model for the Latch block" Buildings.Controls.OBC.CDL.Logical.Latch falCleTruIni "Latch block with clear input being contantly false and true initial latch input"; Buildings.Controls.OBC.CDL.Logical.Latch truCleTruIni "Latch block with clear input being contantly true and true initial latch input"; Buildings.Controls.OBC.CDL.Logical.Latch falCleFalIni "Latch block with clear input being contantly false and false initial latch input"; Buildings.Controls.OBC.CDL.Logical.Latch truCleFalIni "Latch block with clear input being contantly true and false initial latch input"; Buildings.Controls.OBC.CDL.Logical.Latch swiCleInp "Initial false output, with clear input switch between false and true"; Buildings.Controls.OBC.CDL.Logical.Latch swiCleInp1 "Initial false output, with clear input switch between false and true"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse cleInp( final width=0.5, final period=6) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Logcal not"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant fal( final k=false) "False clear input"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp( final width=0.5, final period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant tru( final k=true) "True clear input"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Logical not"; equation connect(cleInp.y,swiCleInp.clr); connect(not1.u,cleInp.y); connect(not1.y,swiCleInp1.clr); connect(fal.y,falCleTruIni.clr); connect(latInp.y,falCleTruIni.u); connect(tru.y,truCleTruIni.clr); connect(latInp.y,truCleTruIni.u); connect(latInp.y,swiCleInp.u); connect(latInp.y,swiCleInp1.u); connect(latInp.y,not2.u); connect(not2.y,falCleFalIni.u); connect(fal.y,falCleFalIni.clr); connect(tru.y,truCleFalIni.clr); connect(not2.y,truCleFalIni.u); end Latch;

Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd

Model to validate the application of MultiAnd block

Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.MultiAnd.

The input signals are configured as follows:

Modelica definition

model MultiAnd "Model to validate the application of MultiAnd block" Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd0 "Logical and with multiple inputs: 0 input"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd1( nin=1) "Logical 'MultiAnd': 1 input connection y=u"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd2( nin=2) "Logical 'MultiAnd': 2 input connections y=and(u1, u2)"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd5( nin=5) "Logical 'MultiAnd': 5 input connections y=and(u1, u2, ..., u5)"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( width=0.5, period=3) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4( width=0.5, period=4) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5( width=0.5, period=5) "Block that outputs cyclic on and off"; equation connect(booPul1.y,mulAnd5.u[1]); connect(booPul2.y,mulAnd5.u[2]); connect(booPul3.y,mulAnd5.u[3]); connect(booPul4.y,mulAnd5.u[4]); connect(booPul5.y,mulAnd5.u[5]); connect(booPul1.y,mulAnd2.u[1]); connect(booPul2.y,mulAnd2.u[2]); connect(booPul1.y,mulAnd1.u[1]); end MultiAnd;

Buildings.Controls.OBC.CDL.Logical.Validation.MultiOr Buildings.Controls.OBC.CDL.Logical.Validation.MultiOr

Model to validate the application of MultiOr block

Buildings.Controls.OBC.CDL.Logical.Validation.MultiOr

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.MultiOr.

The input signals are configured as follows:

Modelica definition

model MultiOr "Model to validate the application of MultiOr block" Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr0 "Logical 'MultiOr': 1 input connection y=u"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr1( nin=1) "Logical 'MultiOr': 1 input connection y=u"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr2( nin=2) "Logical 'MultiOr': 2 input connections y=and(u1, u2)"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr5( nin=5) "Logical 'MultiOr': 5 input connections y=and(u1, u2, ..., u5)"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( width=0.5, period=3) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4( width=0.5, period=4) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5( width=0.5, period=5) "Block that outputs cyclic on and off"; equation connect(booPul1.y,mulOr5.u[1]); connect(booPul2.y,mulOr5.u[2]); connect(booPul3.y,mulOr5.u[3]); connect(booPul4.y,mulOr5.u[4]); connect(booPul5.y,mulOr5.u[5]); connect(booPul1.y,mulOr2.u[1]); connect(booPul2.y,mulOr2.u[2]); connect(booPul1.y,mulOr1.u[1]); end MultiOr;

Buildings.Controls.OBC.CDL.Logical.Validation.Nand Buildings.Controls.OBC.CDL.Logical.Validation.Nand

Validation model for the Nand block

Buildings.Controls.OBC.CDL.Logical.Validation.Nand

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Nand.

Modelica definition

model Nand "Validation model for the Nand block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Nand nand1 "Outputs true if at least one input is false"; equation connect(booPul2.y,nand1.u2); connect(booPul1.y,nand1.u1); end Nand;

Buildings.Controls.OBC.CDL.Logical.Validation.Nor Buildings.Controls.OBC.CDL.Logical.Validation.Nor

Validation model for the Nor block

Buildings.Controls.OBC.CDL.Logical.Validation.Nor

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Nor.

Modelica definition

model Nor "Validation model for the Nor block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Nor nor1 "Outputs true if none of the inputs is true, otherwise outputs false"; equation connect(booPul2.y,nor1.u2); connect(booPul1.y,nor1.u1); end Nor;

Buildings.Controls.OBC.CDL.Logical.Validation.Not Buildings.Controls.OBC.CDL.Logical.Validation.Not

Validation model for the Not block

Buildings.Controls.OBC.CDL.Logical.Validation.Not

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Not.

Modelica definition

model Not "Validation model for the Not block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Output true when input is false and output false when input is true"; equation connect(booPul.y,not1.u); end Not;

Buildings.Controls.OBC.CDL.Logical.Validation.Or Buildings.Controls.OBC.CDL.Logical.Validation.Or

Validation model for the Or block

Buildings.Controls.OBC.CDL.Logical.Validation.Or

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Or.

Modelica definition

model Or "Validation model for the Or block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=3) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Or or1 "Output true if at least one input is true"; equation connect(booPul2.y,or1.u2); connect(booPul1.y,or1.u1); end Or;

Buildings.Controls.OBC.CDL.Logical.Validation.Proof Buildings.Controls.OBC.CDL.Logical.Validation.Proof

Validation model for the Proof block

Buildings.Controls.OBC.CDL.Logical.Validation.Proof

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Proof. The following tests are implemented:

Modelica definition

model Proof "Validation model for the Proof block" Buildings.Controls.OBC.CDL.Logical.Proof pro( debounce=0.5, feedbackDelay=0.75) "Both inputs change at the same time"; Buildings.Controls.OBC.CDL.Logical.Proof pro1( debounce=0.5, feedbackDelay=0.75) "Commanded input changes from true to false earlier than measured input"; Buildings.Controls.OBC.CDL.Logical.Proof pro2( debounce=0.5, feedbackDelay=0.75) "Measured input changes from true to false earlier than commanded input"; Buildings.Controls.OBC.CDL.Logical.Proof pro3( debounce=0.5, feedbackDelay=0.5) "Shorter delay to valid input"; Buildings.Controls.OBC.CDL.Logical.Proof pro4( debounce=0.5, feedbackDelay=0.5) "Shorter delay to valid input"; Buildings.Controls.OBC.CDL.Logical.Proof pro5( debounce=2, feedbackDelay=2) "Both inputs change at the same time"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp( width=0.2, period=10, shift=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp1( width=0.2, period=10, shift=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp2( width=0.1, period=10, shift=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp3( width=0.5, period=2, shift=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp4( width=0.9, period=12, shift=0.5) "Block that outputs cyclic on and off"; equation connect(latInp1.y, pro.u_s); connect(latInp2.y, pro1.u_s); connect(latInp1.y, pro2.u_s); connect(latInp2.y, pro4.u_s); connect(latInp1.y, pro3.u_s); connect(latInp.y, pro.u_m); connect(latInp1.y, pro4.u_m); connect(latInp2.y, pro3.u_m); connect(latInp2.y, pro2.u_m); connect(latInp1.y, pro1.u_m); connect(latInp3.y, pro5.u_m); connect(latInp4.y, pro5.u_s); end Proof;

Buildings.Controls.OBC.CDL.Logical.Validation.Switch Buildings.Controls.OBC.CDL.Logical.Validation.Switch

Validation model for the Switch block

Buildings.Controls.OBC.CDL.Logical.Validation.Switch

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Switch.

The input u2 is the switch input: If u2 = true, then output y = u1; else output y = u3.

Modelica definition

model Switch "Validation model for the Switch block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.7, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=3) "Block that outputs cyclic on and off: switch between u1 and u3"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Switch logicalSwitch "Switch between two boolean inputs"; equation connect(booPul2.y,logicalSwitch.u2); connect(booPul1.y,logicalSwitch.u1); connect(booPul3.y,logicalSwitch.u3); end Switch;

Buildings.Controls.OBC.CDL.Logical.Validation.Timer Buildings.Controls.OBC.CDL.Logical.Validation.Timer

Validation model for the Timer block

Buildings.Controls.OBC.CDL.Logical.Validation.Timer

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Timer.

Modelica definition

model Timer "Validation model for the Timer block" Buildings.Controls.OBC.CDL.Logical.Timer noThr "Timer that do not compare threshold"; Buildings.Controls.OBC.CDL.Logical.Timer thrTim( final t=0.3) "Timer that compares threshold"; Buildings.Controls.OBC.CDL.Logical.Timer thrTim1( final t=0.3) "Timer that compares threshold"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( final width=0.7, final period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( final width=0.7, final period=2, final shift=-1) "Block that outputs cyclic on and off"; equation connect(booPul.y,noThr.u); connect(booPul.y,thrTim.u); connect(booPul1.y,thrTim1.u); end Timer;

Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulating Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulating

Validation model for the timer that accumulates the time

Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulating

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TimerAccumulating.

Modelica definition

model TimerAccumulating "Validation model for the timer that accumulates the time" Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThr "Accumulating timer that do not compare threshold"; Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTim( final t=1) "Accumulating timer that compares threshold"; Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThrWitRes "Accumulating timer that could reset the output"; Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTimWitRes( final t=1) "Accumulating timer that could reset the output and the output compares with threshold"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( final width=0.5, final period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con( final k=false) "Constant false"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse resTim( final width=0.5, final period=3.5) "Block that outputs cyclic on and off, for resetting timer"; equation connect(booPul.y,noThr.u); connect(booPul.y,thrTim.u); connect(con.y,noThr.reset); connect(con.y,thrTim.reset); connect(booPul.y,noThrWitRes.u); connect(booPul.y,thrTimWitRes.u); connect(resTim.y,noThrWitRes.reset); connect(resTim.y,thrTimWitRes.reset); end TimerAccumulating;

Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulatingNegativeStartTime Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulatingNegativeStartTime

Validation model for the timer that accumulates the time, with a negative start time

Buildings.Controls.OBC.CDL.Logical.Validation.TimerAccumulatingNegativeStartTime

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TimerAccumulating.

Modelica definition

model TimerAccumulatingNegativeStartTime "Validation model for the timer that accumulates the time, with a negative start time" Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThr "Accumulating timer that do not compare threshold"; Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTim( final t=1) "Accumulating timer that compares threshold"; Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThrWitRes "Accumulating timer that could reset the output"; Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTimWitRes( final t=1) "Accumulating timer that could reset the output and the output compares with threshold"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( final width=0.5, final period=4, shift=-11) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con( final k=false) "Constant false"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse resTim( final width=0.5, final period=3.5, shift=-5) "Block that outputs cyclic on and off, for resetting timer"; equation connect(booPul.y,noThr.u); connect(booPul.y,thrTim.u); connect(con.y,noThr.reset); connect(con.y,thrTim.reset); connect(booPul.y,noThrWitRes.u); connect(booPul.y,thrTimWitRes.u); connect(resTim.y,noThrWitRes.reset); connect(resTim.y,thrTimWitRes.reset); end TimerAccumulatingNegativeStartTime;

Buildings.Controls.OBC.CDL.Logical.Validation.TimerNegativeStartTime Buildings.Controls.OBC.CDL.Logical.Validation.TimerNegativeStartTime

Validation model for the Timer block with a negative start time

Buildings.Controls.OBC.CDL.Logical.Validation.TimerNegativeStartTime

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Timer.

Modelica definition

model TimerNegativeStartTime "Validation model for the Timer block with a negative start time" Buildings.Controls.OBC.CDL.Logical.Timer noThr "Timer that do not compare threshold"; Buildings.Controls.OBC.CDL.Logical.Timer thrTim( final t=0.3) "Timer that compares threshold"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( final width=0.7, final period=2, shift=-5) "Block that outputs cyclic on and off"; equation connect(booPul.y,noThr.u); connect(booPul.y,thrTim.u); end TimerNegativeStartTime;

Buildings.Controls.OBC.CDL.Logical.Validation.Toggle Buildings.Controls.OBC.CDL.Logical.Validation.Toggle

Validation model for the Toggle block

Buildings.Controls.OBC.CDL.Logical.Validation.Toggle

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Toggle. Following tests are implemented:

Modelica definition

model Toggle "Validation model for the Toggle block" Buildings.Controls.OBC.CDL.Logical.Toggle falCleTruIni "Toggle block with clear input being contantly false and true initial toggle input"; Buildings.Controls.OBC.CDL.Logical.Toggle falCleFalIni "Toggle block with clear input being contantly false and false initial toggle input"; Buildings.Controls.OBC.CDL.Logical.Toggle truCleTruIni "Toggle block with clear input being contantly true and true initial toggle input"; Buildings.Controls.OBC.CDL.Logical.Toggle truCleFalIni "Toggle block with clear input being contantly true and false initial toggle input"; Buildings.Controls.OBC.CDL.Logical.Toggle swiCleInp "Initial false output, with clear input switch between false and true"; Buildings.Controls.OBC.CDL.Logical.Toggle swiCleInp1 "Initial false output, with clear input switch between false and true"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse cleInp( final width=0.5, final period=6) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Logical not"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse togInp( final width=0.5, final period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant tru( final k=true) "True clear input"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Logical not"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant fal( final k=false) "False clear input"; equation connect(cleInp.y,swiCleInp.clr); connect(not1.u,cleInp.y); connect(not1.y,swiCleInp1.clr); connect(togInp.y,swiCleInp.u); connect(togInp.y,swiCleInp1.u); connect(togInp.y,falCleTruIni.u); connect(fal.y,falCleTruIni.clr); connect(togInp.y,truCleTruIni.u); connect(fal.y,falCleFalIni.clr); connect(togInp.y,not2.u); connect(not2.y,falCleFalIni.u); connect(tru.y,truCleTruIni.clr); connect(tru.y,truCleFalIni.clr); connect(not2.y,truCleFalIni.u); end Toggle;

Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay

Validation model for the TrueDelay block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TrueDelay.

Modelica definition

model TrueDelay "Validation model for the TrueDelay block" Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay0( final delayTime=0) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay1( final delayTime=0.5) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay2( final delayTime=0.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay4( final delayTime=0) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay5( final delayTime=0.5) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay6( final delayTime=0.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.Not not1 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay3( final delayTime=1.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay7( final delayTime=1.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay00( final delayTime=0, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay11( final delayTime=0.5, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay22( final delayTime=0.8, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay44( final delayTime=0, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay55( final delayTime=0.5, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay66( final delayTime=0.8, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.Not not2 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay33( final delayTime=1.8, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay77( final delayTime=1.8, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; protected Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( final width=0.5, final period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( final width=0.5, final period=1.5) "Block that outputs cyclic on and off"; equation connect(booPul.y,not1.u); connect(booPul.y,onDelay0.u); connect(booPul.y,onDelay2.u); connect(booPul.y,onDelay1.u); connect(booPul.y,onDelay3.u); connect(not1.y,onDelay4.u); connect(not1.y,onDelay6.u); connect(not1.y,onDelay5.u); connect(not1.y,onDelay7.u); connect(booPul1.y,not2.u); connect(booPul1.y,onDelay00.u); connect(booPul1.y,onDelay22.u); connect(booPul1.y,onDelay11.u); connect(booPul1.y,onDelay33.u); connect(not2.y,onDelay44.u); connect(not2.y,onDelay66.u); connect(not2.y,onDelay55.u); connect(not2.y,onDelay77.u); end TrueDelay;

Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold

Validation model for the TrueFalseHold block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TrueFalseHold.

The validation uses different instances to validate different hold trueHoldDurations, different lengths of the input pulse, and different initial values for the input signal.

Modelica definition

model TrueFalseHold "Validation model for the TrueFalseHold block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( shift=0, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( shift=0, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol1( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( shift=0, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol2( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( shift=0, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol3( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Not not3 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4( shift=100, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol4( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5( shift=100, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol5( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul6( shift=100, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol6( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul7( shift=100, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol7( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Not not4 "Negation of input signal"; equation connect(booPul.y,truFalHol.u); connect(booPul1.y,truFalHol1.u); connect(booPul2.y,not1.u); connect(not1.y,truFalHol2.u); connect(booPul3.y,not3.u); connect(not3.y,truFalHol3.u); connect(booPul4.y,truFalHol4.u); connect(booPul5.y,truFalHol5.u); connect(booPul6.y,not2.u); connect(not2.y,truFalHol6.u); connect(booPul7.y,not4.u); connect(not4.y,truFalHol7.u); end TrueFalseHold;

Buildings.Controls.OBC.CDL.Logical.Validation.TrueHold Buildings.Controls.OBC.CDL.Logical.Validation.TrueHold

Validation model for the TrueHold block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueHold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TrueHold.

The validation uses different instances to validate different hold durations, different lengths of the input pulse, and different initial values for the input signal.

Modelica definition

model TrueHold "Validation model for the TrueHold block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( period=9000, shift=300) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHold truHol( duration=3600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( period=3600) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHold truHol1( duration=600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( period=9000, shift=300) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHold truHol2( duration=3600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( period=3600) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHold truHol3( duration=600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Not not3 "Negation of input signal"; equation connect(booPul.y,truHol.u); connect(booPul1.y,truHol1.u); connect(booPul2.y,not2.u); connect(not2.y,truHol2.u); connect(booPul3.y,not3.u); connect(not3.y,truHol3.u); end TrueHold;

Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulse Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulse

Validation model for producing boolean pulse output

Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulse

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.VariablePulse.

Modelica definition

model VariablePulse "Validation model for producing boolean pulse output" Buildings.Controls.OBC.CDL.Logical.VariablePulse conTru( period=900) "Variable pulse with constant pulse width"; Buildings.Controls.OBC.CDL.Logical.VariablePulse fal( period=900) "Variable pulse with the zero width input"; Buildings.Controls.OBC.CDL.Logical.VariablePulse truFal( period=900) "Variable pulse with width input changing from positive value to zero"; Buildings.Controls.OBC.CDL.Logical.VariablePulse falTru( period=900) "Variable pulse with width input changing from zero to positive value"; Buildings.Controls.OBC.CDL.Logical.VariablePulse tru( period=900) "Variable pulse with the constant width input"; Buildings.Controls.OBC.CDL.Logical.VariablePulse falTru1( period=900) "Variable pulse with width input changing between different positive values"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul( amplitude=0.65, width=0.8, period=4000) "Continuous pulse signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con( k=0.75) "Constant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con1( k=0) "Constant value"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul1( amplitude=0.65, width=0.85, period=3600, shift=360) "Continuous pulse signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con2( k=1) "Constant value"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul2( amplitude=0.5, width=0.5, period=3600, shift=360, offset=0.3) "Continuous pulse signal"; Buildings.Controls.OBC.CDL.Logical.VariablePulse conChaWid( period=900) "Variable pulse with constantly changing pulse width "; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ram( height=0.8, duration=900, startTime=300) "Ramp input"; equation connect(con.y, conTru.u); connect(con1.y, fal.u); connect(conPul.y, truFal.u); connect(conPul1.y, falTru.u); connect(con2.y, tru.u); connect(conPul2.y, falTru1.u); connect(ram.y, conChaWid.u); end VariablePulse;

Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulseMinHold Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulseMinHold

Validation model for producing boolean pulse output

Buildings.Controls.OBC.CDL.Logical.Validation.VariablePulseMinHold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.VariablePulse.

It tests the case that the input value changes at the moment when the output is still in previous status in less than the minimum holding time. In the case, the output holds the previous status for the minimum holding time and then change to the new status.

Modelica definition

model VariablePulseMinHold "Validation model for producing boolean pulse output" Buildings.Controls.OBC.CDL.Logical.VariablePulse conChaWid( period=3, minTruFalHol=1) "Variable pulse with constantly changing pulse width "; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul1( amplitude=0.4, width=0.4, period=4, shift=1.6, offset=0.5) "Continuous pulse signal"; equation connect(conPul1.y, conChaWid.u); end VariablePulseMinHold;

Buildings.Controls.OBC.CDL.Logical.Validation.Xor Buildings.Controls.OBC.CDL.Logical.Validation.Xor

Validation model for the Xor block

Buildings.Controls.OBC.CDL.Logical.Validation.Xor

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Xor.

Modelica definition

model Xor "Validation model for the Xor block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Xor xor1 "Outputs true if exactly one input is true"; equation connect(booPul2.y,xor1.u2); connect(booPul1.y,xor1.u1); end Xor;