Opened 10 years ago

Closed 3 years ago

#3303 closed defect (fixed)

wrongly detected under-determined system, probably caused by combination of algorithm and arrays

Reported by: torsten.knodt+org.openmodelica@… Owned by: somebody
Priority: high Milestone: 1.19.0
Component: Backend Version: trunk
Keywords: Cc:

Description

I am fairly new to Modelica, but I am quite sure this is a bug or at least a bad error message:
Error: Too few equations, under-determined system. The model has 4 equation(s) and 5 variable(s).
Error: Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!

The array used in the testcase has a size of 1. When I change to an equivalent model without an array, it works.

Attachments (1)

testcase.mo (396 bytes ) - added by torsten.knodt+org.openmodelica@… 10 years ago.
Model failing to compile

Download all attachments as: .zip

Change History (4)

by torsten.knodt+org.openmodelica@…, 10 years ago

Attachment: testcase.mo added

Model failing to compile

comment:1 by Lennart Ochel, 10 years ago

Component: UnknownBackend

It seems that this is an issue with counting algorithm outputs due to array crefs.

comment:2 by torsten.knodt+org.openmodelica@…, 9 years ago

I do not know if this information helps to get this fixed. When I manually unroll the for loop in the AD_Converter algorithm section, the error is gone.
Example:

-    for i in 1:N loop
-      y[i] := if mod(z, 2) > 0 then L.'1' else L.'0';
-      z := div(z, 2);
-    end for;
+    y[1] := if mod(z, 2) > 0 then L.'1' else L.'0';
+    z := div(z, 2);
+    y[2] := if mod(z, 2) > 0 then L.'1' else L.'0';
+    z := div(z, 2);

Also the error is gone when I implement exact the same in the testcase, instead of using a separate model for AD_Converter.
I also did a test with removing all pins and replacing them with equation u=0 in AD_Converter. There the results are the same. Except when I add +d=vectorize, I get an over-determined system with 0 variables (which is obviously correct).

Adding +d=checkBackendDae to omc -s gives the following error message:
Error: Variable i from Expression: vsense_adc[1].y[i] not found in scope BackendDAE object.

comment:3 by Per Östlund, 3 years ago

Milestone: Future1.19.0
Resolution: fixed
Status: newclosed

This seems to have been fixed at some point, the model now simulates fine and is reported to have 14 variables and 14 equations.

Note: See TracTickets for help on using tickets.