Opened 15 years ago

Last modified 15 years ago

#1139 closed defect (fixed)

Problems with functions in functions (from MathCore)

Reported by: brugard Owned by: brugard
Priority: critical Milestone:
Component: Version:
Keywords: Cc: brugard, sjoelund.se

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)

1139.mo (1.7 KB) - added by sjoelund.se 15 years ago.
Works For Me (TM): Attached the actual output from OpenModelica r4842

Download all attachments as: .zip

Change History (2)

Changed 15 years ago by sjoelund.se

Works For Me (TM): Attached the actual output from OpenModelica r4842

Note: See TracTickets for help on using tickets.