#4820 closed defect (duplicate)
Issue with functions having array arguments in NF
Reported by: | Francesco Casella | Owned by: | Mahder Alemseged Gebremedhin |
---|---|---|---|
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 by , 7 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 by , 7 years ago
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 by , 7 years ago
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:5 by , 7 years ago
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...
Duplicate of #4846.