Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4582 closed enhancement (fixed)

Units of measure in output matlab file

Reported by: ceraolo Owned by: lochel
Priority: normal Milestone: 1.13.0
Component: Run-time Version:
Keywords: Cc:

Description

I have a tool which, among other things, can read Dymola and OM output (matlab) files and allows plotting, looking at numerical data, exporting selected variables, exporting plots of various types, doing post-processing (including fourier Analysis), etc.
It is intended to be used by people that want to share simulation results with others, which don't want to install large (as OM) or commercial (as Dymola) programs just to read and post-process outputs.

I will distribute this tool for free.

The only issue I currently have regards units of measure.
Dymola outputs units of measure appending them to the elements of the "description" matrix. OM does not.
Is it possible to do the same OM? This would avoid to distribute an additional output file (i.e. the xml) just to read units of measure.

Attachments (3)

RL.mo (2.1 KB) - added by ceraolo 7 years ago.
RL.txt (60.5 KB) - added by ceraolo 7 years ago.
RL.png (123.0 KB) - added by ceraolo 7 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 7 years ago by ceraolo

  • Summary changed from Unist of measure in output matlab file to Units of measure in output matlab file

comment:2 follow-up: Changed 7 years ago by lochel

I support this request. Can you elaborate how the extended description matrix should look like?

comment:3 in reply to: ↑ 2 Changed 7 years ago by ceraolo

Replying to lochel:

I support this request. Can you elaborate how the extended description matrix should look like?

Very good!
I learned the mat file from Dymola and OM looking at the txt file produced by Dymola.
In enclose for instance a RL.mo, and the corresponding txt RL.txt as created by Dymola when requiring text output.
The structure of the mat file is practically identical, except for obvious difference and exchange rows<->columns. Moreover in the txt file there are comments that allowed me to understand the binary mat file structure.

You see that the rows (in the txt file) of description-matrix in dymola are the actual descriptions present in the mo file (see RL.png) with the addition of the units of measure within brackets.
I propose to replicate this in OM.

Naturally OM should be able to interpret this changed mat structure.
I mean, probably it should drop back again these units of measure when it reads mat files. I noted that OM is already capable to read dymolas's mat files, but does not retrieve the descriptions. Is this because it finds these units of measure at their end?

Changed 7 years ago by ceraolo

Changed 7 years ago by ceraolo

Changed 7 years ago by ceraolo

comment:4 Changed 7 years ago by ceraolo

@lochel
Are my information and the file supplied sufficient? Do I need to add something else?
Thanks.

comment:5 Changed 7 years ago by lochel

Sorry, I missed your message. I think the information is sufficient. However, I will come back to you if needed.
First, I have to check if the unit information are available at runtime or not.

comment:6 Changed 7 years ago by lochel

  • Owner changed from somebody to lochel
  • Status changed from new to accepted

I added unit information to the new mat file implementation that will be available soon: OMCompiler#1952.

comment:7 Changed 7 years ago by lochel

@ceraolo Unit information are now available. Please do some testing if it works as expected.

comment:8 Changed 7 years ago by ceraolo

Is it there in v1.13.0 dev 166?

comment:9 Changed 7 years ago by lochel

No, it will be available in tomorrow’s nightly build.

comment:10 Changed 7 years ago by ceraolo

I've checked. I can read units of measure of all variables very well.

However, I miss units of measure for parameters. As you can see they are present in RL.txt.

Can they be added as well?
Thank you.

comment:11 Changed 7 years ago by lochel

Oops! You are right, I forgot to implement it for the parameters. Thanks for testing.

comment:12 follow-up: Changed 7 years ago by lochel

Unit information for parameters are now available (see OMCompiler#1964). However, I just realized that there are still no unit information for alias variables...

comment:13 in reply to: ↑ 12 Changed 7 years ago by lochel

  • Resolution set to fixed
  • Status changed from accepted to closed

Aliases are now handled as well (see OMCompiler#1965).

comment:14 Changed 7 years ago by ceraolo

Everything is ok with RL-mo.

Just for those that are curious, my plotting and postprocessing tools can be retrieved from:
http://www.dsea.unipi.it/Members/ceraolow/Software/mcs-plotxy/

The Modelica-specific documentation is at page 47 of tutorial.pdf.
The same link will be available soon slso from the modelica.org Internet site.

A final note: OM shows as unit of measure of der(i) in RL "s-1.A", which is wrong (should be "A/s"
or A.s-1. But this is not directly related to this ticket, since this the unit I see also from OMEdit.

Version 0, edited 7 years ago by ceraolo (next)
Note: See TracTickets for help on using tickets.