CDL.Logical.Validation

Collection of models that validate the logical blocks of the CDL

Information

This package contains models that validate the blocks in 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
CDL.Logical.Validation.And And Validation model for the And block
CDL.Logical.Validation.And3 And3 Validation model for the And3 block
CDL.Logical.Validation.Change Change Validation model for the Change block.
CDL.Logical.Validation.Edge Edge Validation model for the Edge block
CDL.Logical.Validation.FallingEdge FallingEdge Validation model for the falling edge block
CDL.Logical.Validation.Latch Latch Validation model for the Latch block
CDL.Logical.Validation.MultiAnd MultiAnd Model to validate the application of MultiAnd block
CDL.Logical.Validation.MultiOr MultiOr Model to validate the application of MultiOr block
CDL.Logical.Validation.Nand Nand Validation model for the Nand block
CDL.Logical.Validation.Nor Nor Validation model for the Nor block
CDL.Logical.Validation.Not Not Validation model for the Not block
CDL.Logical.Validation.OnOffController OnOffController Validation model for the OnOffController block
CDL.Logical.Validation.Or Or Validation model for the Or block
CDL.Logical.Validation.Or3 Or3 Validation model for the Or3 block
CDL.Logical.Validation.Proof Proof Validation model for the Proof block
CDL.Logical.Validation.Switch Switch Validation model for the Switch block
CDL.Logical.Validation.Timer Timer Validation model for the Timer block
CDL.Logical.Validation.TimerAccumulating TimerAccumulating Validation model for the timer that accumulates the time
CDL.Logical.Validation.TimerAccumulatingNegativeStartTime TimerAccumulatingNegativeStartTime Validation model for the timer that accumulates the time, with a negative start time
CDL.Logical.Validation.TimerNegativeStartTime TimerNegativeStartTime Validation model for the Timer block with a negative start time
CDL.Logical.Validation.Toggle Toggle Validation model for the Toggle block
CDL.Logical.Validation.TriggeredTrapezoid TriggeredTrapezoid Validation model for the TriggeredTrapezoid block
CDL.Logical.Validation.TrueDelay TrueDelay Validation model for the TrueDelay block
CDL.Logical.Validation.TrueFalseHold TrueFalseHold Validation model for the TrueFalseHold block
CDL.Logical.Validation.TrueHoldWithReset TrueHoldWithReset Validation model for the TrueHoldWithReset block
CDL.Logical.Validation.VariablePulse VariablePulse Validation model for producing boolean pulse output
CDL.Logical.Validation.VariablePulseMinHold VariablePulseMinHold Validation model for producing boolean pulse output
CDL.Logical.Validation.Xor Xor Validation model for the Xor block
CDL.Logical.Validation.ZeroCrossing ZeroCrossing Validation model for the zero crossing block

CDL.Logical.Validation.And CDL.Logical.Validation.And

Validation model for the And block

CDL.Logical.Validation.And

Information

Validation test for the block CDL.Logical.And.

Modelica definition

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

CDL.Logical.Validation.And3 CDL.Logical.Validation.And3

Validation model for the And3 block

CDL.Logical.Validation.And3

Information

Validation test for the block CDL.Logical.And3.

Modelica definition

model And3 "Validation model for the And3 block" CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; CDL.Logical.And3 and1 "Logical and of three inputs"; 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;

CDL.Logical.Validation.Change CDL.Logical.Validation.Change

Validation model for the Change block.

CDL.Logical.Validation.Change

Information

Validation test for the block CDL.Logical.Change.

Modelica definition

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

CDL.Logical.Validation.Edge CDL.Logical.Validation.Edge

Validation model for the Edge block

CDL.Logical.Validation.Edge

Information

Validation test for the block CDL.Logical.Edge.

Modelica definition

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

CDL.Logical.Validation.FallingEdge CDL.Logical.Validation.FallingEdge

Validation model for the falling edge block

CDL.Logical.Validation.FallingEdge

Information

Validation test for the block CDL.Logical.FallingEdge.

Modelica definition

model FallingEdge "Validation model for the falling edge block" CDL.Logical.Sources.Pulse booPul( width=0.5, period=1.0) "Block that outputs cyclic on and off"; CDL.Logical.FallingEdge falEdg "Output true when input changes from true to false"; CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; 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;

CDL.Logical.Validation.Latch CDL.Logical.Validation.Latch

Validation model for the Latch block

CDL.Logical.Validation.Latch

