Buildings.Controls.OBC.CDL.Continuous.Validation

Collection of models that validate the continuous blocks of the CDL

Information

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

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.Continuous.Validation.Abs Abs Validation model for the absolute block
Buildings.Controls.OBC.CDL.Continuous.Validation.Add Add Validation model for the add block
Buildings.Controls.OBC.CDL.Continuous.Validation.AddParameter AddParameter Validation model for the AddParameter block
Buildings.Controls.OBC.CDL.Continuous.Validation.Atan Atan Validation model for the Atan block
Buildings.Controls.OBC.CDL.Continuous.Validation.Atan2 Atan2 Validation model for the Atan2 block
Buildings.Controls.OBC.CDL.Continuous.Validation.Average Average Validation model for the Average block
Buildings.Controls.OBC.CDL.Continuous.Validation.ChangeSign ChangeSign Validation model for the ChangeSign block
Buildings.Controls.OBC.CDL.Continuous.Validation.Cos Cos Validation model for the Cos block
Buildings.Controls.OBC.CDL.Continuous.Validation.Derivative Derivative Validation model for the Derivative block
Buildings.Controls.OBC.CDL.Continuous.Validation.Division Division Validation model for the Division block
Buildings.Controls.OBC.CDL.Continuous.Validation.Exp Exp Validation model for the Exp block
Buildings.Controls.OBC.CDL.Continuous.Validation.Feedback Feedback Validation model for the Feedback block
Buildings.Controls.OBC.CDL.Continuous.Validation.Gain Gain Validation model for the Gain block
Buildings.Controls.OBC.CDL.Continuous.Validation.Greater Greater Validation model for the Greater block
Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqual GreaterEqual Validation model for the GreaterEqual block
Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqualThreshold GreaterEqualThreshold Validation model for the GreaterEqualThreshold block
Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterThreshold GreaterThreshold Validation model for the GreaterThreshold block
Buildings.Controls.OBC.CDL.Continuous.Validation.Hysteresis Hysteresis Validation model for the Hysteresis block
Buildings.Controls.OBC.CDL.Continuous.Validation.HysteresisWithHold HysteresisWithHold Validation model for the HysteresisWithHold block
Buildings.Controls.OBC.CDL.Continuous.Validation.IntegratorWithReset IntegratorWithReset Test model for integrator with reset
Buildings.Controls.OBC.CDL.Continuous.Validation.Less Less Validation model for the Less block
Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqual LessEqual Validation model for the LessEqual block
Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqualThreshold LessEqualThreshold Validation model for the LessEqualThreshold block
Buildings.Controls.OBC.CDL.Continuous.Validation.LessThreshold LessThreshold Validation model for the LessThreshold block
Buildings.Controls.OBC.CDL.Continuous.Validation.LimPID LimPID Test model for LimPID controller
Buildings.Controls.OBC.CDL.Continuous.Validation.Limiter Limiter Validation model for the Limiter block
Buildings.Controls.OBC.CDL.Continuous.Validation.Line Line Validation model for the Line block
Buildings.Controls.OBC.CDL.Continuous.Validation.Log Log Validation model for the Log block
Buildings.Controls.OBC.CDL.Continuous.Validation.Log10 Log10 Validation model for the Log10 block
Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixGain MatrixGain Validation model for the MatrixGain block
Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMax MatrixMax Validation model for the MatrixMax block
Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMin MatrixMin Validation model for the MatrixMin block
Buildings.Controls.OBC.CDL.Continuous.Validation.Max Max Validation model for the Max block
Buildings.Controls.OBC.CDL.Continuous.Validation.Min Min Validation model for the Min block
Buildings.Controls.OBC.CDL.Continuous.Validation.Modulo Modulo Validation model for the Modulo block
Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean MovingMean Validation model for the MovingMean block
Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean_nonZeroStart MovingMean_nonZeroStart Validation model for the MovingMean block
Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMax MultiMax Validation model for the MultiMax block
Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMin MultiMin Validation model for the MultiMin block
Buildings.Controls.OBC.CDL.Continuous.Validation.MultiSum MultiSum Model to validate the application of MultiSum block
Buildings.Controls.OBC.CDL.Continuous.Validation.NumberOfRequests NumberOfRequests Validation model for the NumberOfRequests block
Buildings.Controls.OBC.CDL.Continuous.Validation.Product Product Validation model for the Product block
Buildings.Controls.OBC.CDL.Continuous.Validation.Round Round Validation model for the Round block
Buildings.Controls.OBC.CDL.Continuous.Validation.Sin Sin Validation model for the Sin block
Buildings.Controls.OBC.CDL.Continuous.Validation.SlewRateLimiter SlewRateLimiter Validation model for the SlewRateLimiter block
Buildings.Controls.OBC.CDL.Continuous.Validation.Sort Sort Validation model for the Sort block
Buildings.Controls.OBC.CDL.Continuous.Validation.Sqrt Sqrt Validation model for the Sqrt block
Buildings.Controls.OBC.CDL.Continuous.Validation.Tan Tan Validation model for the Tan block

Buildings.Controls.OBC.CDL.Continuous.Validation.Abs Buildings.Controls.OBC.CDL.Continuous.Validation.Abs

Validation model for the absolute block

Buildings.Controls.OBC.CDL.Continuous.Validation.Abs

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Abs. The input varies from -1 to +1.

Modelica definition

model Abs "Validation model for the absolute block" Buildings.Controls.OBC.CDL.Continuous.Abs abs1 "Block that outputs the absolute value of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp( height=2, duration=1, offset=-1) "Block that generates ramp signal"; equation connect(ramp.y, abs1.u); end Abs;

Buildings.Controls.OBC.CDL.Continuous.Validation.Add Buildings.Controls.OBC.CDL.Continuous.Validation.Add

Validation model for the add block

Buildings.Controls.OBC.CDL.Continuous.Validation.Add

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Add.

The input u1 varies from -2 to +2, input u2 varies from -1 to +1.

