﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3388	Instantation uses parameter value instead of parameter reference	carlj@…	somebody	"This was found using 1.9.3~dev-542.

Create a new model with a Modelica.Mechanics.MultiBody.World and a Modelica.Mechanics.MultiBody.Parts.Body.
After the model has been flattened, the equation

{{{
g_0 = world.gravityAcceleration(frame_a.r_0 + Frames.resolve1(frame_a.R, r_CM));
}}}


in the body component has been transformed to:


{{{
body1.g_0 = Modelica.Mechanics.MultiBody.World.gravityAcceleration({body1.frame_a.r_0[1], body1.frame_a.r_0[2], body1.frame_a.r_0[3]} + Modelica.Mechanics.MultiBody.Frames.resolve1(body1.frame_a.R, {body1.r_CM[1], body1.r_CM[2], body1.r_CM[3]}), Modelica.Mechanics.MultiBody.Types.GravityTypes.UniformGravity, {0.0, -9.81, 0.0}, 398600000000000.0);
}}}

where the numeric value for world.g has been used instead of component reference to world.g.

GravityAcceleration in the world component is defined as

{{{
replaceable function gravityAcceleration = Modelica.Mechanics.MultiBody.Forces.Internal.standardGravityAcceleration(gravityType = gravityType, g = g * Modelica.Math.Vectors.normalizeWithAssert(n), mue = mue) constrainedby Modelica.Mechanics.MultiBody.Interfaces.partialGravityAcceleration
}}}


and world.g is a parameter

{{{
  parameter SI.Acceleration g = 9.81.
}}}

So here, the reference to the parameter g in the definition of gravityAcceleration has unnecessarily been replaced with its value, 9.81, which removes the possibility to change the gravity after building the model.
"	defect	closed	high	1.16.0	New Instantiation	trunk	fixed		