Information

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

Modelica definition

model Latch "Validation model for the Latch block" CDL.Logical.Latch falCleTruIni "Latch block with clear input being contantly false and true initial latch input"; CDL.Logical.Latch truCleTruIni "Latch block with clear input being contantly true and true initial latch input"; CDL.Logical.Latch falCleFalIni "Latch block with clear input being contantly false and false initial latch input"; CDL.Logical.Latch truCleFalIni "Latch block with clear input being contantly true and false initial latch input"; CDL.Logical.Latch swiCleInp "Initial false output, with clear input switch between false and true"; CDL.Logical.Latch swiCleInp1 "Initial false output, with clear input switch between false and true"; CDL.Logical.Sources.Pulse cleInp( final width=0.5, final period=6) "Block that outputs cyclic on and off"; CDL.Logical.Not not1 "Logcal not"; CDL.Logical.Sources.Constant fal( final k=false) "False clear input"; CDL.Logical.Sources.Pulse latInp( final width=0.5, final period=2) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Constant tru( final k=true) "True clear input"; 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;

CDL.Logical.Validation.MultiAnd CDL.Logical.Validation.MultiAnd

Model to validate the application of MultiAnd block

CDL.Logical.Validation.MultiAnd

Information

Validation test for the block CDL.Logical.MultiAnd.

The input signals are configured as follows:

Modelica definition

model MultiAnd "Model to validate the application of MultiAnd block" CDL.Logical.MultiAnd mulAnd0 "Logical and with multiple inputs: 0 input"; CDL.Logical.MultiAnd mulAnd1( nin=1) "Logical 'MultiAnd': 1 input connection y=u"; CDL.Logical.MultiAnd mulAnd2( nin=2) "Logical 'MultiAnd': 2 input connections y=and(u1, u2)"; CDL.Logical.MultiAnd mulAnd5( nin=5) "Logical 'MultiAnd': 5 input connections y=and(u1, u2, ..., u5)"; CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=2) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul3( width=0.5, period=3) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul4( width=0.5, period=4) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.MultiOr CDL.Logical.Validation.MultiOr

Model to validate the application of MultiOr block

CDL.Logical.Validation.MultiOr

Information

Validation test for the block CDL.Logical.MultiOr.

The input signals are configured as follows:

Modelica definition

model MultiOr "Model to validate the application of MultiOr block" CDL.Logical.MultiOr mulOr0 "Logical 'MultiOr': 1 input connection y=u"; CDL.Logical.MultiOr mulOr1( nin=1) "Logical 'MultiOr': 1 input connection y=u"; CDL.Logical.MultiOr mulOr2( nin=2) "Logical 'MultiOr': 2 input connections y=and(u1, u2)"; CDL.Logical.MultiOr mulOr5( nin=5) "Logical 'MultiOr': 5 input connections y=and(u1, u2, ..., u5)"; CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=2) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul3( width=0.5, period=3) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul4( width=0.5, period=4) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.Nand CDL.Logical.Validation.Nand

Validation model for the Nand block

CDL.Logical.Validation.Nand

Information

Validation test for the block CDL.Logical.Nand.

Modelica definition

model Nand "Validation model for the Nand block" CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.Nor CDL.Logical.Validation.Nor

Validation model for the Nor block

CDL.Logical.Validation.Nor

Information

Validation test for the block CDL.Logical.Nor.

Modelica definition

model Nor "Validation model for the Nor block" CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.Not CDL.Logical.Validation.Not

Validation model for the Not block

CDL.Logical.Validation.Not

Information

Validation test for the block CDL.Logical.Not.

Modelica definition

model Not "Validation model for the Not block" CDL.Logical.Sources.Pulse booPul( width=0.5, period=1.5) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.OnOffController CDL.Logical.Validation.OnOffController

Validation model for the OnOffController block

CDL.Logical.Validation.OnOffController

Information

Validation test for the block CDL.Logical.OnOffController.

Modelica definition

model OnOffController "Validation model for the OnOffController block" CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; CDL.Continuous.Sources.Constant cons2( k=0.7) "Constant as source term"; 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;

CDL.Logical.Validation.Or CDL.Logical.Validation.Or

Validation model for the Or block

CDL.Logical.Validation.Or

Information

Validation test for the block CDL.Logical.Or.

Modelica definition

model Or "Validation model for the Or block" CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=3) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.Or3 CDL.Logical.Validation.Or3

