Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4668 closed defect (fixed)

noEvent returns the wrong type in NF

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check

https://libraries.openmodelica.org/branches/newInst/Modelica_3.2.2/files/Modelica_3.2.2_Modelica.Electrical.Machines.Examples.DCMachines.DCPM_withLosses.err

The reported error is:

[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS
 /OpenModelica/OMCompiler/build/lib/omlibrary
 /Modelica 3.2.2/Electrical/Machines.mo:11251:9-11253:69:writable]
 Error: Type mismatch for positional argument 1 in
 noEvent(x=(abs(dcpm1.friction.w) > dcpm1.friction.frictionParameters.wLinear)).
 The argument has type: Boolean expected type: Real

The offending code reads:

if noEvent(abs(w)>frictionParameters.wLinear)

noEvent should return the same type as the contained expression, not Real.

Change History (1)

comment:1 by Per Östlund, 7 years ago

Resolution: fixed
Status: newclosed

Fixed in 117eefb. The model now simulates, but I haven't verified the result. The model does not in fact simulate, I just forgot to turn on the newInst flag. But the issue with noEvent is fixed.

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