Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

model compilation error

model compilation error

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, and then demodulates it. The ideal version works great. (test.mo in the attached zip file)
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;

Googling this error brings me to this forum. Previous reports of this error message seem to be related to an algebraic loop. Lo and behold: inserting a unit delay did solve the problem.
I find this strange, since at the model level it does not contain any loops (test_error.mo). If an algebraic loop does exist, then I believe this is generated by openmodelica (in a library, the code translator. Maybe I'm doing something illegal according to the language.
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!

Another possibility is that the filter somehow has a problem with the switched nature of the output of the multiplexer. The error message refers to the index-generator for the multiplexer. The switching is triggered by a "sample()" function.

Would anyone please  like to comment on this or give direction how to solve this?

Update June 11 2020: I loaded the model in a trial version of dymola. Dymola has no problem with the model. Therefore I consider this an openmodelica bug.

Best regards,
Paul van der Hulst

PS I'm a newbie regarding openmodelica, 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.

Edited by: paulvdh - Jun-11-20 13:05:16
There are 0 guests and 0 other users also viewing this topic