﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5056	Issue with MultiBody models in the NF due to missing evaluation during flattening	Francesco Casella	Per Östlund	"After @adrpo's commits for overconstrained connectors, the MultiBody examples all flatten and produce a balanced system of equations. Howevver, there are still problems that prevents them to run. 

Please check [https://libraries.openmodelica.org/branches/newInst/Modelica_trunk/files/Modelica_trunk_Modelica.Mechanics.MultiBody.Examples.Constraints.UniversalConstraint.err Modelica.Mechanics.MultiBody.Examples.Constraints.UniversalConstraint]. The following error is reported:
{{{
[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS/OpenModelica/OMCompiler/Compiler/BackEnd/Differentiate.mo:402:3-402:155:writable] Error: Derivative of expression ""joint.revolute_b.R_rel.T[1,2] = (matrix({1.0, 0.0, 0.0}) * transpose(matrix({1.0, 0.0, 0.0})))[1, 2] - (matrix({1.0, 0.0, 0.0}) * transpose(matrix({1.0, 0.0, 0.0})))[1, 2] * cos(joint.phi_b)"" w.r.t. ""time"" is non-existent.
[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS/OpenModelica/OMCompiler/build/lib/omlibrary/Modelica trunk/Mechanics/MultiBody/Joints.mo:306:7-306:60:writable] Error: Internal error 
Differentiate.differentiateEquationTime failed for joint.revolute_b.R_rel.T[1,2] = (matrix({1.0, 0.0, 0.0}) * transpose(matrix({1.0, 0.0, 0.0})))[1, 2] - (matrix({1.0, 0.0, 0.0}) * transpose(matrix({1.0, 0.0, 0.0})))[1, 2] * cos(joint.phi_b)
Error: Internal error - IndexReduction.pantelidesIndexReduction1 failed! Use -d=bltdump to get more information.
}}}
For some reason, the expression
{{{
(matrix({1.0, 0.0, 0.0}) * transpose(matrix({1.0, 0.0, 0.0})))[1, 2] 
- (matrix({1.0, 0.0, 0.0}) * transpose(matrix({1.0, 0.0, 0.0})))[1, 2] * cos(joint.phi_b)
}}}
is not evaluated appropriately during flattening, causing a failure of Pantelides's algoritm later on."	defect	closed	high	2.0.0	New Instantiation		fixed		