Modelica definition

model Add "Validation model for the add block" Buildings.Controls.OBC.CDL.Continuous.Add add1 "Block that outputs the sum of the two inputs"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( height=2, duration=1, offset=-1) "Block that generates ramp signal"; equation connect(ramp1.y, add1.u1); connect(ramp2.y, add1.u2); end Add;

Buildings.Controls.OBC.CDL.Continuous.Validation.AddParameter Buildings.Controls.OBC.CDL.Continuous.Validation.AddParameter

Validation model for the AddParameter block

Buildings.Controls.OBC.CDL.Continuous.Validation.AddParameter

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.AddParameter.

The input u varies from -2 to +2.

Modelica definition

model AddParameter "Validation model for the AddParameter block" Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar( p = 0.5, k = 1.0) "Block that outputs the sum of an input plus a parameter"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; equation connect(ramp1.y, addPar.u); end AddParameter;

Buildings.Controls.OBC.CDL.Continuous.Validation.Atan Buildings.Controls.OBC.CDL.Continuous.Validation.Atan

Validation model for the Atan block

Buildings.Controls.OBC.CDL.Continuous.Validation.Atan

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Atan.

The input u varies from -2 to +2.

Modelica definition

model Atan "Validation model for the Atan block" Buildings.Controls.OBC.CDL.Continuous.Atan atan1 "Block that outputs the arc tangent of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; equation connect(ramp1.y, atan1.u); end Atan;

Buildings.Controls.OBC.CDL.Continuous.Validation.Atan2 Buildings.Controls.OBC.CDL.Continuous.Validation.Atan2

Validation model for the Atan2 block

Buildings.Controls.OBC.CDL.Continuous.Validation.Atan2

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Atan2.

The input u1 varies from -2 to +2, The input u2 varies from +1 to +3.

Modelica definition

model Atan2 "Validation model for the Atan2 block" Buildings.Controls.OBC.CDL.Continuous.Atan2 atan2_1 "Block that outputs atan(u1/u2) of the inputs u1 and u2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=1, height=2) "Block that generates ramp signal"; equation connect(ramp1.y, atan2_1.u1); connect(ramp2.y, atan2_1.u2); end Atan2;

Buildings.Controls.OBC.CDL.Continuous.Validation.Average Buildings.Controls.OBC.CDL.Continuous.Validation.Average

Validation model for the Average block

Buildings.Controls.OBC.CDL.Continuous.Validation.Average

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Average.

The input u1 varies from -2.0 to +6.0, input u2 varies from +1.5 to +4.5

Modelica definition

model Average "Validation model for the Average block" Buildings.Controls.OBC.CDL.Continuous.Average avg1 "Block that outputs the average of its two inputs"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=1.5, height=3.0) "Block that generates ramp signal"; equation connect(ramp1.y, avg1.u1); connect(ramp2.y, avg1.u2); end Average;

Buildings.Controls.OBC.CDL.Continuous.Validation.ChangeSign Buildings.Controls.OBC.CDL.Continuous.Validation.ChangeSign

Validation model for the ChangeSign block

Buildings.Controls.OBC.CDL.Continuous.Validation.ChangeSign

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.ChangeSign.

The input u varies from -1.5 to +1.5.

Modelica definition

model ChangeSign "Validation model for the ChangeSign block" Buildings.Controls.OBC.CDL.Continuous.ChangeSign changSign "Block that change sign of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-1.5, height=3.0) "Block that generates ramp signal"; equation connect(ramp1.y, changSign.u); end ChangeSign;

Buildings.Controls.OBC.CDL.Continuous.Validation.Cos Buildings.Controls.OBC.CDL.Continuous.Validation.Cos

Validation model for the Cos block

Buildings.Controls.OBC.CDL.Continuous.Validation.Cos

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Cos.

The input u varies from 0.0 to +6.283.

Modelica definition

model Cos "Validation model for the Cos block" Buildings.Controls.OBC.CDL.Continuous.Cos cos1 "Block that outputs the cosine of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=0, height=6.283) "Block that generates ramp signal"; equation connect(ramp1.y, cos1.u); end Cos;

Buildings.Controls.OBC.CDL.Continuous.Validation.Derivative Buildings.Controls.OBC.CDL.Continuous.Validation.Derivative

Validation model for the Derivative block

Buildings.Controls.OBC.CDL.Continuous.Validation.Derivative

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Derivative.

The input u varies from 0.0 to +5*6.283.

Modelica definition

model Derivative "Validation model for the Derivative block" Buildings.Controls.OBC.CDL.Continuous.Cos cos1 "Block that outputs the cosine of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=6.283*5) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Derivative der1( initType=Buildings.Controls.OBC.CDL.Types.Init.InitialOutput); equation connect(ramp1.y, cos1.u); connect(cos1.y, der1.u); end Derivative;

Buildings.Controls.OBC.CDL.Continuous.Validation.Division Buildings.Controls.OBC.CDL.Continuous.Validation.Division

Validation model for the Division block

Buildings.Controls.OBC.CDL.Continuous.Validation.Division

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Division.

The input u1 varies from -2 to +2, input u2 varies from +1 to +3.

Modelica definition

model Division "Validation model for the Division block" Buildings.Controls.OBC.CDL.Continuous.Division div1 "Block that outputs first input divided by second input: u1/u2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( height=2, duration=1, offset=1) "Block that generates ramp signal"; equation connect(ramp1.y, div1.u1); connect(ramp2.y, div1.u2); end Division;

Buildings.Controls.OBC.CDL.Continuous.Validation.Exp Buildings.Controls.OBC.CDL.Continuous.Validation.Exp

Validation model for the Exp block

Buildings.Controls.OBC.CDL.Continuous.Validation.Exp

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Exp.

The input u varies from 0.0 to +2.

Modelica definition

