Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation

Collection of validation models

Information

This package contains validation models for the classes in Buildings.Obsolete.Controls.OBC.CDL.Continuous.

Note that most validation models contain simple input data which may not be realistic, but for which the correct output can be obtained through an analytic solution. The examples plot various outputs, which have been verified against these solutions. These model outputs are stored as reference data and used for continuous validation whenever models in the library change.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.ChangeSign ChangeSign Validation model for the ChangeSign block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.Derivative Derivative Validation model for the Derivative block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.GreaterEqual GreaterEqual Validation model for the GreaterEqual block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.GreaterEqualThreshold GreaterEqualThreshold Validation model for the GreaterEqualThreshold block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.HysteresisWithHold HysteresisWithHold Validation model for the HysteresisWithHold block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LessEqual LessEqual Validation model for the LessEqual block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LessEqualThreshold LessEqualThreshold Validation model for the LessEqualThreshold block
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPID LimPID Test model for LimPID controller
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialDerivativeOutput LimPIDInitialDerivativeOutput Test model for LimPID controller with initial output specified
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialState LimPIDInitialState Test model for LimPID controller with initial state specified
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDWithReset LimPIDWithReset Test model for LimPID controller with reset trigger
Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.NumberOfRequests NumberOfRequests Validation model for the NumberOfRequests block

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

Validation model for the ChangeSign block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.Validation.Derivative Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.Derivative

Validation model for the Derivative block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.Derivative der1( y_start=-10) "Approximate the derivative of the input"; equation connect(ramp1.y, cos1.u); connect(cos1.y, der1.u); end Derivative;

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

Validation model for the GreaterEqual block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.GreaterEqual greEqu "Check if the first input is greater than or equal to the second input"; equation connect(ramp1.y, greEqu.u1); connect(ramp2.y, greEqu.u2); end GreaterEqual;

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

Validation model for the GreaterEqualThreshold block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.GreaterEqualThreshold greEquThr "Check if the input is greater than or equal to the threshold"; equation connect(ramp2.y, greEquThr.u); end GreaterEqualThreshold;

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

Validation model for the HysteresisWithHold block

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

Information

Validation test for the block Buildings.Obsolete.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) "Generate sine wave signal"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.HysteresisWithHold noHold( trueHoldDuration = 0, falseHoldDuration = 0, uLow = 0.05, uHigh = 0.15) "No true/false hold"; Buildings.Obsolete.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.Obsolete.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.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.Validation.LessEqual Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LessEqual

Validation model for the LessEqual block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.LessEqual lesEqu "Check if the first input is less than or equal to the second input"; equation connect(ramp1.y, lesEqu.u1); connect(ramp2.y, lesEqu.u2); end LessEqual;

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

Validation model for the LessEqualThreshold block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.LessEqualThreshold lesEquThr "Check if the input is less than or equal to the threshold"; equation connect(ramp1.y, lesEquThr.u); end LessEqualThreshold;

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

Test model for LimPID controller

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

Information

Validation test for the block Buildings.Obsolete.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) "Setpoint"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, Ti=1, Td=1, yMin=-1) "PID controller"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPIDOri( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, Ti=1, Td=1, yMin=-1) "PID controller"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant const(k=0.5) "Measurement data"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPI( Ti=1, Td=1, yMin=-1, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI) "PI controller"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPD( Ti=1, Td=1, yMin=-1, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PD) "PD controller"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limP( Ti=1, Td=1, yMin=-1, controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P) "P controller"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID 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(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.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialDerivativeOutput Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialDerivativeOutput

Test model for LimPID controller with initial output specified

Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialDerivativeOutput

Information

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

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.Obsolete.Controls.OBC.CDL.Continuous.LimPID.

Modelica definition

model LimPIDInitialDerivativeOutput "Test model for LimPID controller with initial output specified" Buildings.Controls.OBC.CDL.Continuous.Sources.Constant ySet(k=0.75) "Set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant yMea(k=0.75) "Measured value"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=3, yd_start=0.2) "PID controller"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID 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 LimPIDInitialDerivativeOutput;

Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialState Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialState

Test model for LimPID controller with initial state specified

Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDInitialState

Information

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

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 LimPIDInitialState "Test model for LimPID controller with initial state specified" Buildings.Controls.OBC.CDL.Continuous.Sources.Constant ySet(k=0.75) "Set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant yMea(k=0.5) "Measured value"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPID( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=3, xi_start=0.25) "PID controller"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID 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 LimPIDInitialState;

Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDWithReset Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDWithReset

Test model for LimPID controller with reset trigger

Buildings.Obsolete.Controls.OBC.CDL.Continuous.Validation.LimPIDWithReset

Information

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

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

Modelica definition

model LimPIDWithReset "Test model for LimPID controller with reset trigger" Buildings.Controls.OBC.CDL.Conversions.BooleanToReal setPoi "Set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.ModelTime modTim "Model time"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.GreaterEqualThreshold greEquThr( threshold=1) "Outputs true after t=1"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPIDPar( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=1, Ti=1, Td=1, yMin=-1, reset=Buildings.Obsolete.Controls.OBC.CDL.Types.Reset.Parameter, y_reset=0.5) "Controller, reset to parameter value"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes1 "Integrator whose output should be brought to the set point"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPIDInp( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PID, k=1, Ti=1, Td=1, yMin=-1, reset=Buildings.Obsolete.Controls.OBC.CDL.Types.Reset.Input, y_reset=0.5) "Controller, reset to input value"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes2 "Integrator whose output should be brought to the set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant resVal(k=0.75) "Reset value"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPIPar( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, k=1, Ti=1, Td=1, yMin=-1, reset=Buildings.Obsolete.Controls.OBC.CDL.Types.Reset.Parameter, y_reset=0.5) "Controller, reset to parameter value"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes3 "Integrator whose output should be brought to the set point"; Buildings.Obsolete.Controls.OBC.CDL.Continuous.LimPID limPIInp( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, k=1, Ti=1, Td=1, yMin=-1, reset=Buildings.Obsolete.Controls.OBC.CDL.Types.Reset.Input, y_reset=0.5) "Controller, reset to input value"; Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes4 "Integrator whose output should be brought to the set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer(final k=0) "Reset input to integrator when the reset is disabled"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant noTri(final k=false) "No trigger when reset is disabled"; 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(limPIDInp.y_reset_in, resVal.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(limPIInp.y_reset_in, resVal.y); connect(greEquThr.y, limPIInp.trigger); connect(limPIDInp.trigger, greEquThr.y); connect(zer.y, intWitRes1.y_reset_in); connect(zer.y, intWitRes2.y_reset_in); connect(zer.y, intWitRes3.y_reset_in); connect(zer.y, intWitRes4.y_reset_in); connect(noTri.y, intWitRes1.trigger); connect(noTri.y, intWitRes2.trigger); connect(noTri.y, intWitRes3.trigger); connect(noTri.y, intWitRes4.trigger); end LimPIDWithReset;

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

Validation model for the NumberOfRequests block

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

Information

Validation test for the block Buildings.Obsolete.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.Obsolete.Controls.OBC.CDL.Continuous.NumberOfRequests numReq1( nin=5, t=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;