Validation model for the Or3 block

CDL.Logical.Validation.Or3

Information

Validation test for the block CDL.Logical.Or3.

Modelica definition

model Or3 "Validation model for the Or3 block" CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=3) "Block that outputs cyclic on and off"; CDL.Logical.Or3 or1 "Output true if at least one input is true"; 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;

CDL.Logical.Validation.Proof CDL.Logical.Validation.Proof

Validation model for the Proof block

CDL.Logical.Validation.Proof

Information

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

Modelica definition

model Proof "Validation model for the Proof block" CDL.Logical.Proof pro( debounce=0.5, feedbackDelay=0.75) "Both inputs change at the same time"; CDL.Logical.Proof pro1( debounce=0.5, feedbackDelay=0.75) "Commanded input changes from true to false earlier than measured input"; CDL.Logical.Proof pro2( debounce=0.5, feedbackDelay=0.75) "Measured input changes from true to false earlier than commanded input"; CDL.Logical.Proof pro3( debounce=0.5, feedbackDelay=0.5) "Shorter delay to valid input"; CDL.Logical.Proof pro4( debounce=0.5, feedbackDelay=0.5) "Shorter delay to valid input"; CDL.Logical.Proof pro5( debounce=2, feedbackDelay=2) "Both inputs change at the same time"; CDL.Logical.Sources.Pulse latInp( width=0.2, period=10, shift=1) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse latInp1( width=0.2, period=10, shift=1) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse latInp2( width=0.1, period=10, shift=1) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse latInp3( width=0.5, period=2, shift=1) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.Switch CDL.Logical.Validation.Switch

Validation model for the Switch block

CDL.Logical.Validation.Switch

Information

Validation test for the block 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" CDL.Logical.Sources.Pulse booPul1( width=0.7, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=3) "Block that outputs cyclic on and off: switch between u1 and u3"; CDL.Logical.Sources.Pulse booPul3( width=0.5, period=5) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.Timer CDL.Logical.Validation.Timer

Validation model for the Timer block

CDL.Logical.Validation.Timer

Information

Validation test for the block CDL.Logical.Timer.

Modelica definition

model Timer "Validation model for the Timer block" CDL.Logical.Timer noThr "Timer that do not compare threshold"; CDL.Logical.Timer thrTim( final t=0.3) "Timer that compares threshold"; CDL.Logical.Timer thrTim1( final t=0.3) "Timer that compares threshold"; CDL.Logical.Sources.Pulse booPul( final width=0.7, final period=2) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.TimerAccumulating CDL.Logical.Validation.TimerAccumulating

Validation model for the timer that accumulates the time

CDL.Logical.Validation.TimerAccumulating

Information

Validation test for the block CDL.Logical.TimerAccumulating.

Modelica definition

model TimerAccumulating "Validation model for the timer that accumulates the time" CDL.Logical.TimerAccumulating noThr "Accumulating timer that do not compare threshold"; CDL.Logical.TimerAccumulating thrTim( final t=1) "Accumulating timer that compares threshold"; CDL.Logical.TimerAccumulating noThrWitRes "Accumulating timer that could reset the output"; CDL.Logical.TimerAccumulating thrTimWitRes( final t=1) "Accumulating timer that could reset the output and the output compares with threshold"; CDL.Logical.Sources.Pulse booPul( final width=0.5, final period=2) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Constant con( final k=false) "Constant false"; 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;

CDL.Logical.Validation.TimerAccumulatingNegativeStartTime CDL.Logical.Validation.TimerAccumulatingNegativeStartTime

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

CDL.Logical.Validation.TimerAccumulatingNegativeStartTime

Information

Validation test for the block CDL.Logical.TimerAccumulating.

Modelica definition

model TimerAccumulatingNegativeStartTime "Validation model for the timer that accumulates the time, with a negative start time" CDL.Logical.TimerAccumulating noThr "Accumulating timer that do not compare threshold"; CDL.Logical.TimerAccumulating thrTim( final t=1) "Accumulating timer that compares threshold"; CDL.Logical.TimerAccumulating noThrWitRes "Accumulating timer that could reset the output"; CDL.Logical.TimerAccumulating thrTimWitRes( final t=1) "Accumulating timer that could reset the output and the output compares with threshold"; CDL.Logical.Sources.Pulse booPul( final width=0.5, final period=4, shift=-11) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Constant con( final k=false) "Constant false"; 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;

