CDL.Continuous.Sources.Validation

Collection of models that validate the continuous sources blocks of the CDL

Information

This package contains models that validate the blocks in CDL.Continuous.Sources.

The examples plot various outputs, which have been verified against analytical solutions. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.

Package Content

Name Description
CDL.Continuous.Sources.Validation.CalendarTimeMonths CalendarTimeMonths Validation model for the calendar time model
CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus CalendarTimeMonthsMinus Validation model for the calendar time model with start time slightly below the full hour
CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus CalendarTimeMonthsPlus Validation model for the calendar time model with start time slightly higher than the full hour
CDL.Continuous.Sources.Validation.Constant Constant Validate the Constant block
CDL.Continuous.Sources.Validation.Pulse Pulse Validation model for the Pulse block
CDL.Continuous.Sources.Validation.Ramp Ramp Validation model for the Ramp
CDL.Continuous.Sources.Validation.Sin Sin Validation model for Sin
CDL.Continuous.Sources.Validation.StandardTime StandardTime Test model for the StandardTime block
CDL.Continuous.Sources.Validation.TimeTable TimeTable Validation model for TimeTable block
CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime TimeTableNegativeStartTime Validation model for TimeTable block with negative start time

CDL.Continuous.Sources.Validation.CalendarTimeMonths CDL.Continuous.Sources.Validation.CalendarTimeMonths

Validation model for the calendar time model

CDL.Continuous.Sources.Validation.CalendarTimeMonths

Information

This model validates the use of the CDL.Continuous.Sources.CalendarTime block for a period of a couple of months. This shorter simulation time has been selected to store the reference results that are used in the regression tests at a resulation that makes sense for the minute and hour outputs.

Modelica definition

model CalendarTimeMonths "Validation model for the calendar time model" CDL.Continuous.Sources.CalendarTime calTim( zerTim=CDL.Types.ZeroTime.NY2017) "Computes date and time assuming time=0 corresponds to new year 2017"; end CalendarTimeMonths;

CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus

Validation model for the calendar time model with start time slightly below the full hour

CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus

Information

This model validates the use of the CDL.Continuous.Sources.CalendarTime. It is identical to CDL.Continuous.Sources.Validation.CalendarTimeMonths except that the start and end time are different.

Extends from CDL.Continuous.Sources.Validation.CalendarTimeMonths (Validation model for the calendar time model).

Modelica definition

model CalendarTimeMonthsMinus "Validation model for the calendar time model with start time slightly below the full hour" extends CDL.Continuous.Sources.Validation.CalendarTimeMonths; end CalendarTimeMonthsMinus;

CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus

Validation model for the calendar time model with start time slightly higher than the full hour

CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus

Information

This model validates the use of the CDL.Continuous.Sources.CalendarTime. It is identical to CDL.Continuous.Sources.Validation.CalendarTimeMonths except that the start and end time are different.

Extends from CDL.Continuous.Sources.Validation.CalendarTimeMonths (Validation model for the calendar time model).

Modelica definition

model CalendarTimeMonthsPlus "Validation model for the calendar time model with start time slightly higher than the full hour" extends CDL.Continuous.Sources.Validation.CalendarTimeMonths; end CalendarTimeMonthsPlus;

CDL.Continuous.Sources.Validation.Constant CDL.Continuous.Sources.Validation.Constant

Validate the Constant block

CDL.Continuous.Sources.Validation.Constant

Information

Validation test for the block CDL.Continuous.Sources.Constant.

Modelica definition

model Constant "Validate the Constant block" CDL.Continuous.Sources.Constant con( k=2.5) "Block output real constant value"; end Constant;

CDL.Continuous.Sources.Validation.Pulse CDL.Continuous.Sources.Validation.Pulse

Validation model for the Pulse block

CDL.Continuous.Sources.Validation.Pulse

Information

Validation test for the block CDL.Continuous.Sources.Pulse.

Modelica definition

model Pulse "Validation model for the Pulse block" CDL.Continuous.Sources.Pulse pulse( amplitude=2.0, width=0.5, offset=0.2, period=1) "Block that generates pulse signal of type Real"; end Pulse;

CDL.Continuous.Sources.Validation.Ramp CDL.Continuous.Sources.Validation.Ramp

Validation model for the Ramp

CDL.Continuous.Sources.Validation.Ramp

Information

Validation test for the block CDL.Continuous.Sources.Ramp.

Modelica definition

