-
Notifications
You must be signed in to change notification settings - Fork 2
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
Subtyping violations according to System Modeler #2
Comments
It's likely that the models are invalid, unfortunately neither OpenModelica nor Dymola are apparently strict enough to check subtyping constraints in simulation models. I'll ask @perost to check that and open a ticket with DS asap. I'll add the constrainedby clauses to the source code ASAP.
Absolutely.
I guess you are referring to these lines: SOFCPoliMi/SOFCPoliMi/Components/FuelCell/Stack.mo Lines 88 to 91 in 4269463
That's a good point. The reason we didn't put |
As you say there's no way to redeclare individual elements, but that doesn't mean that redeclares are exempt from the |
I guess that would be a good reason to change the rule (Ockham rules!), but as long as it is in force, I'll fix the code to follow it. |
Can you remind me of a single case where the |
I understood from @perost that having this indication is sparing him a lot of work in potentially ambiguous situations. Maybe he can comment on that directly. |
Fixed in ab05ba4. |
Should be fixed by 27cfa95. Please try again. |
I don't think I've ever claimed that it makes anything easier, only that there are situations where not having |
I needed to change two more places for
I am now investigating the problems appearing next… |
Neither can I. But I think it would be important to have them clear. Either 'each' is necessary or it is redundant. If it is necessary, we just need to always put it when needed, as the MLS says. If it isn't, then we could discuss whether to make it optional or even remove it. |
Done in c08f438
Good luck with that 😅 |
So far I have failed to make sense of our error messages, so I suggest closing this issue as fixed. For the purpose of contributing to modelica/ModelicaSpecification#3578, any chance we could try a Base Modelica variant of the model? |
I tried to export it but the example is definitely non-trivial and we have a glitch with constant start attributes in Medium records 😓 I'll try to provide one ASAP. |
@henrikt-ma we fixed the previous problem but we are still generating somewhat invalid Base Modelica code due to some record definition issue, see OpenModelica/OpenModelica#13009. As soon as that issue is resolved, I hope to be able to provide you with a fully functional Base Modelica version of the SOFC model. |
In the interest of contributing to the discussion in modelica/ModelicaSpecification#3578, I'd like to be able to try the examples of this library in Wolfram System Modeler. Unfortunately the examples I have tried are rejected due to subtype relations not being fulfilled. Is this an error in the library, or is System Modeler rejecting invalid models?
Starting with
BenchmarkCammarata
, the first reported violation looks like this:The source location is pointing here:
Would it be possible to solve this by introducing a more restrictive
constrainedby
inStack
, instead of getting theChannelReactionRatesCO2
as implicit constraint?On a different topic which doesn't seem big enough for opening a separate issue just yet, System Modeler complains about missing
each
inSOFCPoliMi.Components.FuelCell.Stack
:The text was updated successfully, but these errors were encountered: