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

Multiple fails in Controls package in OpenModelica #1348

Closed
FWuellhorst opened this issue Oct 7, 2022 · 3 comments · Fixed by #1370
Closed

Multiple fails in Controls package in OpenModelica #1348

FWuellhorst opened this issue Oct 7, 2022 · 3 comments · Fixed by #1370
Assignees
Labels
OpenModelica Related to usage in OM

Comments

@FWuellhorst
Copy link
Contributor

Describe the bug
Some models in the package Controls fail in OpenModelica.

Error logs

 Error in model:  AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.BookTrading 
Failed to build model: AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.BookTrading
[C:/OM119/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFExpression.mo:1551:7-1552:100:writable] Error: Internal error NFExpression.makeSubscriptedExp: too few dimensions in [3551555559.0, 30; 3551555577.0, 20; 3551555588.0, 20] to apply subscripts [<bookSellerAgent, bookSellerAgent>]


 
 Error in model:  AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.NetworkCommunication1 
Failed to build model: AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.NetworkCommunication1
[C:/OM119/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFExpression.mo:1551:7-1552:100:writable] Error: Internal error NFExpression.makeSubscriptedExp: too few dimensions in [3551555589.0, 30; 3551555559.0, 40; 3551555556.0, 20] to apply subscripts [<bookSellerAgent1, bookSellerAgent1>]


 
 Error in model:  AixLib.Controls.HVACAgentBasedControl.Examples.BuildingHeatingSystems.BuildingHeating 
Failed to build model: AixLib.Controls.HVACAgentBasedControl.Examples.BuildingHeatingSystems.BuildingHeating
[D:/04_git/AixLib/AixLib/DataBase/ThermalZones/ZoneBaseRecord.mo:130:40-130:53:writable] Notification: From here:
[D:/04_git/AixLib/AixLib/DataBase/ThermalZones/ZoneBaseRecord.mo:130:3-130:296:writable] Error: Non-array modification ‘"W/m2"‘ for array component ‘unit‘, possibly due to missing ‘each‘.
[D:/04_git/AixLib/AixLib/DataBase/ThermalZones/ZoneBaseRecord.mo:14:3-15:39:writable] Error: Could not evaluate structural parameter (or constant): thermalZone.zoneParam.nOrientations which gives dimensions of array: AWin. Array dimensions must be known at compile time.


 
 Error in model:  AixLib.Controls.HVACAgentBasedControl.Examples.BuildingHeatingSystems.BuildingWithPV 
Failed to build model: AixLib.Controls.HVACAgentBasedControl.Examples.BuildingHeatingSystems.BuildingWithPV
[D:/04_git/AixLib/AixLib/DataBase/ThermalZones/ZoneBaseRecord.mo:130:40-130:53:writable] Notification: From here:
[D:/04_git/AixLib/AixLib/DataBase/ThermalZones/ZoneBaseRecord.mo:130:3-130:296:writable] Error: Non-array modification ‘"W/m2"‘ for array component ‘unit‘, possibly due to missing ‘each‘.
[D:/04_git/AixLib/AixLib/DataBase/ThermalZones/ZoneBaseRecord.mo:14:3-15:39:writable] Error: Could not evaluate structural parameter (or constant): thermalZone.zoneParam.nOrientations which gives dimensions of array: AWin. Array dimensions must be known at compile time.


 
 Error in model:  AixLib.Controls.HeatPump.Examples.HeatPumpController 
Failed to build model: AixLib.Controls.HeatPump.Examples.HeatPumpController
Error: Too few equations, under-determined system. The model has 47 equation(s) and 48 variable(s).
[D:/04_git/AixLib/AixLib/Controls/Interfaces/VapourCompressionMachineControlBus.mo:12:3-14:55:writable] Warning: Variable hPControllerOnOff.heatPumpControlBus.onOffMea does not have any remaining equation to be solved in.
  The original equations were:
  Equation 32: hPControllerOnOff.heatPumpControlBus.onOffMea = showOnOff.activePort, which needs to solve for showOnOff.activePort
  Equation 31: hPControllerOnOff.heatPumpControlBus.onOffMea = output_on, which needs to solve for output_on
  Equation 30: hPControllerOnOff.heatPumpControlBus.onOffMea = heatPumpControlBus.onOffMea, which needs to solve for heatPumpControlBus.onOffMea

 Error in model:  AixLib.Controls.Interfaces.ModularHeatPumpControlBus 
[D:/04_git/AixLib/AixLib/Controls/Interfaces/ModularSensorControlBus.mo:36:27-36:35:writable] Notification: From here:
[D:/04_git/AixLib/AixLib/Controls/Interfaces/ModularSensorControlBus.mo:36:3-38:68:writable] Error: Non-array modification ‘"1"‘ for array component ‘unit‘, possibly due to missing ‘each‘.


 
 Error in model:  AixLib.Controls.Interfaces.ModularSensorControlBus 
