Buildings.Controls.OBC.CDL.Reals.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.Reals.

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.Reals.Validation.Abs Abs Validation model for the absolute block
Buildings.Controls.OBC.CDL.Reals.Validation.Acos Acos Validation model for the Acos block
Buildings.Controls.OBC.CDL.Reals.Validation.Add Add Validation model for the add block
Buildings.Controls.OBC.CDL.Reals.Validation.AddParameter AddParameter Validation model for the AddParameter block
Buildings.Controls.OBC.CDL.Reals.Validation.Asin Asin Validation model for the Asin block
Buildings.Controls.OBC.CDL.Reals.Validation.Atan Atan Validation model for the Atan block
Buildings.Controls.OBC.CDL.Reals.Validation.Atan2 Atan2 Validation model for the Atan2 block
Buildings.Controls.OBC.CDL.Reals.Validation.Average Average Validation model for the Average block
Buildings.Controls.OBC.CDL.Reals.Validation.Cos Cos Validation model for the Cos block
Buildings.Controls.OBC.CDL.Reals.Validation.Derivative Derivative Test model for the derivative block
Buildings.Controls.OBC.CDL.Reals.Validation.Divide Divide Validation model for the Divide block
Buildings.Controls.OBC.CDL.Reals.Validation.Exp Exp Validation model for the Exp block
Buildings.Controls.OBC.CDL.Reals.Validation.Greater Greater Validation model for the Greater block
Buildings.Controls.OBC.CDL.Reals.Validation.GreaterThreshold GreaterThreshold Validation model for the GreaterThreshold block
Buildings.Controls.OBC.CDL.Reals.Validation.Hysteresis Hysteresis Validation model for the Hysteresis block
Buildings.Controls.OBC.CDL.Reals.Validation.IntegratorWithReset IntegratorWithReset Test model for integrator with reset
Buildings.Controls.OBC.CDL.Reals.Validation.Less Less Validation model for the Less block
Buildings.Controls.OBC.CDL.Reals.Validation.LessThreshold LessThreshold Validation model for the LessThreshold block
Buildings.Controls.OBC.CDL.Reals.Validation.LimitSlewRate LimitSlewRate Validation model for the LimitSlewRate block
Buildings.Controls.OBC.CDL.Reals.Validation.Limiter Limiter Validation model for the Limiter block
Buildings.Controls.OBC.CDL.Reals.Validation.Line Line Validation model for the Line block
Buildings.Controls.OBC.CDL.Reals.Validation.Log Log Validation model for the Log block
Buildings.Controls.OBC.CDL.Reals.Validation.Log10 Log10 Validation model for the Log10 block
Buildings.Controls.OBC.CDL.Reals.Validation.MatrixGain MatrixGain Validation model for the MatrixGain block
Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMax MatrixMax Validation model for the MatrixMax block
Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMin MatrixMin Validation model for the MatrixMin block
Buildings.Controls.OBC.CDL.Reals.Validation.Max Max Validation model for the Max block
Buildings.Controls.OBC.CDL.Reals.Validation.Min Min Validation model for the Min block
Buildings.Controls.OBC.CDL.Reals.Validation.Modulo Modulo Validation model for the Modulo block
Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage MovingAverage Validation model for the MovingAverage block
Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage_nonZeroStart MovingAverage_nonZeroStart Validation model for the MovingAverage block
Buildings.Controls.OBC.CDL.Reals.Validation.MultiMax MultiMax Validation model for the MultiMax block
Buildings.Controls.OBC.CDL.Reals.Validation.MultiMin MultiMin Validation model for the MultiMin block
Buildings.Controls.OBC.CDL.Reals.Validation.MultiSum MultiSum Model to validate the application of MultiSum block
Buildings.Controls.OBC.CDL.Reals.Validation.Multiply Multiply Validation model for the Multiply block
Buildings.Controls.OBC.CDL.Reals.Validation.MultiplyByParameter MultiplyByParameter Validation model for the Gain block
Buildings.Controls.OBC.CDL.Reals.Validation.PID PID Test model for PID controller
Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialDerivativeOutput PIDInitialDerivativeOutput Test model for LimPID controller with initial output of the derivative term specified
Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialState PIDInitialState Test model for LimPID controller with initial state specified
Buildings.Controls.OBC.CDL.Reals.Validation.PIDScale PIDScale Test model for PID controller with scaling of the control error
Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithReset PIDWithReset Test model for LimPID controller with reset trigger
Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithResetScale PIDWithResetScale Test model for PID controller with reset and scaling of the control error
Buildings.Controls.OBC.CDL.Reals.Validation.Ramp Ramp Validation model for the Ramp block
Buildings.Controls.OBC.CDL.Reals.Validation.Round Round Validation model for the Round block
Buildings.Controls.OBC.CDL.Reals.Validation.Sin Sin Validation model for the Sin block
Buildings.Controls.OBC.CDL.Reals.Validation.Sort Sort Validation model for the Sort block
Buildings.Controls.OBC.CDL.Reals.Validation.Sqrt Sqrt Validation model for the Sqrt block
Buildings.Controls.OBC.CDL.Reals.Validation.Subtract Subtract Validation model for the Subtract block
Buildings.Controls.OBC.CDL.Reals.Validation.Switch Switch Validation model for the Switch block
Buildings.Controls.OBC.CDL.Reals.Validation.Tan Tan Validation model for the Tan block

Buildings.Controls.OBC.CDL.Reals.Validation.Abs Buildings.Controls.OBC.CDL.Reals.Validation.Abs

Validation model for the absolute block

