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.And3 And3 Validation model for the And3 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.OnOffController OnOffController Validation model for the OnOffController block
Buildings.Controls.OBC.CDL.Logical.Validation.Or Or Validation model for the Or block
Buildings.Controls.OBC.CDL.Logical.Validation.Or3 Or3 Validation model for the Or3 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.TriggeredTrapezoid TriggeredTrapezoid Validation model for the TriggeredTrapezoid 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.TrueHoldWithReset TrueHoldWithReset Validation model for the TrueHoldWithReset block
Buildings.Controls.OBC.CDL.Logical.Validation.Xor Xor Validation model for the Xor block
Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing ZeroCrossing Validation model for the zero crossing 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.And3 Buildings.Controls.OBC.CDL.Logical.Validation.And3

Validation model for the And3 block

Buildings.Controls.OBC.CDL.Logical.Validation.And3

Information

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

Modelica definition

model And3 "Validation model for the And3 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.And3 and1 "Logical and of three inputs"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( width=0.5, period=3) "Block that outputs cyclic on and off"; equation connect(booPul1.y,and1.u1); connect(booPul2.y,and1.u2); connect(booPul3.y,and1.u3); end And3;

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.Continuous.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.Continuous.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.Continuous.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.OnOffController Buildings.Controls.OBC.CDL.Logical.Validation.OnOffController

Validation model for the OnOffController block

Buildings.Controls.OBC.CDL.Logical.Validation.OnOffController

Information

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

Modelica definition

model OnOffController "Validation model for the OnOffController block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant cons2( k=0.7) "Constant as source term"; Buildings.Controls.OBC.CDL.Logical.OnOffController onOffController( bandwidth=0.1) "Delay a rising edge of the input, but do not delay a falling edge."; equation connect(ramp1.y,sin1.u); connect(sin1.y,onOffController.u); connect(cons2.y,onOffController.reference); end OnOffController;

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.Or3 Buildings.Controls.OBC.CDL.Logical.Validation.Or3

Validation model for the Or3 block

Buildings.Controls.OBC.CDL.Logical.Validation.Or3

Information

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

Modelica definition

model Or3 "Validation model for the Or3 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.Or3 or1 "Output true if at least one input is true"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( width=0.5, period=5) "Block that outputs cyclic on and off"; equation connect(booPul3.y,or1.u3); connect(booPul2.y,or1.u2); connect(booPul1.y,or1.u1); end Or3;

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.TriggeredTrapezoid Buildings.Controls.OBC.CDL.Logical.Validation.TriggeredTrapezoid

Validation model for the TriggeredTrapezoid block

Buildings.Controls.OBC.CDL.Logical.Validation.TriggeredTrapezoid

Information

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

Modelica definition

model TriggeredTrapezoid "Validation model for the TriggeredTrapezoid block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.TriggeredTrapezoid triggeredTrapezoid1( amplitude=5, rising=0.3, offset=1.5) "Triggered trapezoid generator"; equation connect(booPul.y,triggeredTrapezoid1.u); end TriggeredTrapezoid;

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.TrueHoldWithReset Buildings.Controls.OBC.CDL.Logical.Validation.TrueHoldWithReset

Validation model for the TrueHoldWithReset block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueHoldWithReset

Information

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

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 TrueHoldWithReset "Validation model for the TrueHoldWithReset block" Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( period=9000, shift=300) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset 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.TrueHoldWithReset 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.TrueHoldWithReset 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.TrueHoldWithReset 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 TrueHoldWithReset;

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;

Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing

Validation model for the zero crossing block

Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing

Information

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

Modelica definition

model ZeroCrossing "Validation model for the zero crossing block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( width=0.15, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.ZeroCrossing zeroCrossing "Zero crossing block"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Triggered sampler"; equation connect(booPul1.y,zeroCrossing.enable); connect(ramp1.y,sin1.u); connect(sin1.y,zeroCrossing.u); connect(ramp2.y,triggeredSampler.u); connect(zeroCrossing.y,triggeredSampler.trigger); end ZeroCrossing;