Opened 7 years ago

Last modified 7 years ago

#4588 assigned discussion

Unit propagation and deduction.

Reported by: massimo ceraolo Owned by: Lennart Ochel
Priority: normal Milestone: Future
Component: Backend Version:
Keywords: Cc:

Description

Consider the model units.mo (attached).
It contains a feedback fed by two inputs with known units (m/s)
Shouldn't they be propagated to the feedback inputs and also, by deduction, to the feedback output?

Dymola shows for the two feedback inputs m/s, as expected, while for the output, unexpectedly, no unit.
OM (1.13-dev 89) shows no unit for feedback inputs and output.

Attachments (1)

units.mo (1.6 KB ) - added by massimo ceraolo 7 years ago.

Download all attachments as: .zip

Change History (4)

by massimo ceraolo, 7 years ago

Attachment: units.mo added

comment:1 by Lennart Ochel, 7 years ago

Component: *unknown*Backend
Owner: changed from somebody to Lennart Ochel
Status: newassigned

comment:2 by Lennart Ochel, 7 years ago

Following the Modelica discussions about unit checking, there will be no unit propagation soon. The idea is to only spot structural errors by using the given unit information. Unit propagation may hide such errors.

Therefore, I am not sure whether I will fix this or not.

Last edited 7 years ago by Lennart Ochel (previous) (diff)

comment:3 by Francesco Casella, 7 years ago

The discussion on unit checking is interesting and it may have an interesting outcome in the long term. That said, I don't think there will be any conflicts with this simple rule:

For each set of alias variables, if a subset of them have the same unit string and the remaining elements have an empty unit string, then they also get the same unit string automatically.

My suggestion is that this simple rule is implemented. It shouldn't take much time. If a = b or a + b = 0 there is no question whatsoever that a and b have the same unit, so I am sure this rule won't conflict with anything that could come out of the on-going discussion.

Note: See TracTickets for help on using tickets.