Buildings.Controls.OBC.CDL.Reals.Validation.Abs

Information

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

Modelica definition

model Abs "Validation model for the absolute block" Buildings.Controls.OBC.CDL.Reals.Abs abs1 "Block that outputs the absolute value of the input"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Acos Buildings.Controls.OBC.CDL.Reals.Validation.Acos

Validation model for the Acos block

Buildings.Controls.OBC.CDL.Reals.Validation.Acos

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Acos.

The input u varies from -1 to +1.

Modelica definition

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

Buildings.Controls.OBC.CDL.Reals.Validation.Add Buildings.Controls.OBC.CDL.Reals.Validation.Add

Validation model for the add block

Buildings.Controls.OBC.CDL.Reals.Validation.Add

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Add add1 "Block that outputs the sum of the two inputs"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.AddParameter Buildings.Controls.OBC.CDL.Reals.Validation.AddParameter

Validation model for the AddParameter block

Buildings.Controls.OBC.CDL.Reals.Validation.AddParameter

Information

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

The input u varies from -2 to +2.

Modelica definition

model AddParameter "Validation model for the AddParameter block" Buildings.Controls.OBC.CDL.Reals.AddParameter addPar( p=0.5) "Block that outputs the sum of an input plus a parameter"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Asin Buildings.Controls.OBC.CDL.Reals.Validation.Asin

Validation model for the Asin block

Buildings.Controls.OBC.CDL.Reals.Validation.Asin

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Asin.

The input u varies from -1 to +1.

Modelica definition

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

Buildings.Controls.OBC.CDL.Reals.Validation.Atan Buildings.Controls.OBC.CDL.Reals.Validation.Atan

Validation model for the Atan block

Buildings.Controls.OBC.CDL.Reals.Validation.Atan

Information

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

The input u varies from -2 to +2.

Modelica definition

model Atan "Validation model for the Atan block" Buildings.Controls.OBC.CDL.Reals.Atan atan1 "Block that outputs the arc tangent of the input"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Atan2 Buildings.Controls.OBC.CDL.Reals.Validation.Atan2

Validation model for the Atan2 block

Buildings.Controls.OBC.CDL.Reals.Validation.Atan2

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Atan2 atan2_1 "Block that outputs atan(u1/u2) of the inputs u1 and u2"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Average Buildings.Controls.OBC.CDL.Reals.Validation.Average

Validation model for the Average block

Buildings.Controls.OBC.CDL.Reals.Validation.Average

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Average avg1 "Block that outputs the average of its two inputs"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Cos Buildings.Controls.OBC.CDL.Reals.Validation.Cos

Validation model for the Cos block

Buildings.Controls.OBC.CDL.Reals.Validation.Cos

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Cos cos1 "Block that outputs the cosine of the input"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Derivative Buildings.Controls.OBC.CDL.Reals.Validation.Derivative

Test model for the derivative block

Buildings.Controls.OBC.CDL.Reals.Validation.Derivative

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Derivative. The model integrates a time varying signal, and the differentiates this integrated signal. Hence, the output der1.y matches the non-integrated signal intWitRes.u, within a small approximation tolerance.

The instance der1 uses a varying input for T which controls the accuracy of the derivative approximation. At the start of the simulation, T is small and hence the output der1.y matches the signal intWitRes.u well. As expected, the approximation error increases with increasing der1.T.

The instance der2 uses a gain of 2, and it initializes the output to 0. Hence, there is a fast transient at the beginning, and afterwards the output matches der1.y = der2.y / 2.

Modelica definition

model Derivative "Test model for the derivative block" Buildings.Controls.OBC.CDL.Reals.Derivative der1(y_start=1) "Derivative block with input gains"; Reals.Sources.Constant con(k=1) "Outputs 1"; Reals.Sources.Ramp ram( height=0.09, duration=10, offset=0.01, startTime=5) "Ramp for time constant used in approximating derivative"; Buildings.Controls.OBC.CDL.Reals.Sources.CivilTime modTim "Civil time"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes(y_start=1) "Integration of input"; Logical.Sources.Constant booSig(k=false) "Contant boolean signal"; Buildings.Controls.OBC.CDL.Reals.Cos cos "Cosine of model time"; Buildings.Controls.OBC.CDL.Reals.Derivative der2(y_start=0) "Derivative block with input gains"; Reals.Sources.Constant con2(k=2) "Outputs 2"; Reals.Sources.Constant T(k=0.1) "Time constant for derivative approximation"; Utilities.Assert assMes(message="Differentiated value differs more than threshold") "Issue an error if results differ more than a threshold"; Buildings.Controls.OBC.CDL.Reals.Subtract sub "Difference between original signal, and differentiated integral of that signal"; Buildings.Controls.OBC.CDL.Reals.Abs abs "Absolute difference"; Buildings.Controls.OBC.CDL.Reals.LessThreshold lesThr(t=0.1, h=0.01) "Output true if difference is within expected accuracy"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(final k=1) "Dummy gain to avoid unit difference error"; equation connect(con.y, der1.k); connect(ram.y, der1.T); connect(intWitRes.y, der1.u); connect(booSig.y, intWitRes.trigger); connect(intWitRes.u, cos.y); connect(intWitRes.y_reset_in, cos.y); connect(intWitRes.y, der2.u); connect(con2.y, der2.k); connect(T.y, der2.T); connect(der1.y, sub.u1); connect(cos.y, sub.u2); connect(sub.y, abs.u); connect(abs.y, lesThr.u); connect(lesThr.y, assMes.u); connect(modTim.y, gai.u); connect(gai.y, cos.u); end Derivative;

