-
Notifications
You must be signed in to change notification settings - Fork 59
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
Invalid connection between connectors #1317
Comments
Thank you for checking this. I get similar errors when I do a pedantic check in Dymola. The origin of the problem lies in the model declaration of Therefore, the connection between an input/output with the I'll have to check with the developers of those components why they used this implementation using |
In general, we (Wolfram) try to enforce rules from the language specification in System Modeler, so we treat this as an error in System Modeler. |
@maltelenz the connector IDEAS.Buildings.Components.Interfaces.SolBus[numSolBus] solBus(each outputAngles=outputAngles) annotation (); This does not have an input/output specifier nor do the connectors defined therein since their causalities depend on which component they are used in. In some cases the variables are inputs and in other cases they are outputs. So it seems inappropriate/counterproductive to assign a causality. I'm not even sure that this is an error since it seems like a completely valid use case. What section of the Modelica specification is this conflicting with? |
https://specification.modelica.org/maint/3.6/connectors-and-connections.html#S3.I1.i5.p1 (emphasis mine):
|
@maltelenz thanks for looking that up for us! Reading that, I'm wondering whether it's an option to remove the |
That doesn't solve the problem, instead I get the same error in other places. Here is the first:
Additionally, I guess you would run into the restriction here:
If you want to use |
That error makes sense. There will always be some point where a causal variable must be connected to the bus. So that's not an option. Perhaps it's an option to make an input IDEAS.Buildings.Components.Interfaces.SolBus[numSolBus] solBus(each outputAngles=outputAngles) annotation (); and an output IDEAS.Buildings.Components.Interfaces.SolBus[numSolBus] solBus(each outputAngles=outputAngles) annotation (); and revise all component models that use a weather bus accordingly. Chances are that we'd have to do the same to I think this should work for many models but likely not all. One exception is My impression is that the Modelica spec is ruling out some valid use cases by constraints quoted by @maltelenz . My suggestion would be to keep the implementation of IDEAS as it is for now, unless someone wants to take on the challenge to fix this of course :) |
God knows, maybe it helps to make the connector expandable.. :p It used to be expandable in the past so it should work. You can give that a try too. |
Making the connectors expandable (e.g. Before applying this to all connectors, we first need to set up our CI runner again (#1316) to make sure all our models still work. In the meantime, I'll already create a pull request for this issue. |
…expandable, to avoid errors as mentioned in issue #1317.
I tried running the example using the branch from the pull request in System Modeler, but for some reason System Modeler is taking forever, which would indicate a bug in System Modeler. I would say that is an inconclusive result with regards to the validity of the model, but if Dymola doesn't complain with pedantic checking, that is probably a good sign. |
A an expandable connector containing a vector of expandable connectors in an inner/outer component (i.e. the SimInfoManager) is of course a bit complex. And not all tools may fully support this corner case. This is the reason why we removed the |
When I validate
IDEAS.BoundaryConditions.Examples.SimInfoManager
in Wolfram System Modeler, I get (the first of many similar messages):which I agree with.
The location referred to is:
IDEAS/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo
Line 413 in 2488d28
In
IDEAS.BoundaryConditions.SolarIrradiation.RadSol
sim.radSol.solBus
is declared asoutput
. I would expect some matchinginput
prefix for the other part of the connection,sim.weaBus.solBus
, but was unable to find one.Did I miss something?
The text was updated successfully, but these errors were encountered: