﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1139	Problems with functions in functions (from MathCore)	Jan Brugård	Jan Brugård	"There are problems with functions that lookes like:

X=function1(function2(Y));

I think that there are several bug reported on this problem, I found
#2535
#2566
Hopefully the fix is the same for all these bugs, and therefore I have made this more general ticket. Please fill in the list if more similar tickets are found.

Here is an other example:
In Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape, there is the row:
 {{{ Real e_y[3](each final unit=""1"")=noEvent(cross(Modelica.Math.Vectors.normalize(cross(e_x, if n_z_aux*n_z_aux > 1e-06 then widthDirection else if abs(e_x[1]) > 1e-06 then {0,1,0} else {1,0,0})), e_x)) annotation(HideResult=true);}}}
That doesn't work. Off course it is possible to rewrite these expressions to something like:
{{{

  temp2=if n_z_aux*n_z_aux > 1e-06 then widthDirection else if abs(e_x[1]) > 1e-06 then {0,1,0} else {1,0,0};
  temp1=cross(e_x, temp2);
  temp3=Modelica.Math.Vectors.normalize(temp1);
  e_y=noEvent(cross(temp3, e_x));
}}}
And then the model is ok. But it would be a lot of work to do that for the whole Modelica3."	defect	closed	critical				fixed		Jan Brugård Martin Sjölund