Buildings.Controls.OBC.CDL.Reals.Validation.Divide Buildings.Controls.OBC.CDL.Reals.Validation.Divide

Validation model for the Divide block

Buildings.Controls.OBC.CDL.Reals.Validation.Divide

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Divide.

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

Modelica definition

model Divide "Validation model for the Divide block" Buildings.Controls.OBC.CDL.Reals.Divide div1 "Block that outputs first input divided by second input: u1/u2"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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 Divide;

Buildings.Controls.OBC.CDL.Reals.Validation.Exp Buildings.Controls.OBC.CDL.Reals.Validation.Exp

Validation model for the Exp block

Buildings.Controls.OBC.CDL.Reals.Validation.Exp

Information

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

The input u varies from 0.0 to +2.

Modelica definition

model Exp "Validation model for the Exp block" Buildings.Controls.OBC.CDL.Reals.Exp Exp1 "Block that outputs the exponential (base e) of the input"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Greater Buildings.Controls.OBC.CDL.Reals.Validation.Greater

Validation model for the Greater block

Buildings.Controls.OBC.CDL.Reals.Validation.Greater

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Greater. The instance gre has no hysteresis, and the instance greHys has a hysteresis.

Modelica definition

model Greater "Validation model for the Greater block" Buildings.Controls.OBC.CDL.Reals.Greater gre "Greater block, without hysteresis"; Buildings.Controls.OBC.CDL.Reals.Greater greHys(h=1) "Greater block, with hysteresis"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ram1( height=5, duration=10, offset=-1.5) "Ramp source"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin( amplitude=3, freqHz=1/10, offset=-2, startTime=1) "Sine source"; equation connect(ram1.y, gre.u2); connect(ram1.y, greHys.u2); connect(sin.y, gre.u1); connect(sin.y, greHys.u1); end Greater;

Buildings.Controls.OBC.CDL.Reals.Validation.GreaterThreshold Buildings.Controls.OBC.CDL.Reals.Validation.GreaterThreshold

Validation model for the GreaterThreshold block

Buildings.Controls.OBC.CDL.Reals.Validation.GreaterThreshold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.GreaterThreshold. The instance gre has no hysteresis, and the instance greHys has a hysteresis.

Modelica definition

model GreaterThreshold "Validation model for the GreaterThreshold block" Buildings.Controls.OBC.CDL.Reals.GreaterThreshold gre(t=2) "Greater block, without hysteresis"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greHys(t=2, h=1) "Greater block, with hysteresis"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin( amplitude=8, freqHz=1/10, offset=-2, startTime=1) "Sine source"; equation connect(sin.y, gre.u); connect(sin.y, greHys.u); end GreaterThreshold;

Buildings.Controls.OBC.CDL.Reals.Validation.Hysteresis Buildings.Controls.OBC.CDL.Reals.Validation.Hysteresis

Validation model for the Hysteresis block

Buildings.Controls.OBC.CDL.Reals.Validation.Hysteresis

Information

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

Modelica definition

model Hysteresis "Validation model for the Hysteresis block" Buildings.Controls.OBC.CDL.Reals.Hysteresis hysteresis( final uLow=0, final uHigh=1) "Transform Real to Boolean signal with Hysteresis"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hysteresis1( final uLow=0, final uHigh=1, final pre_y_start=true) "Transform Real to Boolean signal with Hysteresis"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hysteresis2( final uLow=0+0.01, final uHigh=1-0.01) "Transform Real to Boolean signal with Hysteresis"; protected Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( final duration=1, final offset=0, final height=6.2831852) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gain1( final k=2.5) "Block that outputs the product of a gain value with the input signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin( final amplitude=1, final freqHz=10) "Sine signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin2( final amplitude=1, final freqHz=5) "Sine signal"; equation connect(ramp1.y,sin1.u); connect(sin1.y,gain1.u); connect(gain1.y,hysteresis.u); connect(hysteresis2.u,sin2.y); connect(sin.y,hysteresis1.u); end Hysteresis;

Buildings.Controls.OBC.CDL.Reals.Validation.IntegratorWithReset Buildings.Controls.OBC.CDL.Reals.Validation.IntegratorWithReset

Test model for integrator with reset

Buildings.Controls.OBC.CDL.Reals.Validation.IntegratorWithReset

Information

This model tests the implementation of Buildings.Controls.OBC.CDL.Reals.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.Reals.IntegratorWithReset intDef(final y_start=-2) "Integrator with default values"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes1(final y_start=-2, final k=0.5) "Integrator with reset"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes2( final y_start=-5, final k=0.5) "Integrator with reset and y_reset = 2"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant cons( final k=10) "Constant as source term"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booleanPulse( final width=0.5, final period=0.2) "Boolean pulse"; Buildings.Controls.OBC.CDL.Logical.Sources.SampleTrigger sampleTrigger( final period=0.2) "Sample trigger"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp( final height=-1, final duration=1, final offset=-2) "Ramp as a source term"; equation connect(cons.y,intWitRes1.u); 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); connect(ramp.y,intWitRes1.y_reset_in); connect(ramp.y,intDef.y_reset_in); connect(sampleTrigger.y,intDef.trigger); end IntegratorWithReset;

Buildings.Controls.OBC.CDL.Reals.Validation.Less Buildings.Controls.OBC.CDL.Reals.Validation.Less

Validation model for the Less block

Buildings.Controls.OBC.CDL.Reals.Validation.Less

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Less. The instance les has no hysteresis, and the instance lesHys has a hysteresis.

Modelica definition

model Less "Validation model for the Less block" Buildings.Controls.OBC.CDL.Reals.Less les "Less block, without hysteresis"; Buildings.Controls.OBC.CDL.Reals.Less lesHys( h=1) "Less block, with hysteresis"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin( amplitude=3, freqHz=1/10, offset=-2, startTime=1) "Sine source"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ram1( height=5, duration=10, offset=-2) "Ramp source"; equation connect(sin.y, les.u1); connect(sin.y, lesHys.u1); connect(ram1.y, les.u2); connect(ram1.y, lesHys.u2); end Less;

Buildings.Controls.OBC.CDL.Reals.Validation.LessThreshold Buildings.Controls.OBC.CDL.Reals.Validation.LessThreshold

Validation model for the LessThreshold block

Buildings.Controls.OBC.CDL.Reals.Validation.LessThreshold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.LessThreshold. The instance les has no hysteresis, and the instance lesHys has a hysteresis.

Modelica definition

model LessThreshold "Validation model for the LessThreshold block" Buildings.Controls.OBC.CDL.Reals.LessThreshold les(t=2) "Less block, without hysteresis"; Buildings.Controls.OBC.CDL.Reals.LessThreshold lesHys(t=2, h=1) "Less block, with hysteresis"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin( amplitude=8, freqHz=1/10, offset=-2, startTime=1) "Sine source"; equation connect(sin.y, les.u); connect(sin.y, lesHys.u); end LessThreshold;

Buildings.Controls.OBC.CDL.Reals.Validation.LimitSlewRate Buildings.Controls.OBC.CDL.Reals.Validation.LimitSlewRate

Validation model for the LimitSlewRate block

