﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5332	The NF does not evaluate a function with constant arguments	Francesco Casella	Per Östlund	"The model {{{Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem}}} simulates with the NF, but produces wrong results, which do not pass verification. It works fine with the NF.

The {{{-d=optdaedump}}} output shows the following equations:
{{{
body2.g_0[3] = SpringDamperSystem.world.gravityAcceleration({bar2.frame_b.r_0[1] + body2.r_CM[1], body2.r_CM[2] - p2.s, body2.r_CM[3]}, Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -Modelica.Mechanics.MultiBody.World.g, 0.0}, Modelica.Mechanics.MultiBody.World.mue)[3]   [dynamic |0|0|0|0|] 
body2.g_0[2] = SpringDamperSystem.world.gravityAcceleration({bar2.frame_b.r_0[1] + body2.r_CM[1], body2.r_CM[2] - p2.s, body2.r_CM[3]}, Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -Modelica.Mechanics.MultiBody.World.g, 0.0}, Modelica.Mechanics.MultiBody.World.mue)[2]   [dynamic |0|0|0|0|] 
body2.g_0[1] = SpringDamperSystem.world.gravityAcceleration({bar2.frame_b.r_0[1] + body2.r_CM[1], body2.r_CM[2] - p2.s, body2.r_CM[3]}, Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -Modelica.Mechanics.MultiBody.World.g, 0.0}, Modelica.Mechanics.MultiBody.World.mue)[1]   [dynamic |0|0|0|0|] 
body1.g_0[1] = SpringDamperSystem.world.gravityAcceleration(body1.frame_a.r_0 + {spring1.frame_b.R.T[1,1] * body1.r_CM[1] + spring1.frame_b.R.T[2,1] * body1.r_CM[2] + spring1.frame_b.R.T[3,1] * body1.r_CM[3], spring1.frame_b.R.T[1,2] * body1.r_CM[1] + spring1.frame_b.R.T[2,2] * body1.r_CM[2] + spring1.frame_b.R.T[3,2] * body1.r_CM[3], spring1.frame_b.R.T[1,3] * body1.r_CM[1] + spring1.frame_b.R.T[2,3] * body1.r_CM[2] + spring1.frame_b.R.T[3,3] * body1.r_CM[3]}, Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -Modelica.Mechanics.MultiBody.World.g, 0.0}, Modelica.Mechanics.MultiBody.World.mue)[1]   [dynamic |0|0|0|0|] 
body1.g_0[2] = SpringDamperSystem.world.gravityAcceleration(body1.frame_a.r_0 + {spring1.frame_b.R.T[1,1] * body1.r_CM[1] + spring1.frame_b.R.T[2,1] * body1.r_CM[2] + spring1.frame_b.R.T[3,1] * body1.r_CM[3], spring1.frame_b.R.T[1,2] * body1.r_CM[1] + spring1.frame_b.R.T[2,2] * body1.r_CM[2] + spring1.frame_b.R.T[3,2] * body1.r_CM[3], spring1.frame_b.R.T[1,3] * body1.r_CM[1] + spring1.frame_b.R.T[2,3] * body1.r_CM[2] + spring1.frame_b.R.T[3,3] * body1.r_CM[3]}, Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -Modelica.Mechanics.MultiBody.World.g, 0.0}, Modelica.Mechanics.MultiBody.World.mue)[2]   [dynamic |0|0|0|0|] 
body1.g_0[3] = SpringDamperSystem.world.gravityAcceleration(body1.frame_a.r_0 + {spring1.frame_b.R.T[1,1] * body1.r_CM[1] + spring1.frame_b.R.T[2,1] * body1.r_CM[2] + spring1.frame_b.R.T[3,1] * body1.r_CM[3], spring1.frame_b.R.T[1,2] * body1.r_CM[1] + spring1.frame_b.R.T[2,2] * body1.r_CM[2] + spring1.frame_b.R.T[3,2] * body1.r_CM[3], spring1.frame_b.R.T[1,3] * body1.r_CM[1] + spring1.frame_b.R.T[2,3] * body1.r_CM[2] + spring1.frame_b.R.T[3,3] * body1.r_CM[3]}, Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -Modelica.Mechanics.MultiBody.World.g, 0.0}, Modelica.Mechanics.MultiBody.World.mue)[3]   [dynamic |0|0|0|0|] 
}}}
while the same output with the OF doesn't show any call to gravityAcceleration. In fact, the first and third components of {{{g_0}}} are identically zero, while the second is constant and equal to -9.81. These values should be constant evaluated by the NF, so that the BE can make all the corresponding symbolic simplifications. 

I strongly suspect that the lack of these constant evaluations causes the numerical issues reported in #5328, and possibly other verification failures in the MultiBody library, so I would suggest to fix this with high priority."	defect	closed	high	2.0.0	New Instantiation		fixed		
