Opened 8 years ago

Closed 8 years ago

#4125 closed defect (fixed)

OMEdit incorrect plotting after unit conversion

Reported by: crupp@… Owned by: Adrian Pop
Priority: blocker Milestone: Future
Component: Interactive Environment Version: v1.11.0
Keywords: Cc:

Description

Using the MSL model Modelica.Mechanics.Rotational.Examples.First, OMEdit will incorrectly plot the results of damper.phi_rel after simulation. However, if the result file is loaded into a new session of OMEdit, the plot will be correct.

I believe this issue is related to the units conversion from rad->deg. The conversion factor from rad->deg seems to be -0.936887 as found via the OMEdit CLI, which is obviously incorrect. If the display unit is set to radians then the plot is correct, but when set to degrees the plot is scaled by this factor.

Using OMEdit v1.11.0-dev-188-g9100a82 and OpenModelica v1.11.0-dev-203-g8747e2f.

Change History (6)

comment:1 by crupp@…, 8 years ago

It also seems to only affect Windows, since I can't reproduce it on Linux.

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

What does OMShell say about the following commands on Windows?

>>> getVersion()
"OpenModelica 1.11.0~dev-321-g5aa0206"
>>> convertUnits("deg", "rad")
(true,57.29577951308232,0.0)
>>> convertUnits("rad", "deg")
(true,0.0174532925199433,0.0)

comment:3 by Adeel Asghar, 8 years ago

>> getVersion()
"OpenModelica v1.11.0-dev-207-g1731292"

>> convertUnits("deg", "rad")
(true,-1.067364264763636,-0.0)

>> convertUnits("rad", "deg")
(true,-0.9368872773920779,0.0)

comment:4 by Adeel Asghar, 8 years ago

Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Adrian Pop
Status: newassigned

comment:5 by Adrian Pop, 8 years ago

Fix in progress via https://github.com/OpenModelica/OMCompiler/pull/1331.
Before and after :)

adrpo33@ida-0030 MINGW32 /c/home/adrpo33/dev/OMTesting/
$ time ~/dev/OpenModelica/build/bin/omc convertUnits.mos
(true,-1.067364264763636,-0.0)
(true,-0.9368872773920779,0.0)

adrpo33@ida-0030 MINGW32 /c/home/adrpo33/dev/OMTesting/
$ time ~/dev/OpenModelica/build/bin/omc convertUnits.mos
(true,57.29577951308232,0.0)
(true,0.0174532925199433,0.0)

comment:6 by Adrian Pop, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 5042c6/OMCompiler.

Note: See TracTickets for help on using tickets.