Opened 7 years ago

Closed 6 years ago

#4840 closed defect (fixed)

OMEdit does not use displayUnit unit conversion on parameter arrays of component array instances

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: blocker Milestone: 1.13.0
Component: OMEdit Version:
Keywords: Cc:

Description (last modified by massimo ceraolo)

Consider the enclosed model BugSources. the source voltages are correct (plot1.png).
Let us now set phase of sineVoltage component to {0,120,240} It should still create three sines equally spaced in time. However this happens not to be true (plot2.png).
Since the circuit is very simple, and uses only MSL components, I think this issue is severe.

Attachments (3)

BugSources.mo (2.2 KB ) - added by massimo ceraolo 7 years ago.
Plot1.png (12.7 KB ) - added by massimo ceraolo 7 years ago.
Plot2.png (11.5 KB ) - added by massimo ceraolo 7 years ago.

Download all attachments as: .zip

Change History (8)

by massimo ceraolo, 7 years ago

Attachment: BugSources.mo added

by massimo ceraolo, 7 years ago

Attachment: Plot1.png added

by massimo ceraolo, 7 years ago

Attachment: Plot2.png added

comment:1 by Francesco Casella, 6 years ago

The problem here is that the expression {0, 120, 240} is not converted from deg to radians, but just passed literally as a modifier; hence, the meaning is 0, 120 rad, 240 rad.

There is some ambiguity on the meaning of the units tab: when a literal constant is used, it is converted from the display unit to SI unit, while any other type of expression is passed literally as a modifier. Unfortunately there is no feedback about this from the GUI, one has to check the code in the text view. In this case, the array {0, 120, 240} is interpreted as an expression and thus used literally as a modifier.

In fact, what this ticket points out is that it is actually impossible to use displayUnit for parameter input of component arrays, which is a serious limitation.

@adeas31, do you think that also converting arrays of literal values from displayUnit to SI unit is doable for 1.13.0?

comment:2 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:3 by Francesco Casella, 6 years ago

Summary: Error in evaluating sine phasesOMEdit does not use displayUnit unit conversion on parameter arrays of component array instances

Changed title to better reflect the issue

comment:4 by Adeel Asghar, 6 years ago

At least the array expression with constant values should work fine with 862a324/OMEdit.

comment:5 by Francesco Casella, 6 years ago

Resolution: fixed
Status: newclosed

This issue is fixed in 1.13.0-dev.beta1

Note: See TracTickets for help on using tickets.