model Ramp "Validation model for the Ramp" CDL.Continuous.Sources.Ramp ram( height=2, duration=3, offset=0.5, startTime=1.0) "Block that generates ramp signal"; end Ramp;

CDL.Continuous.Sources.Validation.Sin CDL.Continuous.Sources.Validation.Sin

Validation model for Sin

CDL.Continuous.Sources.Validation.Sin

Information

Validation test for the block CDL.Continuous.Sources.Ramp.

Modelica definition

model Sin "Validation model for Sin" CDL.Continuous.Sources.Sin sin( amplitude=5, freqHz=1/60, phase=0, offset=10, startTime=10) "Sine source block"; end Sin;

CDL.Continuous.Sources.Validation.StandardTime CDL.Continuous.Sources.Validation.StandardTime

Test model for the StandardTime block

CDL.Continuous.Sources.Validation.StandardTime

Information

This model tests the implementation of the block that outputs the model time.

Modelica definition

model StandardTime "Test model for the StandardTime block" CDL.Continuous.Sources.ModelTime staTim "Standard time"; end StandardTime;

CDL.Continuous.Sources.Validation.TimeTable CDL.Continuous.Sources.Validation.TimeTable

Validation model for TimeTable block

CDL.Continuous.Sources.Validation.TimeTable

Information

This model validates the TimeTable block. It takes as a parameter a time table of the format

table = [ 0*3600, 0;
          6*3600, 1;
         18*3600, 0.5;
         24*3600, 0];

The block timTabLin applies smoothness method of linear segments between table points, periodically repeat the table scope.

The block timTabLinHol applies smoothness method of linear segments between table points, hold the last table points when it becomes outside of table scope.

The block timTabLinDer applies smoothness method of linear segments between table points, extrapolate by using the derivative at the last table points to find points outside the table scope.

The block timTabCon applies smoothness method of constant segments between table points, periodically repeat the table scope.

The block timTabLinCon applies smoothness method of linear segments between table points, periodically repeat the table scope. Table points is different so to ensure constant zero during time range of (0*3600, 6*36000).

table = [ 0*3600, 0;
          6*3600, 0;
          6*3600, 1;
         18*3600, 0.5;
         24*3600, 0];

Modelica definition

model TimeTable "Validation model for TimeTable block" CDL.Continuous.Sources.TimeTable timTabLin( smoothness=CDL.Types.Smoothness.LinearSegments, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; CDL.Continuous.Sources.TimeTable timTabLinHol( smoothness=CDL.Types.Smoothness.LinearSegments, extrapolation=CDL.Types.Extrapolation.HoldLastPoint, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, hold first and last value"; CDL.Continuous.Sources.TimeTable timTabLinDer( smoothness=CDL.Types.Smoothness.LinearSegments, extrapolation=CDL.Types.Extrapolation.LastTwoPoints, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, extrapolate with der"; CDL.Continuous.Sources.TimeTable timTabCon( smoothness=CDL.Types.Smoothness.ConstantSegments, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of constant segments"; CDL.Continuous.Sources.TimeTable timTabLinCon( smoothness=CDL.Types.Smoothness.LinearSegments, table=[ 0,0; 6*3600,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; end TimeTable;

CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime

Validation model for TimeTable block with negative start time

CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime

Information

This model validates the block CDL.Continuous.Sources.TimeTable. The model is identical to CDL.Continuous.Sources.Validation.TimeTable except that the start time is negative, and not a multiple of a full day.

Modelica definition

model TimeTableNegativeStartTime "Validation model for TimeTable block with negative start time" CDL.Continuous.Sources.TimeTable timTabLin( smoothness=CDL.Types.Smoothness.LinearSegments, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; CDL.Continuous.Sources.TimeTable timTabLinHol( smoothness=CDL.Types.Smoothness.LinearSegments, extrapolation=CDL.Types.Extrapolation.HoldLastPoint, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, hold first and last value"; CDL.Continuous.Sources.TimeTable timTabLinDer( smoothness=CDL.Types.Smoothness.LinearSegments, extrapolation=CDL.Types.Extrapolation.LastTwoPoints, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, extrapolate with der"; CDL.Continuous.Sources.TimeTable timTabCon( smoothness=CDL.Types.Smoothness.ConstantSegments, table=[ 0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of constant segments"; CDL.Continuous.Sources.TimeTable timTabLinCon( smoothness=CDL.Types.Smoothness.LinearSegments, table=[ 0,0; 6*3600,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; end TimeTableNegativeStartTime;