Opened 7 years ago

Last modified 7 years ago

#4721 new discussion

Complex variables do not show documentation string in Variables Browser

Reported by: Christian Kral <dr.christian.kral@…> Owned by: adeas31
Priority: high Milestone: Future
Component: OMEdit Version:
Keywords: Cc: casella, a.haumer@…

Description

Consider the following example:

model Test
  Modelica.SIunits.ComplexCurrent I = Complex(1,2) "Complex current";
end Test;

After simulating this model, the documentation string of the current is NOT shown in the Description column of the Variables Browser (see attachment). Two more comments on this:

  1. I tried the same thing in Dymola and the documentation string "Complex current" is not shown either. I am thus not sure whether this an implementation issue of OpenModelica (and Dymola) or a language issue, that the documentation string is not shown.
  2. The real and imaginary parts are also missing the documentation string, but this is a design issue of the MSL, see https://github.com/modelica/Modelica/issues/2443

Comments are highly appreciated.

Attachments (1)

TestNoDescription.png (7.5 KB) - added by Christian Kral <dr.christian.kral@…> 7 years ago.
Image showing that the description is missing

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Christian Kral <dr.christian.kral@…>

Image showing that the description is missing

comment:1 Changed 7 years ago by sjoelund.se

That there is no string for I is very natural: that variable doesn't exist in the flattened model. And the description for I.re and I.im comes from the ComplexCurrent class.

comment:2 Changed 7 years ago by casella

From an end-user perspective, Complex numbers should have all the features of Real numbers, including the ability of seeing an explanation of what the variable means, taken from the comments to the Complex variable itself. It would be quite weird if the convienience of using Complex number came at the price of losing that information.

I guess this is a special case of a general issue, i.e., that only showing the comments of flattened variables causes the loss valuable information in the comments that should be displayed instead. Consider this example

model A
  Real x "Variable x";
  Real y "Variable y";
end A;

model B "My system"
  A a1 "Black model";
  A a2 "Red model";
end B;

When browsing the results of the simulation of model B, it would be nice to see in the browser which variables belong to Red model and which to the Black model, which is not clear by just looking at the model names, like this

B        My System
|- a1     Black model
|  |- x    Variable x
|  |- y    Variable y
|
|- a2     Red model
   |- x    Variable x
   |- y    Variable y

This requires to store the comments of all the classes that are eventually flattened to scalar variables in the result file, and to display them in the simulation browser.

Maybe this issue should also be discussed in the MA issue tracker?

comment:3 Changed 7 years ago by Christian Kral <dr.christian.kral@…>

Note: See TracTickets for help on using tickets.