Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue2614 chilled beam sequences for pr #129

Open
wants to merge 248 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
2f36e30
Added files for chilled beam sequences
karthikeyad-pnnl Sep 15, 2021
5143bc9
Adding unit test scripts
karthikeyad-pnnl Sep 15, 2021
e8a504c
Updated package order
karthikeyad-pnnl Sep 15, 2021
5bcca10
Added missing package file
karthikeyad-pnnl Sep 15, 2021
adac8c4
Updated package order file
karthikeyad-pnnl Sep 15, 2021
3c5f2ae
Updated package order
karthikeyad-pnnl Sep 15, 2021
34993aa
Fixed issues found during unit tests
karthikeyad-pnnl Sep 16, 2021
998d3b2
Added results files from unit tests
karthikeyad-pnnl Sep 16, 2021
4e20867
Issue2614 chilled beam sequences (#2626)
karthikeyad-pnnl Sep 20, 2021
491f29d
Updated comment
mwetter Sep 20, 2021
316ba9f
Added icon
mwetter Sep 20, 2021
fe47db9
Updated comments so it is clearer what roles the blocks have
mwetter Sep 20, 2021
f5a6ebe
Merge remote-tracking branch 'upstream/issue2614_ChilledBeamSequences…
karthikeyad-pnnl Nov 12, 2021
ee5e1e6
Added example files for chilled beam system
karthikeyad-pnnl Nov 15, 2021
e632b8f
Updated formatting
karthikeyad-pnnl Nov 17, 2021
d91f6d5
Added files for control modules with changes to address comments made…
karthikeyad-pnnl Nov 24, 2021
64be723
Removed redundant types package
karthikeyad-pnnl Nov 24, 2021
019d4ee
Updated models to resolve unit test errors. Uploaded new results for …
karthikeyad-pnnl Nov 24, 2021
85c2fd8
Updated formatting
karthikeyad-pnnl Nov 24, 2021
b132ffe
Added documentation to packages
karthikeyad-pnnl Nov 25, 2021
2e38571
Added block to prevent division by zero when static pressure setpoint…
karthikeyad-pnnl Nov 29, 2021
f01e0f3
Issue2614 chilled beam sequences controls only (#2783)
karthikeyad-pnnl Nov 30, 2021
d1db94c
Added revision notes
mwetter Nov 30, 2021
295b7ff
Updated OpenModelica script
mwetter Nov 30, 2021
04451ac
Maded PID public, and assignment not final so that individual control…
mwetter Nov 30, 2021
500e2c1
Changed initial value for y_d from 1 to 0 (which is the default)
mwetter Nov 30, 2021
cb8730f
Updated comment
mwetter Nov 30, 2021
6109ffe
Refactored to remove AddParameter
mwetter Nov 30, 2021
59a36be
Renamed models and package to shorten names
mwetter Nov 30, 2021
4499a84
Updated .travis.yml from master
mwetter Nov 30, 2021
63cd635
Updated BuildingsPy version
mwetter Nov 30, 2021
0ff694e
Updated BuildingsPy version
mwetter Nov 30, 2021
c9cea39
Merge branch 'issue2614_ChilledBeamSequences' of https://github.com/l…
karthikeyad-pnnl Dec 16, 2021
e5e226b
Merge branch 'lbl-srg-issue2614_ChilledBeamSequences' into issue2614_…
karthikeyad-pnnl Dec 16, 2021
74cedba
Updated package structure to move ChilledBeams package outside of OBC…
karthikeyad-pnnl Dec 16, 2021
635a337
Updated logic for normalizing measured differential pressure in the l…
karthikeyad-pnnl Dec 21, 2021
8b8748c
Updated icon layer. Added minimum limit to parameter
karthikeyad-pnnl Aug 4, 2022
29606f6
Updated result file names in Dymola scripts
karthikeyad-pnnl Aug 4, 2022
8d12add
Merge remote-tracking branch 'upstream/master' into issue2614_Chilled…
karthikeyad-pnnl Aug 4, 2022
43aa95c
Removed empty package
karthikeyad-pnnl Aug 4, 2022
aa437d9
Updated class names based on CDL updates
karthikeyad-pnnl Aug 4, 2022
569a650
Resolved bug due to CDL updates
karthikeyad-pnnl Aug 4, 2022
a834fb4
Fixed bug found during unit tests
karthikeyad-pnnl Aug 4, 2022
a1acecf
Updated instance name due to class update. Added parameter display an…
karthikeyad-pnnl Aug 4, 2022
927b19b
Updated unit test results
karthikeyad-pnnl Aug 4, 2022
1975089
Merge branch 'master' into issue2614_ChilledBeamSequences
mwetter Aug 8, 2022
a77ea0e
Merge branch 'issue2614_ChilledBeamSequences_ControlsOnly' of github.…
mwetter Aug 8, 2022
6e23320
Merge branch 'karthikeyad-pnnl-issue2614_ChilledBeamSequences_Control…
mwetter Aug 8, 2022
726bae6
Corrected capitalization of VDes in comments
mwetter Aug 8, 2022
4d37da2
Added labels to connectors
mwetter Aug 8, 2022
003a28a
Set small value to 1 Pa to guard against measurement noise
mwetter Aug 8, 2022
7e2b32c
Changed guard of division against zero
mwetter Aug 8, 2022
d23d288
Set minimum attribute and removed default parameter value
mwetter Aug 8, 2022
94a443a
Moved connectors
mwetter Aug 8, 2022
e1603dd
Moved connectors
mwetter Aug 8, 2022
786fa15
Moved parameters to main tab
mwetter Aug 8, 2022
8999f71
Merge pull request #59 from lbl-srg/issue2614_ChilledBeamSequences
karthikeyad-pnnl Feb 12, 2023
b55cfe9
Added svg file to repo. Removed division block for normalizing pressu…
karthikeyad-pnnl Feb 12, 2023
ad5dcc0
Merge pull request #1 from karthikeyad-pnnl/issue2614_ChilledBeamSequ…
junkewang001 Apr 4, 2023
22f1878
Merge pull request #2 from lbl-srg/master
junkewang001 Apr 4, 2023
6ac4f1d
Set the min attributes of nPum and nVal
junkewang001 Apr 6, 2023
b5ae2f6
Corrected a typo
junkewang001 Apr 6, 2023
c3a481f
Removed default values
junkewang001 Apr 11, 2023
21a67cb
Labelled inputs and outputs in Icon layer
junkewang001 Apr 12, 2023
c0a30aa
Changed heating and cooling setpoint as inputs
junkewang001 Apr 12, 2023
d16b988
Removed ZoneTemperature block
junkewang001 Apr 19, 2023
f60a88e
Updated triRes block path
junkewang001 Apr 19, 2023
0324d58
Added documentation for example models
junkewang001 Apr 19, 2023
b0fd20e
Updated corresponding models after removing ZoneTemperature model
junkewang001 Apr 19, 2023
633aa32
Labelled inputs and outputs for controllers
junkewang001 Apr 19, 2023
981c7fb
Removed some lines and labels for simplicity
junkewang001 Apr 19, 2023
940004b
Added ZeroIndexCorrection block and modified some errors
junkewang001 Apr 19, 2023
e7e76b7
Deleted the primary loop components
junkewang001 Apr 20, 2023
feb925d
Added max allowed value in ZeroIndexCorrection block
junkewang001 Apr 20, 2023
c3bf625
Merge pull request #73 from lbl-srg/master
karthikeyad-pnnl May 17, 2023
6813600
Merge branch 'issue2614_ChilledBeamSequences' of github.com:junkewang…
karthikeyad-pnnl May 18, 2023
79ffa15
Merge branch 'junkewang001-issue2614_ChilledBeamSequences' into issue…
karthikeyad-pnnl May 18, 2023
47f3d06
Updated formatting for models
karthikeyad-pnnl May 19, 2023
e9b97da
Updated documentation. Removed default values for trim and respond co…
karthikeyad-pnnl May 20, 2023
c19be75
Updated schematics for chilled beam control systems
karthikeyad-pnnl May 20, 2023
7dda543
Updated formatting and simulation settings
karthikeyad-pnnl May 20, 2023
c1a9026
Removed unnecessary classes
karthikeyad-pnnl May 24, 2023
2327c19
Updated validation model and script
karthikeyad-pnnl May 24, 2023
81fcaf7
Updated validation model and script for zone regulation block
karthikeyad-pnnl May 24, 2023
113fa40
Updated validation model and script for operating mode calculation block
karthikeyad-pnnl May 24, 2023
294fc91
Updated unit test results
karthikeyad-pnnl May 24, 2023
f0ef310
Updated HTML formatting in documentation
karthikeyad-pnnl May 25, 2023
30404b7
Corrected HTML formatting in documentation
karthikeyad-pnnl May 25, 2023
5f892f5
Updated validation model and script for change status block
karthikeyad-pnnl May 25, 2023
a3f3696
Updated annotations for simulation settings
karthikeyad-pnnl May 25, 2023
c8060a5
Updated unit test results
karthikeyad-pnnl May 25, 2023
9399406
Updated documentation for all validation models
karthikeyad-pnnl May 25, 2023
afa9234
Fixed missing space
karthikeyad-pnnl May 25, 2023
4a3dc84
Updated unit test results after changes to pump controller
karthikeyad-pnnl May 25, 2023
f6e4040
merged master
JayHuLBL Jul 31, 2023
3685a5b
first implementation
Sep 28, 2023
12eb4b8
enhance the example by adding one use case
Sep 29, 2023
07dbf26
cleanup
Sep 29, 2023
b149ee5
update the model doc
Sep 29, 2023
c85a367
improve model doc
Oct 9, 2023
0501e4c
update the release note
Oct 9, 2023
bd60f25
Merge pull request #3541 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Oct 9, 2023
aa48571
merged master
JayHuLBL Oct 9, 2023
1d1107a
renamed example model, removed obsolete example
JayHuLBL Oct 9, 2023
dc5a245
removed Modelica.Fluid.System
JayHuLBL Oct 10, 2023
7d6d0e0
reverted changes, changed example models name
JayHuLBL Oct 11, 2023
ea482fd
fixed html syntax, corrected release note
JayHuLBL Oct 11, 2023
e2cc156
renamed model
JayHuLBL Oct 25, 2023
9ad06bf
merged master
JayHuLBL Oct 25, 2023
6aa884a
fix typos
Nov 1, 2023
80aa7ed
change parameter names and replace if with approximation
Nov 2, 2023
0206f53
Merge branch 'issue2614_ChilledBeamSequences' of github.com:lbl-srg/m…
karthikeyad-pnnl Nov 2, 2023
6be2671
Merge branch 'lbl-srg-issue2614_ChilledBeamSequences' into issue2614_…
karthikeyad-pnnl Nov 2, 2023
eaecc96
Merge branch 'issue2614_ChilledBeamSequences_ControlsOnly' of github.…
karthikeyad-pnnl Nov 2, 2023
3b4bddb
reimplement the wheels with different controls
Nov 2, 2023
d0a6f99
fixing naming and icon
Nov 3, 2023
1280ac1
Merge branch 'master' into issue3538_Air2Air_recovery
Nov 8, 2023
6291751
model clean up
Nov 10, 2023
4bfe833
model doc update and clean up
Nov 13, 2023
0c47509
fix issues in examples
Nov 14, 2023
e7720a1
diagram and info updated
Nov 14, 2023
fce7045
model doc enhance
Nov 15, 2023
13e1010
fix typos
Nov 15, 2023
1e772d6
merge the changes from the forked repo
Nov 15, 2023
e596b73
fix html issue and obsolete files
Nov 15, 2023
34a4738
format enhancement
Nov 15, 2023
28288e8
fix model doc
Nov 15, 2023
9043c75
typo fix
Nov 15, 2023
04c4078
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Nov 27, 2023
2b6df81
Merge branch 'lbl-srg:issue3538_Air2Air_recovery' into issue3538_Air2…
SenHuang19 Nov 28, 2023
0b4a86d
update model doc
Nov 28, 2023
ec1e7c6
model doc update
Nov 29, 2023
2028e45
Merge pull request #3577 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 4, 2023
481c258
corrected package order, removed redundant digits
JayHuLBL Dec 4, 2023
f14f28f
improved documentation and the format
JayHuLBL Dec 4, 2023
9804347
fixed html error
JayHuLBL Dec 4, 2023
250f8e3
added git status
JayHuLBL Dec 5, 2023
4296f4a
reverted conf.yml change
JayHuLBL Dec 5, 2023
29e2b79
improved warning messages [ci skip]
JayHuLBL Dec 14, 2023
54ec5d8
improved warning messages [ci skip]
JayHuLBL Dec 14, 2023
1d32a41
renamed connectors [ci skip]
JayHuLBL Dec 14, 2023
e4610fc
removed final for the displayUnit
JayHuLBL Dec 14, 2023
47f9fdf
input limit update and model doc improve
Dec 15, 2023
3cb0b93
Merge pull request #3608 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 15, 2023
f8e4d44
improved graphic [ci skip]
JayHuLBL Dec 18, 2023
4b76bcd
add power calculation and remove sensors
Dec 19, 2023
5bc3276
ref data update
Dec 19, 2023
8a466d5
model doc improved
Dec 19, 2023
a76755b
Merge pull request #3615 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Dec 19, 2023
cdbaf03
improved comments [ci skip]
JayHuLBL Dec 20, 2023
3291ad3
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Dec 20, 2023
c50cf08
changed revision note
JayHuLBL Dec 20, 2023
9765dc1
improved error message
JayHuLBL Dec 21, 2023
56163fa
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Dec 22, 2023
07c23a5
improved text
JayHuLBL Jan 3, 2024
739b7a3
improved comments
JayHuLBL Jan 3, 2024
79ca115
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Jan 3, 2024
344478b
corrected assertion check
JayHuLBL Jan 3, 2024
c2b9351
Rearranged compoents and connections [ci skip]
mwetter Jan 5, 2024
2dd9393
Added block icon
mwetter Jan 5, 2024
516a325
Corrected typo
mwetter Jan 5, 2024
f8892c9
Corrected typo
mwetter Jan 5, 2024
89bc2a8
Updated assertion message to the same as other models use
mwetter Jan 5, 2024
417263d
Renamed package and models
mwetter Jan 5, 2024
b35367a
Updated comments and default parameter bindings
mwetter Jan 6, 2024
1d88681
Changed dp_nominal to more realistic value
mwetter Jan 6, 2024
e186be0
Removed default values in base class
mwetter Jan 6, 2024
2d2be9d
Moved to Latent package so that Sensible wheels can be added too
mwetter Jan 6, 2024
9716db3
Refactored models to use common base class
mwetter Jan 6, 2024
4c57394
Formatted file
mwetter Jan 6, 2024
18c8160
merged master, correcter package order [ci skip]
JayHuLBL Jan 9, 2024
7ece958
add the sensible wheel package
Jan 10, 2024
3c807aa
model doc update and remove unneeded settings
Jan 10, 2024
0aa1165
add the rest files for sensible wheel
Jan 10, 2024
c9abfbf
update the om scripts
Jan 10, 2024
c51ff77
reference data update
Jan 10, 2024
0b2e9c7
Merge branch 'issue3538_Air2Air_recovery' of https://github.com/SenHu…
Jan 10, 2024
13d5792
model doc update
Jan 12, 2024
6c5932e
release note update
Jan 12, 2024
7cf6163
Merge pull request #112 from karthikeyad-pnnl/issue2614_ChilledBeamSe…
karthikeyad-pnnl Jan 17, 2024
4fd7b76
Added new files for DOAS controller
karthikeyad-pnnl Jan 18, 2024
77b3fe3
Fixed compilation errors after merging new DOAS control
karthikeyad-pnnl Jan 18, 2024
bd3ab33
Updated package structure. Updated class references on instances in v…
karthikeyad-pnnl Jan 18, 2024
022d530
Moved fan and pump curve to example folder. Fixed other compilation e…
karthikeyad-pnnl Jan 18, 2024
d473764
Updated pump and fan data records
karthikeyad-pnnl Jan 18, 2024
8bc68f4
Referenced renamed data record classes in testbed
karthikeyad-pnnl Jan 18, 2024
0113864
Updated Chilled Beam Validation Model
cerrinamouchref-pnnl Feb 6, 2024
98793e0
Updates to Closed Loop Validation
cerrinamouchref-pnnl Feb 21, 2024
84a20e5
Merge pull request #124 from cerrinamouchref-pnnl/issue2614_ChilledBe…
karthikeyad-pnnl Feb 22, 2024
6a67d1b
Reverted unintentional CDL change
karthikeyad-pnnl Feb 22, 2024
5f9d5d5
Merge pull request #125 from lbl-srg/master
karthikeyad-pnnl Feb 22, 2024
977f6a0
Fixed CDL paths after merging latest master
karthikeyad-pnnl Feb 22, 2024
2a2378c
Updated constant zero and one Real sources to float representation to…
karthikeyad-pnnl Feb 22, 2024
7bec660
Added new refrence data for zone loads, and updated filepath to it in…
karthikeyad-pnnl Feb 22, 2024
9cd0b0f
Merge pull request #8 from karthikeyad-pnnl/issue2614_ChilledBeamSequ…
cerrinamouchref-pnnl Feb 22, 2024
0973098
Updates to DOAS Validation Models
cerrinamouchref-pnnl Feb 23, 2024
ed2ee4d
Changes to Validation Plots
cerrinamouchref-pnnl Feb 29, 2024
003bf58
Merge pull request #3636 from SenHuang19/issue3538_Air2Air_recovery
JayHuLBL Mar 1, 2024
22124d8
Merge branch 'master' into issue3538_Air2Air_recovery
JayHuLBL Mar 1, 2024
4c00241
Merge branch 'issue3538_Air2Air_recovery' of https://github.com/lbl-s…
JayHuLBL Mar 1, 2024
4f865a6
changed interface connectors
JayHuLBL Mar 1, 2024
3a63f0a
moved instance to be protected, improved comment
JayHuLBL Mar 4, 2024
7eb5b25
New Validation Plots for DOAS Controller
cerrinamouchref-pnnl Mar 6, 2024
c8c0c30
New Changes to Coiling Coil
cerrinamouchref-pnnl Mar 12, 2024
81ea895
Changes to Coiling Coil Validation
cerrinamouchref-pnnl Mar 13, 2024
ceeb3c6
Merge pull request #127 from cerrinamouchref-pnnl/issue2614_ChilledBe…
karthikeyad-pnnl Mar 14, 2024
77103b9
Updated naming convention on cooling coil controller
karthikeyad-pnnl Mar 14, 2024
178ac66
Merge pull request #9 from karthikeyad-pnnl/issue2614_ChilledBeamSequ…
cerrinamouchref-pnnl Mar 14, 2024
12e3536
Updated interfaces as per OBC conventions
karthikeyad-pnnl Mar 15, 2024
14202fe
Merge pull request #10 from karthikeyad-pnnl/issue2614_ChilledBeamSeq…
cerrinamouchref-pnnl Mar 15, 2024
fb1e72e
Changes for DOAS model naming convention
cerrinamouchref-pnnl Mar 22, 2024
0d044e0
Merge pull request #128 from cerrinamouchref-pnnl/issue2614_ChilledBe…
karthikeyad-pnnl Mar 26, 2024
b107a28
Deleted unused class for dewpoint temperature calculation
karthikeyad-pnnl Mar 26, 2024
34976e3
Moved energy recovery wheel simulator block to baseclasses package wi…
karthikeyad-pnnl Mar 27, 2024
768e712
Updated path to energy recovery wheel simulator
karthikeyad-pnnl Mar 27, 2024
e84a667
Merge pull request #11 from karthikeyad-pnnl/issue2614_ChilledBeamSeq…
cerrinamouchref-pnnl Mar 27, 2024
974c312
Updates to naming for DOAS controller
cerrinamouchref-pnnl Mar 30, 2024
83f3dc9
Updates to validation models
cerrinamouchref-pnnl Apr 4, 2024
2c28e86
Updates to validation model plots and naming
cerrinamouchref-pnnl Apr 10, 2024
d73e1ad
merged master [ci skip]
JayHuLBL Apr 10, 2024
a95f2d2
improved graphics
JayHuLBL Apr 12, 2024
77d6ba5
merged master
JayHuLBL Apr 12, 2024
3cbc5a1
improved text
JayHuLBL Apr 12, 2024
f1c4b0a
Merge pull request #133 from cerrinamouchref-pnnl/issue2614_ChilledBe…
karthikeyad-pnnl Apr 13, 2024
7a7e1d6
Fixed connections in closed loop validfation model
karthikeyad-pnnl Apr 13, 2024
6e64aac
Bump idna in /Buildings/Resources/Documentation/userGuide (#3797)
dependabot[bot] Apr 15, 2024
13987ad
Corrected broken hyperlinks (#3801)
mwetter Apr 17, 2024
c7220f4
Refactor Latch block (#3800)
AntoineGautier Apr 18, 2024
c0004f5
Updates to DOAS
cerrinamouchref-pnnl Apr 19, 2024
16be388
Issue3809 add sort output backward compatible (#3813)
mwetter Apr 23, 2024
d5549c9
Merge branch 'master' into issue3538_Air2Air_recovery
mwetter Apr 23, 2024
fcff2bf
Improved implementation to avoid non-needed call to regStep
mwetter Apr 23, 2024
5f85b77
Revised implementation and documentation
mwetter Apr 23, 2024
b7c4161
Improved implementation to avoid non-needed call to regStep
mwetter Apr 23, 2024
526249d
Updated comment
mwetter Apr 23, 2024
292edbf
Changed graphical layout
mwetter Apr 24, 2024
ddc8734
Added icons
mwetter Apr 24, 2024
234038d
Updated icon
mwetter Apr 24, 2024
15d5370
Removed connector to itself
mwetter Apr 24, 2024
0fa5da9
Updated release notes
mwetter Apr 24, 2024
dfbe906
Corrected html
mwetter Apr 24, 2024
c973468
Restricted ratio of flow rates
mwetter Apr 24, 2024
40b5d7c
Removed assertion that would trigger each time the fan switches off
mwetter Apr 24, 2024
fbfd7ef
Merge pull request #135 from lbl-srg/issue3538_Air2Air_recovery
karthikeyad-pnnl May 10, 2024
642998d
Merge pull request #136 from karthikeyad-pnnl/issue3538_Air2Air_recovery
karthikeyad-pnnl May 10, 2024
2d79798
Merge branch 'issue2614_ChilledBeamSequences_ForPR' of github.com:cer…
karthikeyad-pnnl May 10, 2024
d619f99
t push origin issue2614_ChilledBeamSequences_ForPRMerge branch 'cerri…
karthikeyad-pnnl May 10, 2024
1f64feb
Deleted unnecessary binary files
karthikeyad-pnnl May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 9 additions & 33 deletions Buildings/Controls/OBC/CDL/Logical/Latch.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within Buildings.Controls.OBC.CDL.Logical;
block Latch
"Maintains a true signal until change condition"
"Maintains a true signal until cleared"
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u
"Latch input"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
Expand All @@ -10,40 +10,11 @@ block Latch
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y
"Output signal"
annotation (Placement(transformation(extent={{100,-20},{140,20}})));

initial equation
pre(y)=false;
pre(u)=false;
pre(clr)=false;

equation
when initial() then
//scenario = 1;
y=if clr then
false
else
u;
elsewhen
(not clr) and change(u) and
(pre(u) == false) then
//scenario = 2;
y=not clr;
elsewhen
(not clr) and change(u) and
(pre(u) == true) then
//scenario = 3;
y=if clr then
false
else
pre(y);
elsewhen change(clr) and
(pre(clr) == true) and
(not u) then
//scenario = 4;
y=false;
elsewhen clr then
//scenario = 5;
y=false;
y=not clr and u;
elsewhen {clr, u} then
y=not clr and u;
end when;
annotation (
defaultComponentName="lat",
Expand Down Expand Up @@ -148,6 +119,11 @@ At initial time, if <code>clr = false</code>, then the output will be
revisions="<html>
<ul>
<li>
April 15, 2024, by Antoine Gautier:<br/>
Simplified the implementation.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3796\">issue 3796</a>.
</li>
<li>
October 13, 2020, by Jianjun Hu:<br/>
Removed the parameter <code>pre_y_start</code>, and made the initial output to be
equal to latch input when the clear input is <code>false</code>.<br/>
Expand Down
20 changes: 15 additions & 5 deletions Buildings/Controls/OBC/CDL/Reals/Sort.mo
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ block Sort
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y[nin]
"Connector of Real output signals"
annotation (Placement(transformation(extent={{100,-20},{140,20}})));

Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yIdx[nin]
"Indices of the sorted vector with respect to the original vector"
annotation (Placement(transformation(extent={{100,-80},{140,-40}}),
iconTransformation(extent={{100,-80},{140,-40}})));
equation
y=Modelica.Math.Vectors.sort(
(y, yIdx)=Modelica.Math.Vectors.sort(
u,
ascending=ascending);

annotation (
defaultComponentName="sort",
Icon(
Expand All @@ -42,10 +46,12 @@ equation
info="<html>
<p>
Block that sorts the elements of the input signal <i>u</i>.
If the parameter <code>ascending = true</code>, then the output signal satisfies
If the parameter <code>ascending = true</code>, then the output signal <i>y</i> satisfies
<i>y<sub>i</sub> &lt;= y<sub>i+1</sub></i> for all <i>i &isin; {1, ..., n-1}</i>.
Otherwise, it satisfies
<i>y<sub>i</sub> &gt;= y<sub>i+1</sub></i> for all <i>i &isin; {1, ..., n-1}</i>.
The output signal <i>yIdx</i> contains the indices of the sorted elements,
with respect to the input vector <i>u</i>.
</p>
<h4>Usage</h4>
<p>
Expand All @@ -62,10 +68,14 @@ In real controllers, measurement noise may cause the output to change frequently
This block may for example be used in a variable air volume flow
controller to access the position of the dampers that are most open.
</p>
</html>",
revisions="<html>
</html>", revisions="<html>
<ul>
<li>
April 18, 2024, by Jianjun Hu:<br/>
Added an output variable with the indices of the sorted elements.
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3809\">issue 3809</a>.
</li>
<li>
March 2, 2020, by Michael Wetter:<br/>
Changed icon to display dynamically the output value.
</li>
Expand Down
Loading
Loading