Opened 15 years ago
Last modified 15 years ago
#1139 closed defect (fixed)
Problems with functions in functions (from MathCore)
Reported by: | Jan Brugård | Owned by: | Jan Brugård |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Jan Brugård, Martin Sjölund |
Description
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.
Attachments (1)
Change History (2)
comment:1 by , 15 years ago
by , 15 years ago
Works For Me (TM): Attached the actual output from OpenModelica r4842
http://intranet/trac/mathmodelica/ticket/2584