[D:/04_git/AixLib/AixLib/Controls/Interfaces/ModularSensorControlBus.mo:36:27-36:35:writable] Notification: From here:
[D:/04_git/AixLib/AixLib/Controls/Interfaces/ModularSensorControlBus.mo:36:3-38:68:writable] Error: Non-array modification ‘"1"‘ for array component ‘unit‘, possibly due to missing ‘each‘.

 Error in model:  AixLib.Controls.HeatPump.SafetyControls.OnOffControl 
[D:/04_git/AixLib/AixLib/Controls/HeatPump/SafetyControls/OnOffControl.mo:25:3-27:73:writable] Error: The conditional expression use_runPerHou could not be evaluated.


 Error in model:  AixLib.Controls.HeatPump.HPControl 
[D:/04_git/AixLib/AixLib/Controls/SetPoints/Functions/HeatingCurveFunction.mo:7:3-8:78:writable] Error: Invalid public variable TDesign, function variables that are not input/output must be protected.


 Error in model:  AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.BookTrading 
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: The model can't be instantiated due to top-level outer element ‘messageNotification‘, it may only be used as part of a simulation model.
[D:/04_git/AixLib/AixLib/Controls/HVACAgentBasedControl/BaseClasses/PartialAgent.mo:9:3-10:12:writable] Warning: An inner declaration for outer component messageNotification could not be found and was automatically generated.
[C:/OM119/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFExpression.mo:1551:7-1552:100:writable] Error: Internal error NFExpression.makeSubscriptedExp: too few dimensions in [3551555559.0, 30; 3551555577.0, 20; 3551555588.0, 20] to apply subscripts [<bookSellerAgent, bookSellerAgent>]


 
 Error in model:  AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.NetworkCommunication1 
[C:/OM119/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFExpression.mo:1551:7-1552:100:writable] Error: Internal error NFExpression.makeSubscriptedExp: too few dimensions in [3551555589.0, 30; 3551555559.0, 40; 3551555556.0, 20] to apply subscripts [<bookSellerAgent1, bookSellerAgent1>]

@FWuellhorst FWuellhorst added the OpenModelica Related to usage in OM label Oct 7, 2022
@tosch4 tosch4 added this to the Hackday 10.2022 milestone Oct 12, 2022
@DaJansenGit DaJansenGit self-assigned this Oct 13, 2022
@DaJansenGit
Copy link
Member

DaJansenGit commented Oct 13, 2022

There seems to be a similar issue documented (and solved?) here

@DaJansenGit
Copy link
Member

DaJansenGit commented Oct 13, 2022

The following models check well in Dymola 2023 in pedantic mode:

  • AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.NetworkCommunication1
  • AixLib.Controls.HVACAgentBasedControl.Examples.BookTrading.BookTrading

Was not able to track down the bug in OM any further. I opened an issue in OpenModelica: OpenModelica/OpenModelica#9510

Additionally, I found that the above-mentioned models as well as the Modelica DeviceDrivers Example Modelica_DeviceDrivers.Blocks.Examples.TestSerialPackager_UDP fail to simulate in Dymola 2023.
The error message is

MDDUDPSocket.h: socket failed with error: 10022

The stack of functions is:
Modelica_DeviceDrivers.Communication.UDPSocket
Modelica_DeviceDrivers.Communication.UDPSocket(0, 0, true, 1, 0)

I opened an issue for this in Modelica_DeviceDrivers as well, as this problem was addressed already before in their repository: modelica-3rdparty/Modelica_DeviceDrivers#364

If the mentioned problems can't be solved, we should consider moving the models to obsolete.

@DaJansenGit
Copy link
Member

DaJansenGit commented Oct 13, 2022

Working models:

  • AixLib.Controls.Interfaces.ModularHeatPumpControlBus
  • AixLib.Controls.Interfaces.ModularSensorControlBus
  • AixLib.Controls.HeatPump.SafetyControls.OnOffControl @FWuellhorst is working on this on another branch
  • AixLib.Controls.HeatPump.HPControl @FWuellhorst is working on this on another branch
  • AixLib.Controls.HVACAgentBasedControl.Examples.BuildingHeatingSystems.BuildingWithPV This will be adressed in the ReducedOrder fails in OpenModelica #1349 issue
  • AixLib.Controls.HVACAgentBasedControl.Examples.BuildingHeatingSystems.BuildingHeating This will be adressed in the ReducedOrder fails in OpenModelica #1349 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenModelica Related to usage in OM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants