Opened 7 years ago

Last modified 6 years ago

#4840 closed defect

Error in evaluating sine phases — at Version 2

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.

Change History (5)

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, 7 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, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.