You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
model ThreeTanksMod
extends Modelica.Fluid.Examples.Tanks.ThreeTanks(tank1(T_start=272.151));
annotation (uses(Modelica(version="4.0.0")));
end ThreeTanksMod;
The problem is that tank1.T slightly drops (about 2.5 mK) during the first 100 s, and thus it triggers the following assert:
assert(tank1.medium.T >= 272.15 and tank1.medium.T <= 403.15, "
Temperature T (= " + String(tank1.medium.T)+" K) is not in the allowed range (
"+ "272.15"+" K <= T <= "+"403.15"+" K) required from medium model \""+ "SimpleLiquidWater"+"\".");
Generating:
Temperature T (= 272.15 K) is not
in the allowed range (272.15 K <= T <= 403.15 K)
required from medium model "SimpleLiquidWater".
Failed condition: tank1.medium.T >= 272.15 and tank1.medium.T <= 403.15
It is not clear from the error message that the temperate is just outside the range.
Note that the first part is a string that is generated according to the Modelica specification.
It could be improved as follows:
Use more digits in the message, by using String(T, 11) or so
Exclude the boundaries in the message, but that would conflict with the actual condition, and excluding that might lead to more problems.
Make the assert-text even simpler (perhaps "Temperature is not in the allowed range") and leave the debugging messages to the tools; especially avoid duplicating information that is already part of the code (such as boundaries).
Note that there are may be many such messages so we need a consistent update. And it is likely that most cases of hitting the boundaries will generate such messages, as continuous variables are likely to slowly drift over the boundaries.
The text was updated successfully, but these errors were encountered:
Consider the following model:
The problem is that tank1.T slightly drops (about 2.5 mK) during the first 100 s, and thus it triggers the following assert:
Generating:
It is not clear from the error message that the temperate is just outside the range.
Note that the first part is a string that is generated according to the Modelica specification.
It could be improved as follows:
String(T, 11)
or soNote that there are may be many such messages so we need a consistent update. And it is likely that most cases of hitting the boundaries will generate such messages, as continuous variables are likely to slowly drift over the boundaries.
The text was updated successfully, but these errors were encountered: