Opened 7 years ago

Closed 7 years ago

#4643 closed defect (fixed)

Problems with scalar x array multiplication in NF

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

Description

Consider this test case

model M
  Real k = 2;
  Real v[2] = {10, 20};
  Real w[2] = k*v;
end M;

The NF responds

Cannot resolve type of expression ' k .* v '.
The operands have types ' Real .* Real[2] ' in component Real.

Why is .* considered and not *?

This affects several models in the MSL 3.2.2, e.g. Modelica.Blocks.Examples.NoiseExamples.DrydenContinuousTurbulence

Change History (3)

comment:1 by Francesco Casella, 7 years ago

Same problem with vector*vector scalar product

model M
  Real v[2] = {10, 20};
  Real w[2] = {2, 4};
  Real k = v*w;
end M;

gives

Cannot resolve type of expression ' v .* w '. 
xThe operands have types ' Real[2] .* Real[2] ' in component Real[2].

This also affects models in the MSL, e.g., Modelica.Electrical.PowerConverters.Examples.DCAC.MultiPhaseTwoLevel.MultiPhaseTwoLevel_R

comment:2 by Per Östlund, 7 years ago

Fixed in 8d40bd2. DrydenContinuousTurbulence still fails with an error message that looks like this is still an issue, but it's actually due to a need for improved subscripting.

comment:3 by Francesco Casella, 7 years ago

Resolution: fixed
Status: newclosed

This specific issue seems to be fixed as of 07-02-2018, so I'm closing the ticket

Note: See TracTickets for help on using tickets.