Search code examples
modelicaopenmodelica

Mismatch of equations and variables in modelica microgrid model


I am getting an error of 297 equations and 300 variables. Previous all of of my modelica buildings model have had a match. However, this time there is a mismatch, and I am not sure why. I redid the connections, but I am still getting the 297/300 error. Is there a way of debugging mismatched equation/variables in modelica other than redoing the model? Everything seems fine to me, but I am not sure why there is a mismatch. I uploaded an image of the model and its code to this post. Thank you for the help

enter image description here

https://drive.google.com/file/d/13oxasXd-8wH8nN97sRXpl_XeU5I4k5j5/view?usp=sharing

Edit:

Adding one side connection error: enter image description here


Solution

  • There should be a message regarding the singularity. Dymola outputs something like:

    Singularity error message

    The connection seems to be there, but it should be a connection with four variables. In the current model, only the first one is connected. Therefore, three equations are missing. You need to be careful to connect all variables when drawing the connection. In Dymola, this would look like this:

    Create vector connection

    The important part is to have colons (":") in the connection. The GUI should generate the respective code: connect(multiplex4.y[:], peak_shaver.uR[:]).

    You could as well change the code manually. Both ways should result in which replaces the original line which had ones instead of the colons.

    This fixes the issue for me at least...