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.IntegerSwitch IntegerSwitch Validation model for the IntegerSwitch block
Buildings.Controls.OBC.CDL.Logical.Validation.Latch Latch Validation model for the Latch block
Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch LogicalSwitch Validation model for the LogicalSwitch 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.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.IntegerSwitch Buildings.Controls.OBC.CDL.Logical.Validation.IntegerSwitch

Validation model for the IntegerSwitch block

Buildings.Controls.OBC.CDL.Logical.Validation.IntegerSwitch

Information

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

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

Modelica definition

model IntegerSwitch "Validation model for the IntegerSwitch block" Buildings.Controls.OBC.CDL.Logical.IntegerSwitch integerSwitch "Integer switch"; 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.Integers.Sources.Constant conInt(k=5) "Integer constant"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt1(k=2) "Integer constant"; protected Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt "Type converter"; Buildings.Controls.OBC.CDL.Integers.Product proInt "Product"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1 "Type converter"; Buildings.Controls.OBC.CDL.Integers.Product proInt1 "Product"; equation connect(booPul2.y,integerSwitch. u2); connect(booPul1.y, booToInt.u); connect(booPul3.y, booToInt1.u); connect(conInt.y, proInt.u1); connect(booToInt.y, proInt.u2); connect(conInt1.y, proInt1.u1); connect(booToInt1.y, proInt1.u2); connect(proInt.y,integerSwitch. u1); connect(proInt1.y,integerSwitch. u3); end IntegerSwitch;

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.

Modelica definition

model Latch "Validation model for the Latch block" Buildings.Controls.OBC.CDL.Logical.Latch falCle "Latch block with clear input being contantly false"; Buildings.Controls.OBC.CDL.Logical.Latch truCle(pre_y_start=true) "Latch block with clear input being contantly true"; Buildings.Controls.OBC.CDL.Logical.Latch iniFalOut "False clear input, initial false output"; Buildings.Controls.OBC.CDL.Logical.Latch iniTruOut(pre_y_start=true) "False clear input, initial true output"; 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"; equation connect(cleInp.y, swiCleInp.clr); connect(not1.u, cleInp.y); connect(not1.y, swiCleInp1.clr); connect(fal.y, falCle.clr); connect(latInp.y, falCle.u); connect(tru.y, truCle.clr); connect(latInp.y, truCle.u); connect(fal.y, iniFalOut.clr); connect(fal.y,iniTruOut. clr); connect(latInp.y, iniFalOut.u); connect(latInp.y,iniTruOut. u); connect(latInp.y, swiCleInp.u); connect(latInp.y, swiCleInp1.u); end Latch;

Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch

Validation model for the LogicalSwitch block

Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch

Information

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

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

Modelica definition

model LogicalSwitch "Validation model for the LogicalSwitch 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.LogicalSwitch logicalSwitch "Switch between two boolean inputs"; equation connect(booPul2.y, logicalSwitch.u2); connect(booPul1.y, logicalSwitch.u1); connect(booPul3.y, logicalSwitch.u3); end LogicalSwitch;

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(nu=1) "Logical 'MultiAnd': 1 input connection y=u"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd2(nu=2) "Logical 'MultiAnd': 2 input connections y=and(u1, u2)"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd5(nu=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(nu=1) "Logical 'MultiOr': 1 input connection y=u"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr2(nu=2) "Logical 'MultiOr': 2 input connections y=and(u1, u2)"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr5(nu=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.

Modelica definition

model Switch "Validation model for the Switch block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=-1, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=-1, height=2) "Block that generates ramp signal"; 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.Switch switch1 "Switch between two real inputs"; equation connect(booPul.y, switch1.u2); connect(ramp2.y, switch1.u3); connect(ramp1.y, switch1.u1); 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 resetTimer "Timer will reset"; Buildings.Controls.OBC.CDL.Logical.Timer accuTimer( final accumulate=true) "Reset timer based on boolean input"; Buildings.Controls.OBC.CDL.Logical.Timer accuTimer1( final accumulate=true) "Reset timer based on boolean input"; Buildings.Controls.OBC.CDL.Logical.Timer accuTimer2( final accumulate=true) "Reset timer based on boolean input"; Buildings.Controls.OBC.CDL.Logical.Timer accuTimer3( final accumulate=true) "Reset timer based on boolean input"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( final width=0.1, final period=4) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold greEquThr( final threshold=1.5) "Output true when input is greater than threshold"; Buildings.Controls.OBC.CDL.Logical.Pre pre "Returns the value of the input signal from the last event iteration"; 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.Pulse booPul2( final width=0.5, final period=2, final startTime=0.5) "Block that outputs cyclic on and off"; equation connect(booPul.y, resetTimer.u); connect(booPul.y, accuTimer.u); connect(booPul1.y, accuTimer.reset); connect(booPul.y,accuTimer3. u); connect(accuTimer3.y, greEquThr.u); connect(greEquThr.y, pre.u); connect(pre.y,accuTimer3. reset); connect(booPul.y, accuTimer1.u); connect(booPul.y, accuTimer1.reset); connect(booPul.y, accuTimer2.reset); connect(booPul2.y, accuTimer2.u); end Timer;

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.

Modelica definition

model Toggle "Validation model for the Toggle block" Buildings.Controls.OBC.CDL.Logical.Toggle falCle "Latch block with clear input being contantly false"; Buildings.Controls.OBC.CDL.Logical.Toggle truCle(pre_y_start=true) "Latch block with clear input being contantly true"; Buildings.Controls.OBC.CDL.Logical.Toggle iniFalOut "False clear input, initial false output"; Buildings.Controls.OBC.CDL.Logical.Toggle iniTruOut(pre_y_start=true) "False clear input, initial true output"; 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.Constant fal(final k=false) "False clear input"; 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"; equation connect(cleInp.y,swiCleInp. clr); connect(not1.u,cleInp. y); connect(not1.y,swiCleInp1. clr); connect(fal.y,falCle. clr); connect(togInp.y,falCle. u); connect(tru.y,truCle. clr); connect(togInp.y,truCle. u); connect(fal.y,iniFalOut. clr); connect(fal.y,iniTruOut. clr); connect(togInp.y,iniFalOut. u); connect(togInp.y,iniTruOut. u); connect(togInp.y,swiCleInp. u); connect(togInp.y,swiCleInp1. 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( startTime=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( startTime=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( startTime=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( startTime=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( startTime=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( startTime=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( startTime=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( startTime=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, startTime=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, startTime=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;