CDL.Logical.Validation.TimerNegativeStartTime CDL.Logical.Validation.TimerNegativeStartTime

Validation model for the Timer block with a negative start time

CDL.Logical.Validation.TimerNegativeStartTime

Information

Validation test for the block CDL.Logical.Timer.

Modelica definition

model TimerNegativeStartTime "Validation model for the Timer block with a negative start time" CDL.Logical.Timer noThr "Timer that do not compare threshold"; CDL.Logical.Timer thrTim( final t=0.3) "Timer that compares threshold"; 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;

CDL.Logical.Validation.Toggle CDL.Logical.Validation.Toggle

Validation model for the Toggle block

CDL.Logical.Validation.Toggle

Information

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

Modelica definition

model Toggle "Validation model for the Toggle block" CDL.Logical.Toggle falCleTruIni "Toggle block with clear input being contantly false and true initial toggle input"; CDL.Logical.Toggle falCleFalIni "Toggle block with clear input being contantly false and false initial toggle input"; CDL.Logical.Toggle truCleTruIni "Toggle block with clear input being contantly true and true initial toggle input"; CDL.Logical.Toggle truCleFalIni "Toggle block with clear input being contantly true and false initial toggle input"; CDL.Logical.Toggle swiCleInp "Initial false output, with clear input switch between false and true"; CDL.Logical.Toggle swiCleInp1 "Initial false output, with clear input switch between false and true"; CDL.Logical.Sources.Pulse cleInp( final width=0.5, final period=6) "Block that outputs cyclic on and off"; CDL.Logical.Not not1 "Logical not"; CDL.Logical.Sources.Pulse togInp( final width=0.5, final period=2) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Constant tru( final k=true) "True clear input"; CDL.Logical.Not not2 "Logical not"; 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;

CDL.Logical.Validation.TriggeredTrapezoid CDL.Logical.Validation.TriggeredTrapezoid

Validation model for the TriggeredTrapezoid block

CDL.Logical.Validation.TriggeredTrapezoid

Information

Validation test for the block CDL.Logical.TriggeredTrapezoid.

Modelica definition

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

CDL.Logical.Validation.TrueDelay CDL.Logical.Validation.TrueDelay

Validation model for the TrueDelay block

CDL.Logical.Validation.TrueDelay

Information

Validation test for the block CDL.Logical.TrueDelay.

Modelica definition