Buildings.Controls.OBC.CDL.Reals.Validation.LimitSlewRate

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.LimitSlewRate.

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 LimitSlewRate "Validation model for the LimitSlewRate block" Buildings.Controls.OBC.CDL.Reals.LimitSlewRate sleRatLim( raisingSlewRate=1/30) "Block that limit the increase or decrease rate of input"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( offset=0, height=1.5, duration=20, startTime=10) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( offset=0, height=-1.5, startTime=60, duration=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Add add "Signal adder"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp3( offset=0, height=-1.5, duration=30, startTime=120+60) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp4( offset=0, height=1.5, duration=30, startTime=120) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp5( offset=0, height=-1.5, startTime=240+60, duration=40) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp6( offset=0, height=1.5, startTime=240, duration=40) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Add add1 "Signal adder"; Buildings.Controls.OBC.CDL.Reals.Add add2 "Signal adder"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp7( offset=0, height=-1.5, duration=50, startTime=360+60) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp8( offset=0, height=1.5, duration=50, startTime=360) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Add add3 "Signal adder"; Buildings.Controls.OBC.CDL.Reals.Add add4 "Signal adder"; Buildings.Controls.OBC.CDL.Reals.Add add5 "Signal adder"; Buildings.Controls.OBC.CDL.Reals.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 LimitSlewRate;

Buildings.Controls.OBC.CDL.Reals.Validation.Limiter Buildings.Controls.OBC.CDL.Reals.Validation.Limiter

Validation model for the Limiter block

Buildings.Controls.OBC.CDL.Reals.Validation.Limiter

Information

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

The input u varies from 0.0 to +2.

Modelica definition

model Limiter "Validation model for the Limiter block" Buildings.Controls.OBC.CDL.Reals.Limiter limiter1( uMax=2.5, uMin=1.2) "Block that limit the range of a signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Line Buildings.Controls.OBC.CDL.Reals.Validation.Line

Validation model for the Line block

Buildings.Controls.OBC.CDL.Reals.Validation.Line

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Line line1 "Block that out the value of the input x along a line specified by two points"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant x1( k=1.0) "Block that generate x1"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant f1( k=0.5) "Block that generate f(x1)"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant x2( k=2.0) "Block that generate x2"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant f2( k=1.5) "Block that generate f(x2)"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( offset=0, duration=0.5, startTime=0.25, height=3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.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.Reals.Validation.Log Buildings.Controls.OBC.CDL.Reals.Validation.Log

Validation model for the Log block

Buildings.Controls.OBC.CDL.Reals.Validation.Log

Information

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

The input u varies from +1 to +6.

Modelica definition

model Log "Validation model for the Log block" Buildings.Controls.OBC.CDL.Reals.Log log1 "Block that outputs the natural (base e) logarithm of the input (input > 0 required)"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Log10 Buildings.Controls.OBC.CDL.Reals.Validation.Log10

Validation model for the Log10 block

Buildings.Controls.OBC.CDL.Reals.Validation.Log10

Information

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

The input u varies from +1 to +10.

Modelica definition

model Log10 "Validation model for the Log10 block" Buildings.Controls.OBC.CDL.Reals.Log10 log10_1 "Block that outputs the base 10 logarithm of the input (input > 0 required)"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.MatrixGain Buildings.Controls.OBC.CDL.Reals.Validation.MatrixGain

Validation model for the MatrixGain block

Buildings.Controls.OBC.CDL.Reals.Validation.MatrixGain

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.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.Reals.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.Reals.Sources.Ramp ramp( duration=1, offset=0, height=2) "Block that generates ramp signal"; Reals.Sources.Ramp ramp1( duration=1, offset=0, height=1) "Block that generates ramp signal"; Reals.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.Reals.Validation.MatrixMax Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMax

Validation model for the MatrixMax block

Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMax

Information

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

Modelica definition

model MatrixMax "Validation model for the MatrixMax block" Reals.Sources.Constant con[3,3]( k={{1,2,3},{6,4,2},{3,9,6}}) "Block that generates ramp signal"; Reals.Sources.Constant con1[2,3]( k={{1,4,3},{2,2,6}}) "Block that generates ramp signal"; Reals.Sources.Constant con2[2,3]( k={{1,2,3},{6,4,2}}) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.MatrixMax matMax( rowMax=false, nRow=3, nCol=3) "Matrix maximum"; Buildings.Controls.OBC.CDL.Reals.MatrixMax matMax1( nCol=3, nRow=2) "Matrix maximum"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.MatrixMin Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMin

Validation model for the MatrixMin block

Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMin

Information

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

Modelica definition

model MatrixMin "Validation model for the MatrixMin block" Reals.Sources.Constant con[3,3]( k={{-1,-2,-3},{-6,-4,-2},{-3,-9,-6}}) "Block that generates ramp signal"; Reals.Sources.Constant con1[2,3]( k={{-1,-4,-3},{-2,-2,-6}}) "Block that generates ramp signal"; Reals.Sources.Constant con2[2,3]( k={{-1,-2,-3},{-6,-4,-2}}) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.MatrixMin matMin( nRow=3, nCol=3, rowMin=false) "Matrix minimum"; Buildings.Controls.OBC.CDL.Reals.MatrixMin matMin1( nCol=3, rowMin=false, nRow=2) "Matrix minimum"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Max Buildings.Controls.OBC.CDL.Reals.Validation.Max

Validation model for the Max block

Buildings.Controls.OBC.CDL.Reals.Validation.Max

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Max max1 "Block that pass through the largest signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Min Buildings.Controls.OBC.CDL.Reals.Validation.Min

Validation model for the Min block

Buildings.Controls.OBC.CDL.Reals.Validation.Min

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Min min1 "Block that pass through the smallest signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Modulo Buildings.Controls.OBC.CDL.Reals.Validation.Modulo

Validation model for the Modulo block

Buildings.Controls.OBC.CDL.Reals.Validation.Modulo

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Modulo mod1 "Block that outputs the remainder of first input divided by second input (~=0)"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.MovingAverage Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage

Validation model for the MovingAverage block

Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.MovingAverage.

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 MovingAverage "Validation model for the MovingAverage block" Buildings.Controls.OBC.CDL.Reals.Sources.Sin sinInpNoDel( freqHz=1/80) "Start from zero second"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve1(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve2(delta=200) "Moving average with 200 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve3(delta=300) "Moving average with 300 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve4(delta=400) "Moving average with 400 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve5(delta=500) "Moving average with 500 s sliding window"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sinInp50sDel( freqHz=1/80, startTime=50) "Start from 50 seconds"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve6(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve7(delta=200) "Moving average with 200 s sliding window"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sinInp100sDel( freqHz=1/80, startTime=100) "Start from 100 seconds"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve8(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve9(delta=200) "Moving average with 200 s sliding window"; equation connect(sinInpNoDel.y,movAve3.u); connect(sinInpNoDel.y,movAve1.u); connect(sinInpNoDel.y,movAve2.u); connect(sinInpNoDel.y,movAve5.u); connect(sinInpNoDel.y,movAve4.u); connect(sinInp50sDel.y,movAve6.u); connect(sinInp50sDel.y,movAve7.u); connect(sinInp100sDel.y,movAve9.u); connect(sinInp100sDel.y,movAve8.u); end MovingAverage;

Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage_nonZeroStart Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage_nonZeroStart

Validation model for the MovingAverage block

Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage_nonZeroStart

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.MovingAverage.

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 MovingAverage_nonZeroStart "Validation model for the MovingAverage block" Modelica.Blocks.Sources.Sine sinInpNoDel(f=1/80) "Start from zero second"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve1(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve2(delta=200) "Moving average with 200 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve3(delta=300) "Moving average with 300 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve4(delta=400) "Moving average with 400 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve5(delta=500) "Moving average with 500 s sliding window"; Modelica.Blocks.Sources.Sine sinInp50sDel(f=1/80, startTime=50) "Start from 50 seconds"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve6(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve7(delta=200) "Moving average with 200 s sliding window"; Modelica.Blocks.Sources.Sine sinInp100sDel(f=1/80, startTime=100) "Start from 100 seconds"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve8(delta=100) "Moving average with 100 s sliding window"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve9(delta=200) "Moving average with 200 s sliding window"; equation connect(sinInpNoDel.y,movAve3.u); connect(sinInpNoDel.y,movAve1.u); connect(sinInpNoDel.y,movAve2.u); connect(sinInpNoDel.y,movAve5.u); connect(sinInpNoDel.y,movAve4.u); connect(sinInp50sDel.y,movAve6.u); connect(sinInp50sDel.y,movAve7.u); connect(sinInp100sDel.y,movAve9.u); connect(sinInp100sDel.y,movAve8.u); end MovingAverage_nonZeroStart;

Buildings.Controls.OBC.CDL.Reals.Validation.MultiMax Buildings.Controls.OBC.CDL.Reals.Validation.MultiMax

Validation model for the MultiMax block

Buildings.Controls.OBC.CDL.Reals.Validation.MultiMax

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.MultiMax maxVal( nin=sizOfVec) "Block that outputs the maximum element of the input vector"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.MultiMin Buildings.Controls.OBC.CDL.Reals.Validation.MultiMin

Validation model for the MultiMin block

Buildings.Controls.OBC.CDL.Reals.Validation.MultiMin

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.MultiMin minVal( nin=sizOfVec) "Block that outputs the minimum element of the input vector"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.MultiSum Buildings.Controls.OBC.CDL.Reals.Validation.MultiSum

Model to validate the application of MultiSum block

Buildings.Controls.OBC.CDL.Reals.Validation.MultiSum

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( height=2, duration=1, offset=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp3( height=3, duration=1, offset=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp4( height=3, duration=1, offset=-2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp5( height=3, duration=1, offset=-3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.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.Reals.MultiSum mulSum_1( nin=1, k={1}) "Sum of Reals, y = k[1]*u[1]"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Multiply Buildings.Controls.OBC.CDL.Reals.Validation.Multiply

Validation model for the Multiply block

Buildings.Controls.OBC.CDL.Reals.Validation.Multiply

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Multiply.

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

Modelica definition

model Multiply "Validation model for the Multiply block" Buildings.Controls.OBC.CDL.Reals.Multiply product1 "Block that outputs product of the two inputs"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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 Multiply;

Buildings.Controls.OBC.CDL.Reals.Validation.MultiplyByParameter Buildings.Controls.OBC.CDL.Reals.Validation.MultiplyByParameter

Validation model for the Gain block

Buildings.Controls.OBC.CDL.Reals.Validation.MultiplyByParameter

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter.

The input u varies from 0.0 to +2.

Modelica definition

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

Buildings.Controls.OBC.CDL.Reals.Validation.PID Buildings.Controls.OBC.CDL.Reals.Validation.PID

Test model for PID controller

Buildings.Controls.OBC.CDL.Reals.Validation.PID

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID. This tests the different settings for the controller types.

Modelica definition

model PID "Test model for PID controller" Buildings.Controls.OBC.CDL.Reals.Sources.Pulse pulse( period=0.25) "Setpoint"; Buildings.Controls.OBC.CDL.Reals.PID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, Ti=1, Td=1, yMin=-1) "PID controller"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant const( k=0.5) "Measurement data"; Buildings.Controls.OBC.CDL.Reals.PID limPI( Ti=1, Td=1, yMin=-1, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI) "PI controller"; Buildings.Controls.OBC.CDL.Reals.PID limPD( Ti=1, Td=1, yMin=-1, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PD) "PD controller"; Buildings.Controls.OBC.CDL.Reals.PID limP( Ti=1, Td=1, yMin=-1, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P) "P controller"; Buildings.Controls.OBC.CDL.Reals.PID noLimPID( Ti=1, Td=1, yMax=1e15, yMin=-1e15, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID) "PID controller with no output limit"; equation connect(pulse.y,limPID.u_s); connect(const.y,limPID.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 PID;

Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialDerivativeOutput Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialDerivativeOutput

Test model for LimPID controller with initial output of the derivative term specified

Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialDerivativeOutput

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID.

This model validates setting the initial output of the controller to a specified value. Note that the control error must be zero for the initial output to be at the specified value. See the description of Buildings.Controls.OBC.CDL.Reals.PID.

Modelica definition

model PIDInitialDerivativeOutput "Test model for LimPID controller with initial output of the derivative term specified" Buildings.Controls.OBC.CDL.Reals.Sources.Constant ySet( k=0.75) "Set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant yMea( k=0.75) "Measured value"; Buildings.Controls.OBC.CDL.Reals.PID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=3, yd_start=0.2) "PID controller"; Buildings.Controls.OBC.CDL.Reals.PID limPD( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PD, k=3, yd_start=0.2) "PD controller"; equation connect(ySet.y,limPID.u_s); connect(ySet.y,limPD.u_s); connect(yMea.y,limPID.u_m); connect(yMea.y,limPD.u_m); end PIDInitialDerivativeOutput;

Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialState Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialState

Test model for LimPID controller with initial state specified

Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialState

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID.

This model validates setting the initial state of the controller to a specified value.

The model sets the initial values xi_start=0.25 of the integrator for both instances of the controller. For the instance limPID, it also sets the initial value of the state of the derivative block xd_start=-0.5. The derivative block obtains as an input signal the value u=-0.5 because the set point weight for the derivative action is wd=0. Therefore, an initial state of x(t0)=-0.5 causes the state of the derivative block to be at steady-state, because dx(t)/dt = (u - x)/T.

Modelica definition

model PIDInitialState "Test model for LimPID controller with initial state specified" Buildings.Controls.OBC.CDL.Reals.Sources.Constant ySet( k=0.75) "Set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant yMea( k=0.5) "Measured value"; Buildings.Controls.OBC.CDL.Reals.PID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=3, xi_start=0.25) "PID controller"; Buildings.Controls.OBC.CDL.Reals.PID limPI( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, k=3, xi_start=0.25) "PI controller"; equation connect(ySet.y,limPID.u_s); connect(ySet.y,limPI.u_s); connect(yMea.y,limPID.u_m); connect(yMea.y,limPI.u_m); end PIDInitialState;

Buildings.Controls.OBC.CDL.Reals.Validation.PIDScale Buildings.Controls.OBC.CDL.Reals.Validation.PIDScale

Test model for PID controller with scaling of the control error

Buildings.Controls.OBC.CDL.Reals.Validation.PIDScale

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID with and without setting of the parameter that scales the control error.

The test has two combinations of a PID controller and a plant. In PIDSca, the control error is scaled inside the controller, whereas in the configuration that has PIDNoSca, the setpoint signal and the measurement signal is scaled outside of the controller. Both controllers and plants have the same trajectory, thereby validating that the scaling is implemented correctly.

Modelica definition

model PIDScale "Test model for PID controller with scaling of the control error" Buildings.Controls.OBC.CDL.Reals.Sources.Pulse pulse( amplitude=1000, period=50) "Setpoint"; Buildings.Controls.OBC.CDL.Reals.PID pidSca( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=2, Ti=1, Td=2, r=1000, yMin=-1) "PID controller with scaling of control input"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset pla1( k=1000) "Plant model"; Reals.Sources.Constant resVal( k=0) "Reset value"; Logical.Sources.Constant resSig( k=false) "Reset signal"; Buildings.Controls.OBC.CDL.Reals.PID pidNoSca( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=2, Ti=1, Td=2, yMin=-1) "PID controller without scaling of control input"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=1/1000) "Gain to scale setpoint"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(k=1/1000) "Gain to scale measured value"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset pla2( k=1000) "Plant model"; equation connect(pulse.y,pidSca.u_s); connect(pla1.u,pidSca.y); connect(pla1.y,pidSca.u_m); connect(resVal.y,pla1.y_reset_in); connect(resSig.y,pla1.trigger); connect(gai.y,pidNoSca.u_s); connect(gai.u,pulse.y); connect(pidNoSca.y,pla2.u); connect(pla2.y,gai1.u); connect(gai1.y,pidNoSca.u_m); connect(pla2.y_reset_in,resVal.y); connect(resSig.y,pla2.trigger); end PIDScale;

Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithReset Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithReset

Test model for LimPID controller with reset trigger

Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithReset

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID.

This model validates the controller for different settings of the control output reset.

Modelica definition

model PIDWithReset "Test model for LimPID controller with reset trigger" Buildings.Controls.OBC.CDL.Conversions.BooleanToReal setPoi "Set point"; Buildings.Controls.OBC.CDL.Reals.Sources.CivilTime modTim "Civil time"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greEquThr( t=1) "Outputs true after t=1"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset limPIDPar( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=1, Ti=1, Td=1, yMin=-1, y_reset=0.5) "Controller, reset to parameter value"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes1 "Integrator whose output should be brought to the set point"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset limPIDInp( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=1, Ti=1, Td=1, yMin=-1, y_reset=0.75) "Controller, reset to input value"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes2 "Integrator whose output should be brought to the set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant resVal( k=0) "Reset value"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset limPIPar( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, k=1, Ti=1, Td=1, yMin=-1, y_reset=0.5) "Controller, reset to parameter value"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes3 "Integrator whose output should be brought to the set point"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset limPIInp( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, k=1, Ti=1, Td=1, yMin=-1, y_reset=0.75) "Controller, reset to input value"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset intWitRes4 "Integrator whose output should be brought to the set point"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con( final k=false) "Constant false"; equation connect(limPIDPar.u_s,setPoi.y); connect(intWitRes1.u,limPIDPar.y); connect(intWitRes1.y,limPIDPar.u_m); connect(modTim.y,greEquThr.u); connect(greEquThr.y,setPoi.u); connect(greEquThr.y,limPIDPar.trigger); connect(intWitRes2.u,limPIDInp.y); connect(intWitRes2.y,limPIDInp.u_m); connect(limPIDInp.u_s,setPoi.y); connect(limPIPar.u_s,setPoi.y); connect(intWitRes3.u,limPIPar.y); connect(intWitRes3.y,limPIPar.u_m); connect(greEquThr.y,limPIPar.trigger); connect(intWitRes4.u,limPIInp.y); connect(intWitRes4.y,limPIInp.u_m); connect(limPIInp.u_s,setPoi.y); connect(greEquThr.y,limPIInp.trigger); connect(limPIDInp.trigger,greEquThr.y); connect(resVal.y,intWitRes1.y_reset_in); connect(resVal.y,intWitRes2.y_reset_in); connect(resVal.y,intWitRes3.y_reset_in); connect(resVal.y,intWitRes4.y_reset_in); connect(con.y,intWitRes1.trigger); connect(con.y,intWitRes2.trigger); connect(con.y,intWitRes3.trigger); connect(con.y,intWitRes4.trigger); end PIDWithReset;

Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithResetScale Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithResetScale

Test model for PID controller with reset and scaling of the control error

Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithResetScale

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.PIDWithReset with and without setting of the parameter that scales the control error.

The test has two combinations of a PID controller and a plant. In PIDSca, the control error is scaled inside the controller, whereas in the configuration that has PIDNoSca, the setpoint signal and the measurement signal is scaled outside of the controller. Both controllers and plants have the same trajectory, thereby validating that the scaling is implemented correctly.

Modelica definition

model PIDWithResetScale "Test model for PID controller with reset and scaling of the control error" Buildings.Controls.OBC.CDL.Reals.Sources.Pulse pulse( amplitude=1000, period=50) "Setpoint"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset pidSca( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=2, Ti=1, Td=2, r=1000, yMin=-1, y_reset=0) "PID controller with scaling of control input"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset pla1( k=1000) "Plant model"; Reals.Sources.Constant resVal( k=0) "Reset value"; Logical.Sources.Constant resSig( k=false) "Reset signal"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset pidNoSca( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=2, Ti=1, Td=2, yMin=-1, y_reset=0) "PID controller without scaling of control input"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=1/1000) "Gain to scale setpoint"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(k=1/1000) "Gain to scale measured value"; Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset pla2( k=1000) "Plant model"; Logical.Sources.Pulse booPul( period=30) "Pulse for controller reset"; equation connect(pulse.y,pidSca.u_s); connect(pla1.u,pidSca.y); connect(pla1.y,pidSca.u_m); connect(resVal.y,pla1.y_reset_in); connect(resSig.y,pla1.trigger); connect(gai.y,pidNoSca.u_s); connect(gai.u,pulse.y); connect(pidNoSca.y,pla2.u); connect(pla2.y,gai1.u); connect(gai1.y,pidNoSca.u_m); connect(pla2.y_reset_in,resVal.y); connect(resSig.y,pla2.trigger); connect(booPul.y,pidSca.trigger); connect(booPul.y,pidNoSca.trigger); end PIDWithResetScale;

Buildings.Controls.OBC.CDL.Reals.Validation.Ramp Buildings.Controls.OBC.CDL.Reals.Validation.Ramp

Validation model for the Ramp block

Buildings.Controls.OBC.CDL.Reals.Validation.Ramp

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Ramp.

Modelica definition

model Ramp "Validation model for the Ramp block" Buildings.Controls.OBC.CDL.Reals.Ramp ramUp( final raisingSlewRate=1/20) "Ramp the input increasing"; Buildings.Controls.OBC.CDL.Reals.Ramp ramUp1( final raisingSlewRate=1/10) "Ramp the input increasing in different speed"; Buildings.Controls.OBC.CDL.Reals.Ramp ramUpDow( final raisingSlewRate=1/5) "Limit the increase and decrease of the input if the active is true"; Buildings.Controls.OBC.CDL.Reals.Ramp ramUpDow1( final raisingSlewRate=1/5, final fallingSlewRate=-1/2) "Different increase and decrease slew rate limits"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( final width=0.9, final period=12, final shift=1) "Boolean pulse"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse pul( final width=0.8, final period=12.0, final shift=2.0) "Boolean pulse"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2( final width=0.9, final period=12, final shift=2) "Boolean pulse"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse pul1( final width=0.2, final period=12.0, final shift=1.5) "Boolean pulse"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse pul2( final width=0.3, final period=12.0, final shift=3.0) "Boolean pulse"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5( final width=0.9, final period=12, final shift=1) "Boolean pulse"; equation connect(booPul2.y, ramUpDow.active); connect(booPul5.y, ramUpDow1.active); connect(pul.y, ramUp.u); connect(pul.y, ramUp1.u); connect(booPul1.y, ramUp.active); connect(booPul1.y, ramUp1.active); connect(pul1.y, ramUpDow.u); connect(pul2.y, ramUpDow1.u); end Ramp;

Buildings.Controls.OBC.CDL.Reals.Validation.Round Buildings.Controls.OBC.CDL.Reals.Validation.Round

Validation model for the Round block

Buildings.Controls.OBC.CDL.Reals.Validation.Round

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Round round1( n=0) "Round real number to given digits"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-3.5, height=7.0) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Round round2( n=1) "Round real number to given digits"; Buildings.Controls.OBC.CDL.Reals.Round round3( n=-1) "Round real number to given digits"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=0.1) "Gain"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter 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.Reals.Validation.Sin Buildings.Controls.OBC.CDL.Reals.Validation.Sin

Validation model for the Sin block

Buildings.Controls.OBC.CDL.Reals.Validation.Sin

Information

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

The input u varies from 0.0 to +2π.

Modelica definition

model Sin "Validation model for the Sin block" Buildings.Controls.OBC.CDL.Reals.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Sort Buildings.Controls.OBC.CDL.Reals.Validation.Sort

Validation model for the Sort block

Buildings.Controls.OBC.CDL.Reals.Validation.Sort

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Sort sorAsc( nin=5) "Block that sorts signals in ascending order"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-2, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( duration=1, offset=-1, height=3) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp3( duration=1, offset=2, height=-4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp4( duration=1, offset=3, height=-1) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp5( duration=1, offset=0, height=4) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Sqrt Buildings.Controls.OBC.CDL.Reals.Validation.Sqrt

Validation model for the Sqrt block

Buildings.Controls.OBC.CDL.Reals.Validation.Sqrt

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Sqrt sqrt1 "Block that outputs the square root of the input (input >= 0 required)"; Buildings.Controls.OBC.CDL.Reals.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.Reals.Validation.Subtract Buildings.Controls.OBC.CDL.Reals.Validation.Subtract

Validation model for the Subtract block

Buildings.Controls.OBC.CDL.Reals.Validation.Subtract

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Subtract.

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

Modelica definition

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

Buildings.Controls.OBC.CDL.Reals.Validation.Switch Buildings.Controls.OBC.CDL.Reals.Validation.Switch

Validation model for the Switch block

Buildings.Controls.OBC.CDL.Reals.Validation.Switch

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.Switch.

Modelica definition

model Switch "Validation model for the Switch block" Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=5, offset=-1, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp2( duration=5, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Reals.Switch switch1 "Switch between two real inputs"; equation connect(booPul.y,switch1.u2); connect(ramp2.y,switch1.u3); connect(ramp1.y,switch1.u1); end Switch;

Buildings.Controls.OBC.CDL.Reals.Validation.Tan Buildings.Controls.OBC.CDL.Reals.Validation.Tan

Validation model for the Tan block

Buildings.Controls.OBC.CDL.Reals.Validation.Tan

Information

Validation test for the block Buildings.Controls.OBC.CDL.Reals.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.Reals.Tan tan1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp ramp1( duration=1, offset=-1.5, height=3.0) "Block that generates ramp signal"; equation connect(ramp1.y,tan1.u); end Tan;