﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5115	The NF does not expand array() operator in Modelica.Magnetics.FundamentalWave models	Francesco Casella	Per Östlund	"Please consider [https://libraries.openmodelica.org/branches/newInst/Modelica_trunk/files/Modelica_trunk_Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.AIMC_Conveyor.err Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.AIMC_Conveyor]. The compilation of the C code fails with errors on expressions involving sine and cosine function calls on temp variables.

A search for {{{'sin('}}} in the NF-flattened model reveals the following equation:
{{{
  vfController.y = array(sin({vfController.x + vfController.BasePhase + vfController.orientation[1], vfController.x + vfController.BasePhase + vfController.orientation[2], vfController.x + vfController.BasePhase + vfController.orientation[3]}[$i1]) for $i1 in 1:3) * vfController.amplitude;
}}}
which the old FE expands into
{{{
  vfController.y[1] = sin(vfController.x + vfController.BasePhase + vfController.orientation[1]) * vfController.amplitude;
  vfController.y[2] = sin(vfController.x + vfController.BasePhase + vfController.orientation[2]) * vfController.amplitude;
  vfController.y[3] = sin(vfController.x + vfController.BasePhase + vfController.orientation[3]) * vfController.amplitude;
}}}
I guess {{{array}}} operators should not be passed to the back-end in general, at least as long as the current back-end is in place.
"	defect	closed	high	2.0.0	New Instantiation		fixed		
