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: massimo ceraolo Owned by: Lennart Ochel
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 massimo ceraolo 7 years ago.
RL.txt (60.5 KB ) - added by massimo ceraolo 7 years ago.
RL.png (123.0 KB ) - added by massimo ceraolo 7 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by massimo ceraolo, 7 years ago

Summary: Unist of measure in output matlab fileUnits of measure in output matlab file

comment:2 by Lennart Ochel, 7 years ago

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

in reply to:  2 comment:3 by massimo ceraolo, 7 years ago

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?

by massimo ceraolo, 7 years ago

Attachment: RL.mo added

by massimo ceraolo, 7 years ago

Attachment: RL.txt added

by massimo ceraolo, 7 years ago

Attachment: RL.png added

comment:4 by massimo ceraolo, 7 years ago

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

comment:5 by Lennart Ochel, 7 years ago

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

Owner: changed from somebody to Lennart Ochel
Status: newaccepted

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

comment:7 by Lennart Ochel, 7 years ago

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

comment:8 by massimo ceraolo, 7 years ago

Is it there in v1.13.0 dev 166?

comment:9 by Lennart Ochel, 7 years ago

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

comment:10 by massimo ceraolo, 7 years ago

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

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

comment:12 by Lennart Ochel, 7 years ago

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

in reply to:  12 comment:13 by Lennart Ochel, 7 years ago

Resolution: fixed
Status: acceptedclosed

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

comment:14 by massimo ceraolo, 7 years ago

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 not optimal. Better would 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.

Last edited 7 years ago by massimo ceraolo (previous) (diff)
Note: See TracTickets for help on using tickets.