Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#4820 closed defect (duplicate)

Issue with functions having array arguments in NF

Reported by: casella Owned by: mahge930
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check Modelica.Mechanics.Rotational.Examples.SimpleGearShift.err. The following error is reported:

[Modelica 3.2.2/Mechanics/Rotational.mo:3754:7-3762:85:writable]
Error: Cannot resolve type of expression  - 
Modelica.Math.Vectors.interpolate(clutch.mue_pos[:, 1], clutch.mue_pos[:, 2], clutch.w_rel, 1).
The operands have types (Real, Integer) in component <NO_COMPONENT>.

Change History (5)

comment:1 Changed 6 years ago by perost

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #4846.

comment:2 Changed 6 years ago by casella

You are right. In the new ticket I (possibly) identified the root cause as being due to slicing, not to functions per se, but I'm not 100% sure about that.

comment:3 Changed 6 years ago by perost

The issue is actually that interpolate has two outputs ((Real Integer) is a tuple type), which the unary minus operator doesn't know what to do with.

comment:4 Changed 6 years ago by casella

Ah, I missed that - actually meant the unary minus operator :)

comment:5 Changed 6 years ago by perost

An easy mistake to make. In some of the error messages for the new frontend I use single quotes around the expression to make it clearer what the expression actually is, since using naked variable names can lead to some very confusing error messages otherwise. I want to update all the old error messages some time too, but that doesn't have very high priority right now.

And Martin also pointed out that single quotes are used by quoted identifiers in Modelica, and that we should use ‘ instead of '. So now I'll have to go back and change all the new error messages too. I should open a ticket about that...

Note: See TracTickets for help on using tickets.