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 Adeel Asghar, 10 years ago

Component: OMEditCode Generation
Owner: changed from Adeel Asghar to Willi Braun
Status: newassigned

The problem is in the model_init.xml file which is used by OMEdit to get the unit values.

comment:2 by Lennart Ochel, 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 Martin Sjölund, 10 years ago

Milestone: 1.9.11.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 Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:5 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:6 by Francesco Casella, 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

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:9 by Francesco Casella, 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.

in reply to:  9 comment:10 by Lennart Ochel, 9 years ago

Owner: changed from Willi Braun to Lennart Ochel
Status: assignedaccepted

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:11 by Lennart Ochel, 9 years ago

OMCompiler#881 provides unit information for state derivatives.

comment:12 by Francesco Casella, 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:13 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:14 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:15 by Francesco Casella, 7 years ago

Milestone: 1.12.01.13.0

Milestone moved to 1.13.0 due to 1.12.0 already being released.

comment:16 by Christoph Buchner <buchner@…>, 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).

in reply to:  16 comment:17 by Francesco Casella, 7 years ago

Owner: changed from Lennart Ochel to Adeel Asghar
Status: acceptedassigned

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), not s_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 Adeel Asghar, 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 Francesco Casella, 7 years ago

Cc: Mahder Alemseged Gebremedhin 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:20 by Mahder Alemseged Gebremedhin, 7 years ago

Sorry I am late to this. I will take a look.

comment:21 by Francesco Casella, 7 years ago

Owner: changed from Adeel Asghar to Mahder Alemseged Gebremedhin

Thank you @mahge930!

comment:22 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:23 by Francesco Casella, 5 years ago

@mahge930, any chance you can fix this issue now, in time for the 1.14.0 release?

Thanks!

comment:24 by Francesco Casella, 5 years ago

Milestone: 1.14.01.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:25 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:26 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:27 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.