Open Ja98 opened 6 years ago
For the first error, do you get any further if you set T=300
for now?
The second error could possibly be fixed by changing line 264 to phi = phi_in
instead of the connect statement.
The connect statement seems to be illegal, but Dymola accepts such things :-(
To get more hints, also check that single model in Dymola, and also check it in pedantic mode.
The same variable was mentioned in #111 so probably that code should be made more standard-compliant.
Thanks, it seems these variable are buried somewhere deep in the model: is it possible to change the value of AirpathPrescribedMassFlowRate.T
and Ambient.phi
in the example script without editing the library file?
You would have to edit the library file, but the error message tells you the file and line. You might want to start using git to track what you changed & when, and be able to reset to a previous state.
Yes I use Git with the official package so I can keep track of updates but I wouldn't want to disrupt the main BuildingSystems package with my changes. I guess the next best thing would be to export a copy of only the required elements and dependencies into a new package that could then be referenced, rather than the BuildingSystems Library? Do you know if this is possible?
The pedantic check in Dymola does not indicate any additional warnings - does the check need to be done with simulation?
The first correction you suggested worked but the replacement of connect(phi, phi_in)
with phi = phi_in
results in:
Error at line 103, column 48, in file 'C:\Local Modelica Libraries\BuildingSystems\BuildingSystems\Buildings\Ambient.mo':
The component phi_in is conditional: Access of conditional components is only valid in connect statements
Error at line 264, column 11, in file 'C:\Local Modelica Libraries\BuildingSystems\BuildingSystems\Buildings\Ambient.mo':
The component phi_in is conditional: Access of conditional components is only valid in connect statements
I noticed that phi is defined also on line 103. Deletion of the entire conditional argument on line 264 results in the following error:
Error at line 103, column 48, in file 'C:\Local Modelica Libraries\BuildingSystems\BuildingSystems\Buildings\Ambient.mo':
The component phi_in is conditional: Access of conditional components is only valid in connect statements
OK, maybe replace
// Select source for relative humidity of the ambient air
if phiSou == BuildingSystems.Buildings.Types.DataSource.Parameter then
phi = phi_constant;
elseif phiSou == BuildingSystems.Buildings.Types.DataSource.File then
phi = weatherData.y[6];
else
connect(phi, phi_in);
end if;
with
// Select source for relative humidity of the ambient air
phi = if (phiSou == BuildingSystems.Buildings.Types.DataSource.Parameter) then phi_constant
elseif (phiSou == BuildingSystems.Buildings.Types.DataSource.File) then weatherData.y[6]
else phi_in;
or does that still give the error wrt conditional components!?
https://github.com/xogeny/ModelicaBook/issues/338
Regarding the git workflow: You should click the "Fork" button, then you have a copy where you can do whatever you want. You can have multiple remotes. When you do changes, always create a branch first. Do not work in the master branch, because that branch will change and then you get merge conflicts.
phi is instantiated in line 103, in line 212 the equation section starts, in line 264 phi is assigned a value.
Thanks very much for the git tips! Yes, unfortunately even when I replace that script, I am still getting the error:
Error at line 261, column 12, in file 'C:\Local Modelica Libraries\Forked\BuildingSystems Forked\BuildingSystems\Buildings\Ambient.mo':
The component phi_in is conditional: Access of conditional components is only valid in connect statements
I have followed the tutorial in the UserGuide for the SimpleBuildingModel. The model seems to run fine in Dymola but I get the following errors when compiling in JModelica:
Any suggestions on why this is happening and what can be done to resolve it?