modelZoneLinearise
Extends from LIDEAS.Components.LinearisationInterface, Modelica.Icons.Example.
Information
This model represents a very simple two-zone building. The model can be linearised by executing the command Linearise in the Commands menu of Dymola. This executes the script at LIDEAS/LIDEAS/Resources/Scripts/linearize.mos, which contains the following code:
OutputCPUtime:=false;
// linearise model and save results in "re"
re=Modelica_LinearSystems2.ModelAnalysis.Linearize("IDEAS.LIDEAS.Examples.ZoneLinearise");
// extract state space matrices from 're' and save them to a mat file in the current working directory
writeMatrix(fileName="ssm_ZoneLinearise.mat",matrixName="A",matrix=re.A);
writeMatrix(fileName="ssm_ZoneLinearise.mat",matrixName="B",matrix=re.B, append=true);
writeMatrix(fileName="ssm_ZoneLinearise.mat",matrixName="C",matrix=re.C, append=true);
writeMatrix(fileName="ssm_ZoneLinearise.mat",matrixName="D",matrix=re.D, append=true);
// save the variable names of the inputs, outputs and states in the current working directory
Modelica.Utilities.Files.remove("uNames_ZoneLinearise.txt");
for i in 1:size(re.uNames,1) loop Modelica.Utilities.Streams.print(re.uNames[i], "uNames_ZoneLinearise.txt"); end for;
Modelica.Utilities.Files.remove("yNames_ZoneLinearise.txt");
for i in 1:size(re.yNames,1) loop Modelica.Utilities.Streams.print(re.yNames[i], "yNames_ZoneLinearise.txt"); end for;
Modelica.Utilities.Files.remove("xNames_ZoneLinearise.txt");
for i in 1:size(re.xNames,1) loop Modelica.Utilities.Streams.print(re.xNames[i], "xNames_ZoneLinearise.txt"); end for;
OutputCPUtime:=true;
The first and last line of the code avoid that the CPU time is also linearised. The second line performs the actual linearisation and stores the resulting state space model in variable re. The next four lines are used to save the four state space matrices contained by re to a file ssm.mat. The remaining four lines of code also export the variable names of the state space inputs (u), states (x) and outputs (y) to three .txt files, which can then be used externally.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nZones | 2 | Number of zone |
| Integer | nEmb | 1 | Number of embbed systems |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| LIDEAS.Components.LinZone | groFlo | Ground floor | |
| IDEAS.Buildings.Components.BoundaryWall | commonWall | Common wall model | |
| IDEAS.Buildings.Components.InternalWall | floor | TABS Floor between the two zones. | |
| LIDEAS.Components.LinWindow | window | Window model | |
| IDEAS.Buildings.Components.SlabOnGround | slabOnGround | Floor model | |
| IDEAS.Buildings.Components.OuterWall | outerWall | Outer wall model | |
| LIDEAS.Components.LinZone | firFlo | First floor | |
| IDEAS.Buildings.Components.Shading.ShadingControl | shadingControl | Shading control model | |
| IDEAS.Buildings.Components.BoundaryWall | commonWall1 | Common wall model | |
| Modelica.Blocks.Sources.Constant | TCom | Temperature at one side of the common wall | |
| Modelica.Blocks.Sources.Constant | QCom | Constant heat flow at one side of the common wall 1 | |
| IDEAS.Buildings.Components.OuterWall | outerWall1 | Outer wall model | |
| IDEAS.Buildings.Components.OuterWall | Roof | Outer wall model |
Contents
| Name | Description |
|---|---|
| Medium |
Revisions
- August 21, 2018 by Damien Picard:
Change medium toIDEAS.Media.Specialized.DryAir. - April 10, 2018 by Damien Picard:
Add documentation. - July 18, 2016 by Filip Jorissen:
Cleaned up code and implementation. - By Filip Jorissen:
First implementation.