﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6003	Code generation bug	p.van.der.hulst@…	Karim Adbdelhak	"Hi,

For a project at my new job I decided to move to openmodelica. My first experiment is an ideal time-division multiplexing system. It passes multiple signals through a single signal path during consecutive intervals.
To make the model more realistic, I added a low-pass filter in the signal path. Now I get a compilation error:
test_error_02nls.c: In function 'initializeStaticDataNLS14':
test_error_02nls.c:45:87: error: 'INTEGER_ATTRIBUTE {aka struct INTEGER_ATTRIBUTE}' has no member named 'nominal'
   sysData->nominal[i] = data->modelData->integerVarsData[0].attribute /* MpxIndex.y */.nominal;

Previous reports of this error message seem to be related to an algebraic loop. Lo and behold: inserting a unit delay before the filter did solve the problem.
I find this strange, since at the model level it does not contain any loops.
The most surprising thing is that in any other simulation program, a low-pass filter breaks an algebraic loop because it places an integrator in the loop. Here it ''creates'' an algebraic loop!

I loaded the model in a trial version of dymola. Dymola has no problem with the model. Therefore I consider this an openmodelica bug.

I'll enclose a demo project (main model: test_error.mo)

Best regards,
Paul van der Hulst

PS I'm a newbie regarding (open)modelica, but have many years of experience simulating switched systems with simulink and various other simulation packages, including modification of an RK4 integration engine to properly handle state-events. "	defect	assigned	high		Backend	v1.14.1			
