Buildings.Controls.Predictors.BaseClasses.Examples
Collection of models that illustrate model use and test models
Information
This package contains examples models for the functions in Buildings.Controls.Predictors.BaseClasses.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name | Description |
---|---|
SampleStart | Test model for sampleStart function |
Buildings.Controls.Predictors.BaseClasses.Examples.SampleStart
Test model for sampleStart function
Information
This model tests the function Buildings.Controls.Predictors.BaseClasses.sampleStart. The function produces the following sequence of points
simulation start | start of sampling |
---|---|
-10 | -10 |
-9 | -5 |
-8 | -5 |
-7 | -5 |
-6 | -5 |
-5 | -5 |
-4 | -0 |
-3 | -0 |
-2 | -0 |
-1 | -0 |
0 | 0 |
1 | 5 |
2 | 5 |
3 | 5 |
4 | 5 |
5 | 5 |
6 | 10 |
7 | 10 |
8 | 10 |
9 | 10 |
10 | 10 |
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | tSimSta[21] | {i for i in -10:10} | Simulation start times [s] |
Time | tSample | 5 | Sample time [s] |
Time | samSta[21] | samSta(each fixed=false) | Start of sampling time [s] |
Modelica definition
model SampleStart "Test model for sampleStart function"
extends Modelica.Icons.Example;
parameter Modelica.SIunits.Time tSimSta[21] = {i for i in -10:10}
"Simulation start times";
parameter Modelica.SIunits.Time tSample = 5 "Sample time";
parameter Modelica.SIunits.Time samSta[21](each fixed=false)
"Start of sampling time";
initial equation
samSta = sampleStart(t = tSimSta,
samplePeriod = tSample);
/*
for i in 1:size(tSimSta,1) loop
Modelica.Utilities.Streams.print("t = " + String(tSimSta[i]) + " samSta = " + String(samSta[i]));
end for;
*/
end SampleStart;