﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5083	Issue with MultiBody models in the NF due to lack of scalar product expansion	Francesco Casella	Per Östlund	"Please check [https://libraries.openmodelica.org/branches/newInst/Modelica_trunk/files/Modelica_trunk_Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses.sim Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses]. Some analysis carried out with the transformational debugger reveals that the equation
{{{
revolute1.tau = -revolute1.frame_b.t * revolute1.e;
}}}
coming out of the NF is firsts transformed by substitution into
{{{
revolute1.constantTorque.tau_constant = 
  -{-bodyBox1.frame_a.t[1], -bodyBox1.frame_a.t[2], -bodyBox1.frame_a.t[3]} * revolute1.e
}}}
which is correct, and then solved in the torn section of a nonlinear system as
{{{
bodyBox1.frame_a.t[2] =
  (-({-bodyBox1.frame_a.t[1], -0.0, -bodyBox1.frame_a.t[3]} * revolute1.e + revolute1.constantTorque.tau_constant)) / ({-0.0, -1.0, -0.0} * revolute1.e)
}}}
which seems to me plain wrong, and causes a division by zero, as {{{revolute1.e={0,0,1} }}}.

The old FE instead expands the scalar product in the equation, passing it to the back-end as
{{{
  revolute1.tau = (-revolute1.frame_b.t[3]) * revolute1.e[3] - revolute1.frame_b.t[1] * revolute1.e[1] - revolute1.frame_b.t[2] * revolute1.e[2];
}}}
which allows the back-end to process the equations correctly and eventually find the [https://libraries.openmodelica.org/branches/master/Modelica_trunk/files/Modelica_trunk_Modelica.Mechanics.MultiBody.Examples.Elementary.LineForceWithTwoMasses.sim correct result]. This issue currently prevents a lot of MultiBody models to simulate when using the NF.

I see two problems here. The first is that the NF does not expand {{{revolute1.e}}} into its components and does not compute the scalar product explicitly, as the OF did. If this could be fixed, we should hopefully get most of the MultiBody models to work with the NF.

The second is that the back-end solves an equation in a way that I cannot explain and seems to me plain wrong. I'll open a separate ticket on this topic."	defect	new	high	2.0.0	New Instantiation				
