Opened 10 years ago
Last modified 3 years ago
#2750 assigned defect
Units of derivatives in the variables browser
Reported by: | Francesco Casella | Owned by: | Mahder Alemseged Gebremedhin |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Code Generation | Version: | trunk |
Keywords: | Cc: | Mahder Alemseged Gebremedhin |
Description
Currently, if a certain variable v has the attribute unit = "u", then also its time derivative is displayed with the same unit "u". Of course it should be "u/s".
Change History (27)
comment:1 by , 10 years ago
Component: | OMEdit → Code Generation |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 10 years ago
This is a basic error. Currently, time
is treated without any unit, but it has to be in "s".
comment:3 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:4 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:6 by , 9 years ago
Please have this issue fixed asap, it should be very straightforward:
- the predefined variable time should have quantity = "Time" and unit = 's', see Modelica Language Specification, section 3.6.7
- all derivatives with respect to time should have s-1 added to their unit
follow-up: 10 comment:9 by , 9 years ago
The situation has slightly improved, in the sense that now no unit at all is displayed in the variable browser. This is better than having the wrong unit, but it would be good to have the right one in place.
comment:10 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | assigned → accepted |
Replying to casella:
The situation has slightly improved, in the sense that now no unit at all is displayed in the variable browser. This is better than having the wrong unit, but it would be good to have the right one in place.
Sure, I just removed the wrong units in a first step, because that was easy. I will adapt the back end unit module to provide the right units.
comment:12 by , 8 years ago
It seems there are still some problems left.
Try simulating Modelica.Mechanics.Translational.Examples.Dampers
. Some differentiated variables, e.g., damper1.der(s_l)
now have the correct unit, some others, e.g., mass1.der(s)
are still left without any unit.
comment:14 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:15 by , 7 years ago
Milestone: | 1.12.0 → 1.13.0 |
---|
Milestone moved to 1.13.0 due to 1.12.0 already being released.
follow-up: 17 comment:16 by , 7 years ago
I just checked with a recent 1.13 dev version, and the situation from comment:12 is still present (although it's damper1.der(s_rel)
, not s_l
).
comment:17 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
Replying to Christoph Buchner <buchner@…>:
I just checked with a recent 1.13 dev version, and the situation from comment:12 is still present (although it's
damper1.der(s_rel)
, nots_l
).
The problem is still there as of OMEdit v1.13.0-dev-115-ga31e9070 (64-bit).
@adeas31, can you please have a look?
comment:18 by , 7 years ago
Its still the problem of unit module. The model_init.xml
contains,
<ScalarVariable name = "der(damper1.s_rel)" valueReference = "1006" description = "der(Relative distance (= flange_b.s - flange_a.s))" variability = "continuous" isDiscrete = "false" causality = "internal" isValueChangeable = "false" alias = "noAlias" classIndex = "0" classType = "rDer" isProtected = "false" hideResult = "false" fileName = "C:/OpenModelica/build/lib/omlibrary/Modelica 3.2.2/Mechanics/Translational.mo" startLine = "4687" startColumn = "7" endLine = "4690" endColumn = "75" fileWritable = "true"> <Real fixed="false" useNominal="false" unit="m.s-1" /> </ScalarVariable>
For der(damper1.s_rel)
the unit information is available.
<ScalarVariable name = "der(mass1.s)" valueReference = "1017" description = "Absolute position of center of component (s = flange_a.s + L/2 = flange_b.s - L/2)" variability = "continuous" isDiscrete = "false" causality = "internal" isValueChangeable = "false" alias = "noAlias" classIndex = "5" classType = "rAlg" isProtected = "false" hideResult = "false" fileName = "C:/OpenModelica/build/lib/omlibrary/Modelica 3.2.2/Mechanics/Translational.mo" startLine = "4622" startColumn = "7" endLine = "4623" endColumn = "93" fileWritable = "true"> <Real fixed="false" useNominal="false" /> </ScalarVariable>
For der(mass1.s)
the unit attribute is missing.
comment:19 by , 7 years ago
Cc: | added |
---|
@mahge930 used to work on this, but I get he's now 100% busy with his PhD work. Anyone else can fix this?
comment:23 by , 5 years ago
@mahge930, any chance you can fix this issue now, in time for the 1.14.0 release?
Thanks!
comment:24 by , 5 years ago
Milestone: | 1.14.0 → 1.16.0 |
---|
Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0
comment:26 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
The problem is in the model_init.xml file which is used by OMEdit to get the unit values.