model Exp "Validation model for the Exp block" Buildings.Controls.OBC.CDL.Continuous.Exp Exp1 "Block that outputs the exponential (base e) of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=0, height=2) "Block that generates ramp signal"; equation connect(ramp1.y, Exp1.u); end Exp;

Buildings.Controls.OBC.CDL.Continuous.Validation.Feedback Buildings.Controls.OBC.CDL.Continuous.Validation.Feedback

Validation model for the Feedback block

Buildings.Controls.OBC.CDL.Continuous.Validation.Feedback

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Feedback.

The input u1 varies from -2 to +2, input u2 varies from -1 to +1.

Modelica definition

model Feedback "Validation model for the Feedback block" Buildings.Controls.OBC.CDL.Continuous.Feedback feedback1 "Block that outputs difference between commanded and feedback input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-1, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( height=2, duration=1, offset=-1) "Block that generates ramp signal"; equation connect(ramp1.y, feedback1.u1); connect(ramp2.y, feedback1.u2); end Feedback;

Buildings.Controls.OBC.CDL.Continuous.Validation.Gain Buildings.Controls.OBC.CDL.Continuous.Validation.Gain

Validation model for the Gain block

Buildings.Controls.OBC.CDL.Continuous.Validation.Gain

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Gain.

The input u varies from 0.0 to +2.

Modelica definition

model Gain "Validation model for the Gain block" Buildings.Controls.OBC.CDL.Continuous.Gain gain1( k = 2.5) "Block that outputs the product of a gain value with the input signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=0, height=2) "Block that generates ramp signal"; equation connect(ramp1.y, gain1.u); end Gain;

Buildings.Controls.OBC.CDL.Continuous.Validation.Greater Buildings.Controls.OBC.CDL.Continuous.Validation.Greater

Validation model for the Greater block

Buildings.Controls.OBC.CDL.Continuous.Validation.Greater

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Greater.

Modelica definition

model Greater "Validation model for the Greater block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Greater greater1; equation connect(ramp1.y, greater1.u1); connect(ramp2.y, greater1.u2); end Greater;

Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqual Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqual

Validation model for the GreaterEqual block

Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqual

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.GreaterEqual.

Modelica definition

model GreaterEqual "Validation model for the GreaterEqual block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqual greEqu; equation connect(ramp1.y, greEqu.u1); connect(ramp2.y, greEqu.u2); end GreaterEqual;

Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqualThreshold Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqualThreshold

Validation model for the GreaterEqualThreshold block

Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterEqualThreshold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold.

Modelica definition

model GreaterEqualThreshold "Validation model for the GreaterEqualThreshold block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold greEquThr; equation connect(ramp2.y, greEquThr.u); end GreaterEqualThreshold;

Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterThreshold Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterThreshold

Validation model for the GreaterThreshold block

Buildings.Controls.OBC.CDL.Continuous.Validation.GreaterThreshold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold.

Modelica definition

model GreaterThreshold "Validation model for the GreaterThreshold block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr; equation connect(ramp2.y, greThr.u); end GreaterThreshold;

Buildings.Controls.OBC.CDL.Continuous.Validation.Hysteresis Buildings.Controls.OBC.CDL.Continuous.Validation.Hysteresis

Validation model for the Hysteresis block

Buildings.Controls.OBC.CDL.Continuous.Validation.Hysteresis

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Hysteresis.

Modelica definition

model Hysteresis "Validation model for the Hysteresis block" Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysteresis( final uLow=0, final uHigh=1) "Transform Real to Boolean signal with Hysteresis"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysteresis1( final uLow=0, final uHigh=1, final pre_y_start=true) "Transform Real to Boolean signal with Hysteresis"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysteresis2( final uLow=0 + 0.01, final uHigh=1 - 0.01) "Transform Real to Boolean signal with Hysteresis"; protected Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( final duration=1, final offset=0, final height=6.2831852) "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.Gain gain1( final k = 2.5) "Block that outputs the product of a gain value with the input signal"; Sources.Pulse pul( final amplitude=1, final period=0.1) "Pulse signal"; Sources.Pulse pul1( final amplitude=1, final period=0.1) "Pulse signal"; equation connect(ramp1.y, sin1.u); connect(sin1.y, gain1.u); connect(gain1.y, hysteresis.u); connect(hysteresis2.u, pul1.y); connect(pul.y, hysteresis1.u); end Hysteresis;

Buildings.Controls.OBC.CDL.Continuous.Validation.HysteresisWithHold Buildings.Controls.OBC.CDL.Continuous.Validation.HysteresisWithHold

Validation model for the HysteresisWithHold block

Buildings.Controls.OBC.CDL.Continuous.Validation.HysteresisWithHold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.HysteresisWithHold.

The hold durations are configured as follows:

Modelica definition

model HysteresisWithHold "Validation model for the HysteresisWithHold block" Modelica.Blocks.Sources.Sine pulse1( amplitude = 0.2, freqHz = 1/360); Buildings.Controls.OBC.CDL.Continuous.HysteresisWithHold noHold( trueHoldDuration = 0, falseHoldDuration = 0, uLow = 0.05, uHigh = 0.15) "No true/false hold"; Buildings.Controls.OBC.CDL.Continuous.HysteresisWithHold onHold_30s( trueHoldDuration = 30, falseHoldDuration = 30, uLow = 0.05, uHigh = 0.15) "On/off signal are hold for short period"; Buildings.Controls.OBC.CDL.Continuous.HysteresisWithHold offHold_300s( trueHoldDuration = 30, falseHoldDuration = 300, uLow = 0.05, uHigh = 0.15) "Off signal being hold even when it should be on"; Buildings.Controls.OBC.CDL.Continuous.HysteresisWithHold onHold_150s( trueHoldDuration = 150, falseHoldDuration = 30, uLow = 0.05, uHigh = 0.15) "On signal being hold even when it should be off."; equation connect(pulse1.y, onHold_150s.u); connect(pulse1.y, noHold.u); connect(pulse1.y, offHold_300s.u); connect(pulse1.y, onHold_30s.u); end HysteresisWithHold;

