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 |
And
|
Validation model for the And block |
Change
|
Validation model for the Change block. |
Edge
|
Validation model for the Edge block |
FallingEdge
|
Validation model for the falling edge block |
Latch
|
Validation model for the Latch block |
MultiAnd
|
Model to validate the application of MultiAnd block |
MultiOr
|
Model to validate the application of MultiOr block |
Nand
|
Validation model for the Nand block |
Nor
|
Validation model for the Nor block |
Not
|
Validation model for the Not block |
Or
|
Validation model for the Or block |
Proof
|
Validation model for the Proof block |
Switch
|
Validation model for the Switch block |
Timer
|
Validation model for the Timer block |
TimerAccumulating
|
Validation model for the timer that accumulates the time |
TimerAccumulatingNegativeStartTime
|
Validation model for the timer that accumulates the time, with a negative start time |
TimerNegativeStartTime
|
Validation model for the Timer block with a negative start time |
Toggle
|
Validation model for the Toggle block |
TrueDelay
|
Validation model for the TrueDelay block |
TrueFalseHold
|
Validation model for the TrueFalseHold block |
TrueHold
|
Validation model for the TrueHold block |
VariablePulse
|
Validation model for producing boolean pulse output |
VariablePulseMinHold
|
Validation model for producing boolean pulse output |
Xor
|
Validation model for the Xor block |
Validation model for the And block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.And.
Modelica definition
Validation model for the Change block.
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Change.
Modelica definition
Validation model for the Edge block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Edge.
Modelica definition
Validation model for the falling edge block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.FallingEdge.
Modelica definition
Validation model for the Latch block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Latch. Following tests are implemented:
-
When the clear input is
false
, the initial output should equal to the initial latch input.
-
When the clear input is
true
, the initial output should be false
,
regardless of the value of the latch input.
-
At the same moment, when both the clear input and the latch input rise from
false
to true
, the output should become false
if it was true
,
or remain false
if it was false
.
-
At the same moment, when the clear input falls from
true
to false
and the latch input rises from false
to true
, the output
should rise from false
to true
.
Modelica definition
model Latch
Buildings.Controls.OBC.CDL.Logical.Latch falCleTruIni
;
Buildings.Controls.OBC.CDL.Logical.Latch truCleTruIni
;
Buildings.Controls.OBC.CDL.Logical.Latch falCleFalIni
;
Buildings.Controls.OBC.CDL.Logical.Latch truCleFalIni
;
Buildings.Controls.OBC.CDL.Logical.Latch swiCleInp
;
Buildings.Controls.OBC.CDL.Logical.Latch swiCleInp1
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse cleInp(
final width=0.5,
final period=6)
;
Buildings.Controls.OBC.CDL.Logical.Not not1
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant fal(
final k=false)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp(
final width=0.5,
final period=2)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant tru(
final k=true)
;
Buildings.Controls.OBC.CDL.Logical.Not not2
;
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;
Model to validate the application of MultiAnd block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.MultiAnd.
The input signals are configured as follows:
- input u1 has a period of 1 s and a width of
0.5 s.
- input u2 has a period of 2 s and a width of
0.5 s.
- input u3 has a period of 3 s and a width of
0.5 s.
- input u4 has a period of 4 s and a width of
0.5 s.
- input u5 has a period of 5 s and a width of
0.5 s.
Modelica definition
model MultiAnd
Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd0
;
Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd1(
nin=1)
;
Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd2(
nin=2)
;
Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd5(
nin=5)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(
width=0.5,
period=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(
width=0.5,
period=2)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(
width=0.5,
period=3)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4(
width=0.5,
period=4)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5(
width=0.5,
period=5)
;
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;
Model to validate the application of MultiOr block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.MultiOr.
The input signals are configured as follows:
- input u1 has a period of 1 s and a width of
0.5 s.
- input u2 has a period of 2 s and a width of
0.5 s.
- input u3 has a period of 3 s and a width of
0.5 s.
- input u4 has a period of 4 s and a width of
0.5 s.
- input u5 has a period of 5 s and a width of
0.5 s.
Modelica definition
model MultiOr
Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr0
;
Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr1(
nin=1)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr2(
nin=2)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr5(
nin=5)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(
width=0.5,
period=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(
width=0.5,
period=2)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(
width=0.5,
period=3)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4(
width=0.5,
period=4)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5(
width=0.5,
period=5)
;
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;
Validation model for the Nand block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Nand.
Modelica definition
Validation model for the Nor block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Nor.
Modelica definition
Validation model for the Not block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Not.
Modelica definition
Validation model for the Or block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Or.
Modelica definition
Validation model for the Proof block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Proof. The following tests are implemented:
-
The instance
pro
tests the case in which
both boolean inputs change simultaneously, and hence both outputs will be
false
.
-
The instances
pro2
and pro3
use a different value
for feedbackDelay
. They test the case in which
both the inputs change from true
to false
. However,
after the input u_m
changes, the input u_s
remains
true
for a time that is longer than
feedbackDelay
. The output yLocFal
will be true
.
-
The instances
pro1
and pro4
use a different value
for feedbackDelay
. They test the case in which
both the inputs change from true
to false
. However,
after the input u_s
changes, the input u_m
remains
true
for a time that is longer than
feedbackDelay
. The output yLocTru
will be true
.
-
The instance
pro5
tests the case in which
the measured input u_m
does not stabilize during the debounce time,
and hence both outputs will be true
.
Modelica definition
model Proof
Buildings.Controls.OBC.CDL.Logical.Proof pro(
debounce=0.5,
feedbackDelay=0.75) ;
Buildings.Controls.OBC.CDL.Logical.Proof pro1(
debounce=0.5,
feedbackDelay=0.75)
;
Buildings.Controls.OBC.CDL.Logical.Proof pro2(
debounce=0.5,
feedbackDelay=0.75)
;
Buildings.Controls.OBC.CDL.Logical.Proof pro3(
debounce=0.5,
feedbackDelay=0.5)
;
Buildings.Controls.OBC.CDL.Logical.Proof pro4(
debounce=0.5,
feedbackDelay=0.5)
;
Buildings.Controls.OBC.CDL.Logical.Proof pro5(
debounce=2,
feedbackDelay=2)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp(
width=0.2,
period=10,
shift=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp1(
width=0.2,
period=10,
shift=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp2(
width=0.1,
period=10,
shift=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp3(
width=0.5,
period=2,
shift=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse latInp4(
width=0.9,
period=12,
shift=0.5)
;
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;
Validation model for the Switch block
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
Validation model for the Timer block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Timer.
Modelica definition
Validation model for the timer that accumulates the time
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating.
Modelica definition
model TimerAccumulating
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThr
;
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTim(
final t=1)
;
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThrWitRes
;
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTimWitRes(
final t=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(
final width=0.5,
final period=2)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(
final k=false)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse resTim(
final width=0.5,
final period=3.5)
;
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;
Validation model for the timer that accumulates the time, with a negative start time
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating.
Modelica definition
model TimerAccumulatingNegativeStartTime
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThr
;
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTim(
final t=1)
;
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating noThrWitRes
;
Buildings.Controls.OBC.CDL.Logical.TimerAccumulating thrTimWitRes(
final t=1)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(
final width=0.5,
final period=4,
shift=-11)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(
final k=false)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse resTim(
final width=0.5,
final period=3.5,
shift=-5)
;
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;
Validation model for the Timer block with a negative start time
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Timer.
Modelica definition
Validation model for the Toggle block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Toggle. Following tests are implemented:
-
When the clear input is
false
, the initial output should equal to the initial toggle input.
-
When the clear input is
true
, the initial output should be false
,
regardless of the value of the toggle input.
-
At the same moment, when both the clear input and the toggle input rise from
false
to true
, the output should become false
if it was true
,
or remain false
if it was false
.
-
At the same moment, when the clear input falls from
true
to false
and the toggle input rises from false
to true
, the output
should rise from false
to true
.
Modelica definition
model Toggle
Buildings.Controls.OBC.CDL.Logical.Toggle falCleTruIni
;
Buildings.Controls.OBC.CDL.Logical.Toggle falCleFalIni
;
Buildings.Controls.OBC.CDL.Logical.Toggle truCleTruIni
;
Buildings.Controls.OBC.CDL.Logical.Toggle truCleFalIni
;
Buildings.Controls.OBC.CDL.Logical.Toggle swiCleInp
;
Buildings.Controls.OBC.CDL.Logical.Toggle swiCleInp1
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse cleInp(
final width=0.5,
final period=6)
;
Buildings.Controls.OBC.CDL.Logical.Not not1
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse togInp(
final width=0.5,
final period=2)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant tru(
final k=true)
;
Buildings.Controls.OBC.CDL.Logical.Not not2
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant fal(
final k=false)
;
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;
Validation model for the TrueDelay block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.TrueDelay.
Modelica definition
model TrueDelay
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay0(
final delayTime=0)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay1(
final delayTime=0.5)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay2(
final delayTime=0.8)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay4(
final delayTime=0)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay5(
final delayTime=0.5)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay6(
final delayTime=0.8)
;
Buildings.Controls.OBC.CDL.Logical.Not not1
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay3(
final delayTime=1.8)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay7(
final delayTime=1.8)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay00(
final delayTime=0,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay11(
final delayTime=0.5,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay22(
final delayTime=0.8,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay44(
final delayTime=0,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay55(
final delayTime=0.5,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay66(
final delayTime=0.8,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.Not not2
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay33(
final delayTime=1.8,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay77(
final delayTime=1.8,
final delayOnInit=true)
;
protected
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(
final width=0.5,
final period=1.5)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(
final width=0.5,
final period=1.5)
;
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;
Validation model for the TrueFalseHold block
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
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(
shift=0,
period=1500)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(
shift=0,
period=1000,
width=0.25)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol1(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(
shift=0,
period=1500)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol2(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(
shift=0,
period=1000,
width=0.25)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol3(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Not not1
;
Buildings.Controls.OBC.CDL.Logical.Not not3
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4(
shift=100,
period=1500)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol4(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5(
shift=100,
period=1000,
width=0.25)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol5(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul6(
shift=100,
period=1500)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol6(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul7(
shift=100,
period=1000,
width=0.25)
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol7(
trueHoldDuration=1000)
;
Buildings.Controls.OBC.CDL.Logical.Not not2
;
Buildings.Controls.OBC.CDL.Logical.Not not4
;
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;
Validation model for the TrueHold block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.TrueHold.
The validation uses different instances to validate different hold durations, different lengths
of the input pulse, and different initial values for the input signal.
Modelica definition
Validation model for producing boolean pulse output
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.VariablePulse.
-
The instance
fal
has the constant 0
input. It gives
constant false
output.
-
The instance
tru
has the constant 1
input. It gives
constant true
output.
-
The instance
conTru
has the constant 0.75
input.
It gives the pulse output, with the width (75%).
-
The instance
truFal
has the input changing from 0.65
to 0
. It outputs a pulse (with the width of 65%) and then changes
to constant false
.
-
The instance
falTru
has the input changing from 0
to 0.65
and then back to 0
. It firstly outputs the constant
false
, then a pulse (with the width of 65%) and finally back
to false
.
-
The instance
falTru1
has the input changing from 0.3
to 0.8
and then back to 0.3
. It firstly outputs a
pulse with the width of 30%, then a pulse with the width of 80%, and
finally a pulse with the width of 30% again. When the input changes, it gives
a new pulse immediately.
-
The instance
conChaWid
has a ramp input. It gives constant
true
output when the input is ramping up.
Modelica definition
model VariablePulse
Buildings.Controls.OBC.CDL.Logical.VariablePulse conTru(
period=900) ;
Buildings.Controls.OBC.CDL.Logical.VariablePulse fal(
period=900)
;
Buildings.Controls.OBC.CDL.Logical.VariablePulse truFal(
period=900)
;
Buildings.Controls.OBC.CDL.Logical.VariablePulse falTru(
period=900)
;
Buildings.Controls.OBC.CDL.Logical.VariablePulse tru(
period=900)
;
Buildings.Controls.OBC.CDL.Logical.VariablePulse falTru1(
period=900)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul(
amplitude=0.65,
width=0.8,
period=4000)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con(
k=0.75)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con1(
k=0)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul1(
amplitude=0.65,
width=0.85,
period=3600,
shift=360)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con2(
k=1)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Pulse conPul2(
amplitude=0.5,
width=0.5,
period=3600,
shift=360,
offset=0.3)
;
Buildings.Controls.OBC.CDL.Logical.VariablePulse conChaWid(
period=900)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ram(
height=0.8,
duration=900,
startTime=300)
;
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;
Validation model for producing boolean pulse output
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.VariablePulse.
It tests the case that the input value changes at the moment when the output
is still in previous status in less than the minimum holding time.
In the case, the output holds the previous status for the minimum holding time
and then change to the new status.
Modelica definition
Validation model for the Xor block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Logical.Xor.
Modelica definition