﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4795	Flattening error for a model with substructure	Niklas Worschech	Martin Sjölund	"if we use this model
{{{#!mo
model SimpleModelWithSubstructure
  parameter Real qNom[:, 2] = [0.0, 0.0001; 5.0, 0.001; 10.0, 0.01];
  parameter Integer n = size(qNom, 1);  
  parameter Real dhydMax[n, 1] = [{Modelica.Math.Nonlinear.solveOneNonlinearEquation(function dhydCalc(qNom = qNom[i, 2]), 0, 1e-1, 1e-13) for i in 1:n}];  
  function dhydCalc 
    extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction;
    input Real qNom;
  algorithm
    y := u - 1e-3;
  end dhydCalc;
end SimpleModelWithSubstructure;
}}}
inside a other model

{{{#!mo
model SimpleModelWithSubstructure_TC01
  SimpleModelWithSubstructure simpleModelWithSubstructure1;
end SimpleModelWithSubstructure_TC01;
}}}

we got the error:
Error occurred while flattening model SimpleModelWithSubstructure_TC01
The model for itself alone can be translated.
With the flags
-d=failtrace --showErrorMessages
we got the attached log file


"	defect	closed	critical	1.13.0	Frontend		fixed	flattening error	Bernd.Schmidt6@…
