Skip to content

Commit

Permalink
Merge pull request #1898 from ibpsa/issue1897_numberOfRequestsRobustC…
Browse files Browse the repository at this point in the history
…omparison

Issue1897 number of requests robust comparison
  • Loading branch information
mwetter authored Jun 10, 2024
2 parents fde1f34 + 260e1d0 commit 1f0e6bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
11 changes: 10 additions & 1 deletion IBPSA/Controls/Continuous/Examples/NumberOfRequests.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ model NumberOfRequests
kind=0) annotation (Placement(transformation(extent={{0,20},{20,40}})));
Modelica.Blocks.Sources.Sine sine(f=2)
annotation (Placement(transformation(extent={{-60,-20},{-40,0}})));
Modelica.Blocks.Sources.Pulse pulse(period=0.35)
Modelica.Blocks.Sources.Pulse pulse(
amplitude=1-pulse.offset,
period=0.35,
offset=-0.01)
annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
equation
connect(sine.y, numReq.u[1]) annotation (Line(points={{-39,-10},{-19.5,-10},{
Expand All @@ -21,6 +24,12 @@ __Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Controls/Conti
Documentation(revisions="<html>
<ul>
<li>
June 16, 2024, by Hongxiang Fu:<br/>
Changed pulse input from 0 to 1 to 0.01 to 1.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1897\">#1897</a>.
</li>
<li>
January 12, 2017, by Thierry S. Nouidui:<br/>
Modified example to prevent simultaneous events
This is for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
last-generated=2017-01-18
last-generated=2024-06-06
statistics-simulation=
{
"numerical Jacobians": "0",
"nonlinear": " ",
"linear": " "
"linear": " ",
"nonlinear": " ",
"numerical Jacobians": "0"
}
numReq.u[1]=[0., 0.12533323744971558433, 0.24868989533082475063, 0.36812455241538011297, 0.48175368690617687006, 0.58778523634512991336, 0.68454713843207026791, 0.77051323409946215204, 0.8443279384363054918, 0.90482703867151026422, 0.9510565340027345993, 0.98228722941836554838, 0.9980267303235078602, 0.9980267241165654557, 0.98228722941836554838, 0.95105656226047341484, 0.90482703867151026422, 0.84432793843630538078, 0.77051329293908510376, 0.6845471041974796611, 0.58778527400645275147, 0.48175360443844000846, 0.36812453062441358176, 0.24868994052229564939, 0.12533316768907137861, 0.00000000000000012246, -0.12533335336355946876, -0.24868975891368727549, -0.36812453062441391483, -0.48175376837626832094, -0.58778512170174834761, -0.6845471041974796611, -0.77051329293908510376, -0.84432783660181121022, -0.90482703867151048627, -0.95105656226047330382, -0.9822871922079218221, -0.9980267241165654557, -0.9980267241165654557, -0.9822871922079218221, -0.95105656226047330382, -0.90482703867151048627, -0.84432783660181121022, -0.77051329293908510376, -0.6845471041974796611, -0.58778512170174834761, -0.48175376837626832094, -0.36812453062441391483, -0.24868975891368727549, -0.12533335336355946876, -0.00000000000000024493, 0.12533335336179080022, 0.24869012128477269163, 0.36812487719620695659, 0.48175343923447266903, 0.58778512170357111177, 0.68454710419715092407, 0.7705132929382439988, 0.8443280367726911928, 0.90482719487359475341, 0.95105644385979148936, 0.98228719220845672755, 0.99802672411663273522, 0.99802672411663273522, 0.98228719220845672755, 0.95105644385979148936, 0.90482719487359475341, 0.8443280367726911928, 0.7705132929382439988, 0.68454710419715092407, 0.58778512170357111177, 0.48175343923447266903, 0.36812487719620695659, 0.24869012128477269163, 0.12533335336179080022, 0.00000000000000036739, -0.12533335336179080022, -0.24869012128477269163, -0.36812487719620695659, -0.48175343923447266903, -0.58778512170357111177, -0.68454710419715092407, -0.7705132929382439988, -0.8443280367726911928, -0.90482719487359475341, -0.95105644385979148936, -0.98228719220845672755, -0.99802672411663273522, -0.99802672411663273522, -0.98228719220845672755, -0.95105644385979148936, -0.90482719487359475341, -0.8443280367726911928, -0.7705132929382439988, -0.68454710419715092407, -0.58778512170357111177, -0.48175343923447266903, -0.36812487719620695659, -0.24869012128477269163, -0.12533335336179080022, -0.00000000000000048986]
numReq.y=[1., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.00000298022618806631, 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 2., 2., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.00000596036356004248, 2., 2., 2., 2., 2., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
numReq.u[2]=[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.00000298022618806631, 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.00000596036355997443, 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
time=[0., 1.]
time=[0e+00, 1e+00]
numReq.u[1]=[0e+00, 1.253332374497156e-01, 2.486898953308248e-01, 3.681245524153801e-01, 4.817536869061769e-01, 5.877852363451299e-01, 6.845471384320703e-01, 7.705132340994622e-01, 8.443279384363055e-01, 9.048270386715103e-01, 9.510565340027346e-01, 9.822872294183655e-01, 9.980267303235079e-01, 9.980267241165655e-01, 9.822872294183655e-01, 9.510565622604734e-01, 9.048270386715103e-01, 8.443279384363054e-01, 7.705132929390851e-01, 6.845471041974797e-01, 5.877852740064528e-01, 4.8175360443844e-01, 3.681245306244136e-01, 2.486899405222956e-01, 1.253331676890714e-01, 1.224646852585168e-16, -1.253333533635595e-01, -2.486897589136873e-01, -3.681245306244139e-01, -4.817537683762683e-01, -5.877851217017483e-01, -6.845471041974797e-01, -7.705132929390851e-01, -8.443278366018112e-01, -9.048270386715105e-01, -9.510565622604733e-01, -9.822871922079218e-01, -9.980267241165655e-01, -9.980267241165655e-01, -9.822871922079218e-01, -9.510565622604733e-01, -9.048270386715105e-01, -8.443278366018112e-01, -7.705132929390851e-01, -6.845471041974797e-01, -5.877851217017483e-01, -4.817537683762683e-01, -3.681245306244139e-01, -2.486897589136873e-01, -1.253333533635595e-01, -2.449293705170336e-16, 1.253333533617908e-01, 2.486901212847727e-01, 3.68124877196207e-01, 4.817534392344727e-01, 5.877851217035711e-01, 6.845471041971509e-01, 7.70513292938244e-01, 8.443280367726912e-01, 9.048271948735948e-01, 9.510564438597915e-01, 9.822871922084567e-01, 9.980267241166327e-01, 9.980267241166327e-01, 9.822871922084567e-01, 9.510564438597915e-01, 9.048271948735948e-01, 8.443280367726912e-01, 7.70513292938244e-01, 6.845471041971509e-01, 5.877851217035711e-01, 4.817534392344727e-01, 3.68124877196207e-01, 2.486901212847727e-01, 1.253333533617908e-01, 3.673940293057708e-16, -1.253333533617908e-01, -2.486901212847727e-01, -3.68124877196207e-01, -4.817534392344727e-01, -5.877851217035711e-01, -6.845471041971509e-01, -7.70513292938244e-01, -8.443280367726912e-01, -9.048271948735948e-01, -9.510564438597915e-01, -9.822871922084567e-01, -9.980267241166327e-01, -9.980267241166327e-01, -9.822871922084567e-01, -9.510564438597915e-01, -9.048271948735948e-01, -8.443280367726912e-01, -7.70513292938244e-01, -6.845471041971509e-01, -5.877851217035711e-01, -4.817534392344727e-01, -3.68124877196207e-01, -2.486901212847727e-01, -1.253333533617908e-01, -4.898587410340671e-16]
numReq.u[2]=[1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.996989748033301e-03, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.99397980928834e-03, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03, -9.999999776482582e-03]
numReq.y=[1e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 2.980226188066309e-06, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 2e+00, 2e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1.00000596036356e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00]

0 comments on commit 1f0e6bd

Please sign in to comment.