Opened 5 years ago
Closed 5 years ago
#5542 closed defect (fixed)
OMC generates simulation code out of systems with invalid connections
Reported by: | Francesco Casella | Owned by: | Per Östlund |
---|---|---|---|
Priority: | blocker | Milestone: | 1.14.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: | massimo ceraolo |
Description (last modified by )
Consider the attached test case, where an electrical pin is connected to a thermal port. OMC generates simulation code out of it and runs a simulation.
Besides the obvious questions: what equations were actually put in the system and what does the corresponding simulation result mean, there is a more fundamental problem: this violates a basic rule in connections, see Sect. 9.1 of the specification, which reads
In a connect-equation the two connectors must have the same named component elements with the same dimensions; recursively down to the primitive components. The primitive components with the same name are matched and belong to the same connection set.
This behaviour is obtained both from the OF and from the NF. I guess we should just care to fix it in the NF.
@perost, is this an easy fix or a complex one? It would be nice to get it in 1.14.0, but if we can't, feel free to move it to 2.0.0
Attachments (1)
Change History (5)
by , 5 years ago
Attachment: | TestConnection.mo added |
---|
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 5 years ago
comment:3 by , 5 years ago
Replying to perost:
It's a trivial fix, I've fixed it in PR #276.
Very good, thanks!
The error message isn't very good though, since it just says that the types of the connectors are incompatible. But fixing that will have to wait until later, implementing good error handling in MetaModelica is unfortunately rather annoying since the language doesn't have proper exception handling.
OK, I've opened #5545 on this topic. I guess it's not critical, particularly once we solve #5543, because then such incompatible connections will be very rare.
I'll check this with the nightly build on Monday and then close the ticket if it's ok.
comment:4 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I checked with the nighly build, looks good.
Replying to casella:
It's a trivial fix, I've fixed it in PR #276.
The error message isn't very good though, since it just says that the types of the connectors are incompatible. But fixing that will have to wait until later, implementing good error handling in MetaModelica is unfortunately rather annoying since the language doesn't have proper exception handling.