Buildings.Controls.OBC.CDL.Continuous.Validation.IntegratorWithReset Buildings.Controls.OBC.CDL.Continuous.Validation.IntegratorWithReset

Test model for integrator with reset

Buildings.Controls.OBC.CDL.Continuous.Validation.IntegratorWithReset

Information

This model tests the implementation of Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset with and without reset, and with different start values and reset values.

The integrator intWitRes1 is triggered by a sample trigger which becomes true at t=0, while intWitRes2 is triggered by a boolean pulse with is true at t=0. Hence, intWitRes1 starts with y(0)=y_reset while intWitRes2 starts with y(0)=y_start.

Modelica definition

model IntegratorWithReset "Test model for integrator with reset" Buildings.Controls.OBC.CDL.Continuous.Sources.Constant cons(k=10) "Constant as source term"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes1( y_start=5, reset=Types.Reset.Parameter, k=0.5, y_reset=2) "Integrator with reset"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes2( y_reset=10, y_start=-5, reset=Types.Reset.Input, k=0.5) "Integrator with reset and y_reset = 2"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booleanPulse(width=0.5, period=0.2) "Boolean pulse"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intNoReset( reset=Types.Reset.Disabled, k=0.5, y_start=1) "Integrator without reset"; Buildings.Controls.OBC.CDL.Logical.Sources.SampleTrigger sampleTrigger(period=0.2) "Sample trigger"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp( height=-1, duration=1, offset=-2) "Ramp as a source term"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intDef "Integrator with default values"; equation connect(cons.y, intWitRes1.u); connect(intNoReset.u, cons.y); connect(cons.y, intWitRes2.u); connect(sampleTrigger.y, intWitRes1.trigger); connect(booleanPulse.y, intWitRes2.trigger); connect(ramp.y, intWitRes2.y_reset_in); connect(cons.y, intDef.u); end IntegratorWithReset;

Buildings.Controls.OBC.CDL.Continuous.Validation.Less Buildings.Controls.OBC.CDL.Continuous.Validation.Less

Validation model for the Less block

Buildings.Controls.OBC.CDL.Continuous.Validation.Less

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Less.

Modelica definition

model Less "Validation model for the Less block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Less less1; equation connect(ramp1.y, less1.u1); connect(ramp2.y, less1.u2); end Less;

Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqual Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqual

Validation model for the LessEqual block

Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqual

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.LessEqual.

Modelica definition

model LessEqual "Validation model for the LessEqual block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.LessEqual lesEqu; equation connect(ramp1.y, lesEqu.u1); connect(ramp2.y, lesEqu.u2); end LessEqual;

Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqualThreshold Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqualThreshold

Validation model for the LessEqualThreshold block

Buildings.Controls.OBC.CDL.Continuous.Validation.LessEqualThreshold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.LessEqualThreshold.

Modelica definition

model LessEqualThreshold "Validation model for the LessEqualThreshold block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.LessEqualThreshold lesEquThr; equation connect(ramp1.y, lesEquThr.u); end LessEqualThreshold;

Buildings.Controls.OBC.CDL.Continuous.Validation.LessThreshold Buildings.Controls.OBC.CDL.Continuous.Validation.LessThreshold

Validation model for the LessThreshold block

Buildings.Controls.OBC.CDL.Continuous.Validation.LessThreshold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.LessThreshold.

Modelica definition

model LessThreshold "Validation model for the LessThreshold block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.LessEqualThreshold lesThr; equation connect(ramp1.y, lesThr.u); end LessThreshold;

Buildings.Controls.OBC.CDL.Continuous.Validation.LimPID Buildings.Controls.OBC.CDL.Continuous.Validation.LimPID

Test model for LimPID controller

Buildings.Controls.OBC.CDL.Continuous.Validation.LimPID

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.LimPID.

The model limPIDOri is the original implementation of the controller from the Modelica Standard Library. The models limPID is the implementations from the Buildings library.

Modelica definition

model LimPID "Test model for LimPID controller" Buildings.Controls.OBC.CDL.Continuous.Sources.Pulse pulse(period=0.25); Buildings.Controls.OBC.CDL.Continuous.LimPID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, Ti=1, Td=1, yMax=1, yMin=-1, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState); Buildings.Controls.OBC.CDL.Continuous.LimPID limPIDOri( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, Ti=1, Td=1, yMax=1, yMin=-1, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState); Buildings.Controls.OBC.CDL.Continuous.Sources.Constant const(k=0.5); Buildings.Controls.OBC.CDL.Continuous.LimPID limPI( Ti=1, Td=1, yMax=1, yMin=-1, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI); Buildings.Controls.OBC.CDL.Continuous.LimPID limPD( Ti=1, Td=1, yMax=1, yMin=-1, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PD); Buildings.Controls.OBC.CDL.Continuous.LimPID limP( Ti=1, Td=1, yMax=1, yMin=-1, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P); Buildings.Controls.OBC.CDL.Continuous.LimPID noLimPID( Ti=1, Td=1, yMax=1e15, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID); equation connect(pulse.y, limPID.u_s); connect(const.y, limPID.u_m); connect(pulse.y, limPIDOri.u_s); connect(const.y, limPIDOri.u_m); connect(const.y, limPI.u_m); connect(const.y, limPD.u_m); connect(pulse.y, limPI.u_s); connect(pulse.y, limPD.u_s); connect(pulse.y, limP.u_s); connect(pulse.y, noLimPID.u_s); connect(const.y, limP.u_m); connect(const.y, noLimPID.u_m); end LimPID;

Buildings.Controls.OBC.CDL.Continuous.Validation.Limiter Buildings.Controls.OBC.CDL.Continuous.Validation.Limiter

Validation model for the Limiter block

Buildings.Controls.OBC.CDL.Continuous.Validation.Limiter

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Limiter.

The input u varies from 0.0 to +2.

Modelica definition

model Limiter "Validation model for the Limiter block" Buildings.Controls.OBC.CDL.Continuous.Limiter limiter1( uMax = 2.5, uMin = 1.2) "Block that limit the range of a signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=0, height=4) "Block that generates ramp signal"; equation connect(ramp1.y, limiter1.u); end Limiter;

Buildings.Controls.OBC.CDL.Continuous.Validation.Line Buildings.Controls.OBC.CDL.Continuous.Validation.Line

Validation model for the Line block

Buildings.Controls.OBC.CDL.Continuous.Validation.Line

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Line.

The input u varies from 0.0 to +2.

The block outputs y = a + b u, where u is an input and the coefficients a and b are determined so that the line intercepts the two input points specified by the two points x1 and f1, and x2 and f2.

The parameters limitBelow and limitAbove determine whether x1 and x2 are also used to limit the input u.

Modelica definition

model Line "Validation model for the Line block" Buildings.Controls.OBC.CDL.Continuous.Line line1 "Block that out the value of the input x along a line specified by two points"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant x1( k = 1.0) "Block that generate x1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant f1(k=0.5) "Block that generate f(x1)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant x2( k = 2.0) "Block that generate x2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant f2(k=1.5) "Block that generate f(x2)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( offset=0, duration=0.5, startTime=0.25, height=3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Line line2( limitAbove=true, limitBelow=false) "Block that out the value of the input x along a line specified by two points"; Buildings.Controls.OBC.CDL.Continuous.Line line3( limitBelow=true, limitAbove=false) "Block that out the value of the input x along a line specified by two points"; equation connect(ramp1.y, line1.u); connect(f1.y, line1.f1); connect(x1.y, line1.x1); connect(x2.y, line1.x2); connect(f2.y, line1.f2); connect(ramp1.y,line2. u); connect(f1.y,line2. f1); connect(x1.y,line2. x1); connect(x2.y,line2. x2); connect(f2.y,line2. f2); connect(ramp1.y,line3. u); connect(f1.y,line3. f1); connect(x1.y,line3. x1); connect(x2.y,line3. x2); connect(f2.y,line3. f2); end Line;

Buildings.Controls.OBC.CDL.Continuous.Validation.Log Buildings.Controls.OBC.CDL.Continuous.Validation.Log

Validation model for the Log block

Buildings.Controls.OBC.CDL.Continuous.Validation.Log

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Log.

The input u varies from +1 to +6.

Modelica definition

model Log "Validation model for the Log block" Buildings.Controls.OBC.CDL.Continuous.Log log1 "Block that outputs the natural (base e) logarithm of the input (input > 0 required)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=1, height=5) "Block that generates ramp signal"; equation connect(ramp1.y, log1.u); end Log;

Buildings.Controls.OBC.CDL.Continuous.Validation.Log10 Buildings.Controls.OBC.CDL.Continuous.Validation.Log10

Validation model for the Log10 block

Buildings.Controls.OBC.CDL.Continuous.Validation.Log10

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Log10.

The input u varies from +1 to +10.

Modelica definition

model Log10 "Validation model for the Log10 block" Buildings.Controls.OBC.CDL.Continuous.Log10 log10_1 "Block that outputs the base 10 logarithm of the input (input > 0 required)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=1, height=9) "Block that generates ramp signal"; equation connect(ramp1.y, log10_1.u); end Log10;

Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixGain Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixGain

Validation model for the MatrixGain block

Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixGain

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MatrixGain.

The input vector output two identical values u[1] and u[2] that vary from 0.0 to +2.

Modelica definition

model MatrixGain "Validation model for the MatrixGain block" Buildings.Controls.OBC.CDL.Continuous.MatrixGain matGai( K=[1,0; 1,1; 1,2]) "Block that outputs the product of a matrix gain value with the input signal"; Buildings.Controls.OBC.CDL.Continuous.MatrixGain matGai1( K=[1,2; 3,4]) "Block that outputs the product of a matrix gain value with the input signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp( duration=1, offset=0, height=2) "Block that generates ramp signal"; Sources.Ramp ramp1( duration=1, offset=0, height=1) "Block that generates ramp signal"; Sources.Ramp ramp2( duration=1, offset=0, height=2) "Block that generates ramp signal"; equation connect(ramp2.y, matGai1.u[2]); connect(ramp1.y, matGai1.u[1]); connect(ramp.y, matGai.u[1]); connect(ramp.y, matGai.u[2]); end MatrixGain;

Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMax Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMax

Validation model for the MatrixMax block

Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMax

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MatrixMax.

Modelica definition

model MatrixMax "Validation model for the MatrixMax block" Sources.Constant con[3,3](k={{1,2,3},{6,4,2},{3,9,6}}) "Block that generates ramp signal"; Sources.Constant con1[2,3](k={{1,4,3},{2,2,6}}) "Block that generates ramp signal"; Sources.Constant con2[2,3](k={{1,2,3},{6,4,2}}) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.MatrixMax matMax( rowMax=false, nRow=3, nCol=3) "Matrix maximum"; Buildings.Controls.OBC.CDL.Continuous.MatrixMax matMax1( nCol=3, nRow=2) "Matrix maximum"; Buildings.Controls.OBC.CDL.Continuous.MatrixMax matMax2( nCol=3, nRow=2) "Matrix maximum"; equation connect(con.y,matMax. u); connect(con1.y,matMax1. u); connect(con2.y,matMax2. u); end MatrixMax;

Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMin Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMin

Validation model for the MatrixMin block

Buildings.Controls.OBC.CDL.Continuous.Validation.MatrixMin

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MatrixMin.

Modelica definition

model MatrixMin "Validation model for the MatrixMin block" Sources.Constant con[3,3](k={{-1,-2,-3},{-6,-4,-2},{-3,-9,-6}}) "Block that generates ramp signal"; Sources.Constant con1[2,3](k={{-1,-4,-3},{-2,-2,-6}}) "Block that generates ramp signal"; Sources.Constant con2[2,3](k={{-1,-2,-3},{-6,-4,-2}}) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.MatrixMin matMin( nRow=3, nCol=3, rowMin=false) "Matrix minimum"; Buildings.Controls.OBC.CDL.Continuous.MatrixMin matMin1( nCol=3, rowMin=false, nRow=2) "Matrix minimum"; Buildings.Controls.OBC.CDL.Continuous.MatrixMin matMin2( nCol=3, rowMin=true, nRow=2) "Matrix minimum"; equation connect(con.y, matMin.u); connect(con1.y, matMin1.u); connect(con2.y, matMin2.u); end MatrixMin;

Buildings.Controls.OBC.CDL.Continuous.Validation.Max Buildings.Controls.OBC.CDL.Continuous.Validation.Max

Validation model for the Max block

Buildings.Controls.OBC.CDL.Continuous.Validation.Max

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Max.

The input u1 varies from -2 to +2, input u2 varies from -1 to +1.

Modelica definition

model Max "Validation model for the Max block" Buildings.Controls.OBC.CDL.Continuous.Max max1 "Block that pass through the largest signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; equation connect(ramp1.y, max1.u1); connect(ramp2.y, max1.u2); end Max;

Buildings.Controls.OBC.CDL.Continuous.Validation.Min Buildings.Controls.OBC.CDL.Continuous.Validation.Min

Validation model for the Min block

Buildings.Controls.OBC.CDL.Continuous.Validation.Min

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Min.

The input u1 varies from -2 to +2, input u2 varies from -1 to +1.

Modelica definition

model Min "Validation model for the Min block" Buildings.Controls.OBC.CDL.Continuous.Min min1 "Block that pass through the smallest signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=2) "Block that generates ramp signal"; equation connect(ramp1.y, min1.u1); connect(ramp2.y, min1.u2); end Min;

Buildings.Controls.OBC.CDL.Continuous.Validation.Modulo Buildings.Controls.OBC.CDL.Continuous.Validation.Modulo

Validation model for the Modulo block

Buildings.Controls.OBC.CDL.Continuous.Validation.Modulo

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Modulo.

The input u1 varies from -2.0 to +6.0, input u2 varies from +1.5 to +4.5

Modelica definition

model Modulo "Validation model for the Modulo block" Buildings.Controls.OBC.CDL.Continuous.Modulo mod1 "Block that outputs the remainder of first input divided by second input (~=0)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=1.5, height=3.0) "Block that generates ramp signal"; equation connect(ramp1.y, mod1.u1); connect(ramp2.y, mod1.u2); end Modulo;

Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean

Validation model for the MovingMean block

Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MovingMean.

The input sinInpNoDel, sinInp50sDel, sinInp100sDel, generate sine outputs with same frequency of 1/80 Hz, but different start times of 0 second, 50 second, 100 second.

Modelica definition

model MovingMean "Validation model for the MovingMean block" Modelica.Blocks.Sources.Sine sinInpNoDel(freqHz=1/80) "Start from zero second"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_1(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_2(delta=200) "Moving average with 200 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_3(delta=300) "Moving average with 300 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_4(delta=400) "Moving average with 400 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_5(delta=500) "Moving average with 500 s sliding window"; Modelica.Blocks.Sources.Sine sinInp50sDel(freqHz=1/80, startTime=50) "Start from 50 seconds"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_6( delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_7( delta=200) "Moving average with 200 s sliding window"; Modelica.Blocks.Sources.Sine sinInp100sDel(freqHz=1/80, startTime=100) "Start from 100 seconds"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_8( delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_9( delta=200) "Moving average with 200 s sliding window"; equation connect(sinInpNoDel.y, movingMean_3.u); connect(sinInpNoDel.y, movingMean_1.u); connect(sinInpNoDel.y, movingMean_2.u); connect(sinInpNoDel.y, movingMean_5.u); connect(sinInpNoDel.y, movingMean_4.u); connect(sinInp50sDel.y, movingMean_6.u); connect(sinInp50sDel.y, movingMean_7.u); connect(sinInp100sDel.y, movingMean_9.u); connect(sinInp100sDel.y, movingMean_8.u); end MovingMean;

Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean_nonZeroStart Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean_nonZeroStart

Validation model for the MovingMean block

Buildings.Controls.OBC.CDL.Continuous.Validation.MovingMean_nonZeroStart

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MovingMean.

The inputs sinInpNoDel, sinInp50sDel and sinInp100sDel generate sine outputs with the same frequency of 1/80 Hertz, but different start times of 0 seconds, 50 seconds and 100 seconds.

Modelica definition

model MovingMean_nonZeroStart "Validation model for the MovingMean block" Modelica.Blocks.Sources.Sine sinInpNoDel(freqHz=1/80) "Start from zero second"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_1(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_2(delta=200) "Moving average with 200 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_3(delta=300) "Moving average with 300 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_4(delta=400) "Moving average with 400 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_5(delta=500) "Moving average with 500 s sliding window"; Modelica.Blocks.Sources.Sine sinInp50sDel(freqHz=1/80, startTime=50) "Start from 50 seconds"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_6( delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_7( delta=200) "Moving average with 200 s sliding window"; Modelica.Blocks.Sources.Sine sinInp100sDel(freqHz=1/80, startTime=100) "Start from 100 seconds"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_8( delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Continuous.MovingMean movingMean_9( delta=200) "Moving average with 200 s sliding window"; equation connect(sinInpNoDel.y, movingMean_3.u); connect(sinInpNoDel.y, movingMean_1.u); connect(sinInpNoDel.y, movingMean_2.u); connect(sinInpNoDel.y, movingMean_5.u); connect(sinInpNoDel.y, movingMean_4.u); connect(sinInp50sDel.y, movingMean_6.u); connect(sinInp50sDel.y, movingMean_7.u); connect(sinInp100sDel.y, movingMean_9.u); connect(sinInp100sDel.y, movingMean_8.u); end MovingMean_nonZeroStart;

Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMax Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMax

Validation model for the MultiMax block

Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMax

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MultiMax.

The input vectorcon has size 5 and its element values are {1,2,3,4,5}.

Parameters

TypeNameDefaultDescription
IntegersizOfVec5Size of the input vector

Modelica definition

model MultiMax "Validation model for the MultiMax block" parameter Integer sizOfVec = 5 "Size of the input vector"; Buildings.Controls.OBC.CDL.Continuous.MultiMax maxVal(nin=sizOfVec) "Block that outputs the maximum element of the input vector"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con[sizOfVec](k={1,2,3,4,5}) "Block that generates ramp signal"; equation connect(con.y,maxVal. u); end MultiMax;

Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMin Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMin

Validation model for the MultiMin block

Buildings.Controls.OBC.CDL.Continuous.Validation.MultiMin

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MultiMin.

The input vectorcon has size 5 and its element values are {1,2,3,4,5}.

Parameters

TypeNameDefaultDescription
IntegersizOfVec5Size of the input vector

Modelica definition

model MultiMin "Validation model for the MultiMin block" parameter Integer sizOfVec = 5 "Size of the input vector"; Buildings.Controls.OBC.CDL.Continuous.MultiMin minVal(nin=sizOfVec) "Block that outputs the minimum element of the input vector"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con[sizOfVec](k={1,2,3,4,5}) "Block that generates ramp signal"; equation for i in 1:sizOfVec loop connect(con[i].y,minVal. u[i]); end for; end MultiMin;

Buildings.Controls.OBC.CDL.Continuous.Validation.MultiSum Buildings.Controls.OBC.CDL.Continuous.Validation.MultiSum

Model to validate the application of MultiSum block

Buildings.Controls.OBC.CDL.Continuous.Validation.MultiSum

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.MultiSum.

The inputs and gains are configured as follows:

Modelica definition

model MultiSum "Model to validate the application of MultiSum block" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( height=2, duration=1, offset=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp3( height=3, duration=1, offset=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp4( height=3, duration=1, offset=-2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp5( height=3, duration=1, offset=-3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.MultiSum mulSum_5( nin=5, k={1,0.5,0.1,1,2}) "Sum of Reals, y = k[1]*u[1] + k[2]*u[2] + ... + k[5]*u[5]"; Buildings.Controls.OBC.CDL.Continuous.MultiSum mulSum_2( nin=2, k={1,0.5}) "Sum of Reals, y = k[1]*u[1] + k[2]*u[2]"; Buildings.Controls.OBC.CDL.Continuous.MultiSum mulSum_1( nin=1, k={1}) "Sum of Reals, y = k[1]*u[1]"; Buildings.Controls.OBC.CDL.Continuous.MultiSum mulSum_3(nin=3) "Sum of Reals, y = k[1]*u[1] + k[2]*u[2]"; equation connect(ramp1.y, mulSum_5.u[1]); connect(ramp2.y, mulSum_5.u[2]); connect(ramp3.y, mulSum_5.u[3]); connect(ramp4.y, mulSum_5.u[4]); connect(ramp5.y, mulSum_5.u[5]); connect(ramp1.y, mulSum_1.u[1]); connect(ramp1.y, mulSum_2.u[1]); connect(ramp2.y, mulSum_2.u[2]); connect(ramp4.y, mulSum_3.u[1]); connect(ramp5.y, mulSum_3.u[2]); connect(ramp5.y, mulSum_3.u[3]); end MultiSum;

Buildings.Controls.OBC.CDL.Continuous.Validation.NumberOfRequests Buildings.Controls.OBC.CDL.Continuous.Validation.NumberOfRequests

Validation model for the NumberOfRequests block

Buildings.Controls.OBC.CDL.Continuous.Validation.NumberOfRequests

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.NumberOfRequests.

The input u1 varies from -2 to +2, input u2 varies from -1 to +2, input u3 varies from +2 to -2, input u4 varies from +3 to +2, input u5 varies from 0 to +4,

Modelica definition

model NumberOfRequests "Validation model for the NumberOfRequests block" Buildings.Controls.OBC.CDL.Continuous.NumberOfRequests numReq1( nin = 5, threShold = 1.0, kind = 0) "Block that outputs the number of signals that are above/below a certain threshold"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp3( duration=1, height=3.5, offset=0.5) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp4( duration=1, offset=3, height=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp5( duration=1, offset=0, height=4) "Block that generates ramp signal"; equation connect(ramp1.y, numReq1.u[1]); connect(ramp2.y, numReq1.u[2]); connect(ramp3.y, numReq1.u[3]); connect(ramp4.y, numReq1.u[4]); connect(ramp5.y, numReq1.u[5]); end NumberOfRequests;

Buildings.Controls.OBC.CDL.Continuous.Validation.Product Buildings.Controls.OBC.CDL.Continuous.Validation.Product

Validation model for the Product block

Buildings.Controls.OBC.CDL.Continuous.Validation.Product

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Product.

The input u1 varies from -2 to +2, input u2 varies from -1 to +2.

Modelica definition

model Product "Validation model for the Product block" Buildings.Controls.OBC.CDL.Continuous.Product product1 "Block that outputs product of the two inputs"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=3) "Block that generates ramp signal"; equation connect(ramp1.y, product1.u1); connect(ramp2.y, product1.u2); end Product;

Buildings.Controls.OBC.CDL.Continuous.Validation.Round Buildings.Controls.OBC.CDL.Continuous.Validation.Round

Validation model for the Round block

Buildings.Controls.OBC.CDL.Continuous.Validation.Round

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Round.

The input u varies from -3.5 to +3.5.

Modelica definition

model Round "Validation model for the Round block" Buildings.Controls.OBC.CDL.Continuous.Round round1(n=0) "Round real number to given digits"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-3.5, height=7.0) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Round round2(n=1) "Round real number to given digits"; Buildings.Controls.OBC.CDL.Continuous.Round round3(n=-1) "Round real number to given digits"; Buildings.Controls.OBC.CDL.Continuous.Gain gai(k=0.1) "Gain"; Buildings.Controls.OBC.CDL.Continuous.Gain gai1(k=10) "Gain"; equation connect(ramp1.y,round1. u); connect(ramp1.y, gai.u); connect(round2.u, gai.y); connect(ramp1.y, gai1.u); connect(round3.u, gai1.y); end Round;

Buildings.Controls.OBC.CDL.Continuous.Validation.Sin Buildings.Controls.OBC.CDL.Continuous.Validation.Sin

Validation model for the Sin block

Buildings.Controls.OBC.CDL.Continuous.Validation.Sin

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sin.

The input u varies from 0.0 to +2π.

Modelica definition

model Sin "Validation model for the Sin block" Buildings.Controls.OBC.CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=0, height=6.2831852) "Block that generates ramp signal"; equation connect(ramp1.y, sin1.u); end Sin;

Buildings.Controls.OBC.CDL.Continuous.Validation.SlewRateLimiter Buildings.Controls.OBC.CDL.Continuous.Validation.SlewRateLimiter

Validation model for the SlewRateLimiter block

Buildings.Controls.OBC.CDL.Continuous.Validation.SlewRateLimiter

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.SlewRateLimiter.

The input ramp1.u varies from 0 to +1.5, in 1 s.

The increase and decrease rate limits are [increase/incDt, -decrease/decDt] , which is [1, -1] here.

Modelica definition

model SlewRateLimiter "Validation model for the SlewRateLimiter block" Buildings.Controls.OBC.CDL.Continuous.SlewRateLimiter sleRatLim( raisingSlewRate=1/30) "Block that limit the increase or decrease rate of input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( offset=0, height=1.5, duration=20, startTime=10) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( offset=0, height=-1.5, startTime=60, duration=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Add add "Signal adder"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp3( offset=0, height=-1.5, duration=30, startTime=120 + 60) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp4( offset=0, height=1.5, duration=30, startTime=120) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp5( offset=0, height=-1.5, startTime=240 + 60, duration=40) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp6( offset=0, height=1.5, startTime=240, duration=40) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Add add1 "Signal adder"; Buildings.Controls.OBC.CDL.Continuous.Add add2 "Signal adder"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp7( offset=0, height=-1.5, duration=50, startTime=360 + 60) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp8( offset=0, height=1.5, duration=50, startTime=360) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Add add3 "Signal adder"; Buildings.Controls.OBC.CDL.Continuous.Add add4 "Signal adder"; Buildings.Controls.OBC.CDL.Continuous.Add add5 "Signal adder"; Buildings.Controls.OBC.CDL.Continuous.Add add6 "Signal adder"; equation connect(ramp1.y, add.u1); connect(ramp2.y, add.u2); connect(ramp4.y, add1.u1); connect(ramp3.y, add1.u2); connect(ramp6.y, add2.u1); connect(ramp5.y, add2.u2); connect(ramp8.y,add3. u1); connect(ramp7.y,add3. u2); connect(add.y, add4.u1); connect(add1.y, add4.u2); connect(add2.y, add5.u1); connect(add3.y, add5.u2); connect(add4.y, add6.u1); connect(add5.y, add6.u2); connect(sleRatLim.u, add6.y); end SlewRateLimiter;

Buildings.Controls.OBC.CDL.Continuous.Validation.Sort Buildings.Controls.OBC.CDL.Continuous.Validation.Sort

Validation model for the Sort block

Buildings.Controls.OBC.CDL.Continuous.Validation.Sort

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sort.

The input u1 varies from -2 to +2, input u2 varies from -1 to +2, input u3 varies from +2 to -2, input u4 varies from +3 to +2, input u5 varies from 0 to +4,

Modelica definition

model Sort "Validation model for the Sort block" Buildings.Controls.OBC.CDL.Continuous.Sort sorAsc(nin=5) "Block that sorts signals in ascending order"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=1, offset=-1, height=3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp3( duration=1, offset=2, height=-4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp4( duration=1, offset=3, height=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp5( duration=1, offset=0, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sort sorDes(nin=5, ascending=false) "Block that sorts signals in ascending order"; equation connect(ramp1.y, sorAsc.u[1]); connect(ramp2.y, sorAsc.u[2]); connect(ramp3.y, sorAsc.u[3]); connect(ramp4.y, sorAsc.u[4]); connect(ramp5.y, sorAsc.u[5]); connect(ramp1.y, sorDes.u[1]); connect(ramp2.y, sorDes.u[2]); connect(ramp3.y, sorDes.u[3]); connect(ramp4.y, sorDes.u[4]); connect(ramp5.y, sorDes.u[5]); end Sort;

Buildings.Controls.OBC.CDL.Continuous.Validation.Sqrt Buildings.Controls.OBC.CDL.Continuous.Validation.Sqrt

Validation model for the Sqrt block

Buildings.Controls.OBC.CDL.Continuous.Validation.Sqrt

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sqrt.

The input u varies from 0.0 to +9.0.

Modelica definition

model Sqrt "Validation model for the Sqrt block" Buildings.Controls.OBC.CDL.Continuous.Sqrt sqrt1 "Block that outputs the square root of the input (input >= 0 required)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=0, height=9) "Block that generates ramp signal"; equation connect(ramp1.y, sqrt1.u); end Sqrt;

Buildings.Controls.OBC.CDL.Continuous.Validation.Tan Buildings.Controls.OBC.CDL.Continuous.Validation.Tan

Validation model for the Tan block

Buildings.Controls.OBC.CDL.Continuous.Validation.Tan

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Tan.

The input u varies from -1.5 to +1.5.

Modelica definition

model Tan "Validation model for the Tan block" Buildings.Controls.OBC.CDL.Continuous.Tan tan1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=1, offset=-1.5, height=3.0) "Block that generates ramp signal"; equation connect(ramp1.y, tan1.u); end Tan;