model TrueDelay "Validation model for the TrueDelay block" CDL.Logical.TrueDelay onDelay0( final delayTime=0) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay1( final delayTime=0.5) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay2( final delayTime=0.8) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay4( final delayTime=0) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay5( final delayTime=0.5) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay6( final delayTime=0.8) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.Not not1 "Negation of input signal"; CDL.Logical.TrueDelay onDelay3( final delayTime=1.8) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay7( final delayTime=1.8) "Delay a rising edge of the input, but do not delay a falling edge."; CDL.Logical.TrueDelay onDelay00( final delayTime=0, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; 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."; 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."; CDL.Logical.TrueDelay onDelay44( final delayTime=0, final delayOnInit=true) "Delay a rising edge of the input, but do not delay a falling edge."; 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."; 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."; CDL.Logical.Not not2 "Negation of input signal"; 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."; 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 CDL.Logical.Sources.Pulse booPul( final width=0.5, final period=1.5) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.TrueFalseHold CDL.Logical.Validation.TrueFalseHold

Validation model for the TrueFalseHold block

CDL.Logical.Validation.TrueFalseHold

Information

Validation test for the block 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" CDL.Logical.Sources.Pulse booPul( shift=0, period=1500) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Sources.Pulse booPul1( shift=0, period=1000, width=0.25) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol1( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Sources.Pulse booPul2( shift=0, period=1500) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol2( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Sources.Pulse booPul3( shift=0, period=1000, width=0.25) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol3( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Not not1 "Negation of input signal"; CDL.Logical.Not not3 "Negation of input signal"; CDL.Logical.Sources.Pulse booPul4( shift=100, period=1500) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol4( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Sources.Pulse booPul5( shift=100, period=1000, width=0.25) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol5( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Sources.Pulse booPul6( shift=100, period=1500) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol6( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Sources.Pulse booPul7( shift=100, period=1000, width=0.25) "Boolean pulse input signal"; CDL.Logical.TrueFalseHold truFalHol7( trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; CDL.Logical.Not not2 "Negation of input signal"; 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;

CDL.Logical.Validation.TrueHoldWithReset CDL.Logical.Validation.TrueHoldWithReset

Validation model for the TrueHoldWithReset block

CDL.Logical.Validation.TrueHoldWithReset

Information

Validation test for the block 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" CDL.Logical.Sources.Pulse booPul( period=9000, shift=300) "Boolean pulse input signal"; CDL.Logical.TrueHoldWithReset truHol( duration=3600) "Block that holds a signal on for a requested time period"; CDL.Logical.Sources.Pulse booPul1( period=3600) "Boolean pulse input signal"; CDL.Logical.TrueHoldWithReset truHol1( duration=600) "Block that holds a signal on for a requested time period"; CDL.Logical.Sources.Pulse booPul2( period=9000, shift=300) "Boolean pulse input signal"; CDL.Logical.TrueHoldWithReset truHol2( duration=3600) "Block that holds a signal on for a requested time period"; CDL.Logical.Sources.Pulse booPul3( period=3600) "Boolean pulse input signal"; CDL.Logical.TrueHoldWithReset truHol3( duration=600) "Block that holds a signal on for a requested time period"; CDL.Logical.Not not2 "Negation of input signal"; 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;

CDL.Logical.Validation.VariablePulse CDL.Logical.Validation.VariablePulse

Validation model for producing boolean pulse output

CDL.Logical.Validation.VariablePulse

Information

Validation test for the block CDL.Logical.VariablePulse.

Modelica definition

model VariablePulse "Validation model for producing boolean pulse output" CDL.Logical.VariablePulse conTru( period=900) "Variable pulse with constant pulse width"; CDL.Logical.VariablePulse fal( period=900) "Variable pulse with the zero width input"; CDL.Logical.VariablePulse truFal( period=900) "Variable pulse with width input changing from positive value to zero"; CDL.Logical.VariablePulse falTru( period=900) "Variable pulse with width input changing from zero to positive value"; CDL.Logical.VariablePulse tru( period=900) "Variable pulse with the constant width input"; CDL.Logical.VariablePulse falTru1( period=900) "Variable pulse with width input changing between different positive values"; CDL.Continuous.Sources.Pulse conPul( amplitude=0.65, width=0.8, period=4000) "Continuous pulse signal"; CDL.Continuous.Sources.Constant con( k=0.75) "Constant"; CDL.Continuous.Sources.Constant con1( k=0) "Constant value"; CDL.Continuous.Sources.Pulse conPul1( amplitude=0.65, width=0.85, period=3600, shift=360) "Continuous pulse signal"; CDL.Continuous.Sources.Constant con2( k=1) "Constant value"; CDL.Continuous.Sources.Pulse conPul2( amplitude=0.5, width=0.5, period=3600, shift=360, offset=0.3) "Continuous pulse signal"; CDL.Logical.VariablePulse conChaWid( period=900) "Variable pulse with constantly changing pulse width "; CDL.Continuous.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;

CDL.Logical.Validation.VariablePulseMinHold CDL.Logical.Validation.VariablePulseMinHold

Validation model for producing boolean pulse output

CDL.Logical.Validation.VariablePulseMinHold

Information

Validation test for the block 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" CDL.Logical.VariablePulse conChaWid( period=3, minTruFalHol=1) "Variable pulse with constantly changing pulse width "; CDL.Continuous.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;

CDL.Logical.Validation.Xor CDL.Logical.Validation.Xor

Validation model for the Xor block

CDL.Logical.Validation.Xor

Information

Validation test for the block CDL.Logical.Xor.

Modelica definition

model Xor "Validation model for the Xor block" CDL.Logical.Sources.Pulse booPul1( width=0.5, period=1.5) "Block that outputs cyclic on and off"; CDL.Logical.Sources.Pulse booPul2( width=0.5, period=5) "Block that outputs cyclic on and off"; 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;

CDL.Logical.Validation.ZeroCrossing CDL.Logical.Validation.ZeroCrossing

Validation model for the zero crossing block

CDL.Logical.Validation.ZeroCrossing

Information

Validation test for the block CDL.Logical.ZeroCrossing.

Modelica definition

model ZeroCrossing "Validation model for the zero crossing block" CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; CDL.Logical.Sources.Pulse booPul1( width=0.15, period=5) "Block that outputs cyclic on and off"; CDL.Logical.ZeroCrossing zeroCrossing "Zero crossing block"; 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;