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

Compilation failed though equations and variables are equal in number

Compilation failed though equations and variables are equal in number

Hi,
I'm trying to develop a distillation model. Checked the model and the no. of variables = no. of equations. Since the model is highly non linear, i gave initial guesses for some variables. When I tried to simulate, OM couldn't compile it. I'm attaching the screenshot for the same.

https://openmodelica.org/images/agorapro/attachments/5044/mini_distillation.PNG

Any possible reasons for it?  (do the start values effect compilation?)

-Swaroop

Attachments:

Re: Compilation failed though equations and variables are equal in number

This looks like a bug in OpenModelica. Can you share the model? The error message doesn’t provide enough information to fix it. 

Re: Compilation failed though equations and variables are equal in number





distillation.mo

Hi,
Functions required are in Functions package, Database has values required for those functions, Model is distillation. If I simulate distillation.mo, it fails at compilation.

-Swaroop

Edited by: swaroop.katta - Jun-21-17 11:01:49
Attachments:

Re: Compilation failed though equations and variables are equal in number

Where is `Thermodynamic_Functions` definied?

I get the following error message:

Code:

[Functions.mo:19:5-19:82:writable] Error: Class Thermodynamic_Functions.HV not found in scope Functions.HLiqId (looking for a function or record).

Error: Error occurred while flattening model distillation

Re: Compilation failed though equations and variables are equal in number

Hi,
I'm sorry.
Seems like changing the attachment is not working! can you please change line 19 in Functions.mo package from "Thermodynamic_Functions.HV()" to just "Functions.HV()"  (remove "Thermodynamic_") and run distillation.mo

-Swaroop



Edited by: swaroop.katta - Jun-21-17 11:46:57

Re: Compilation failed though equations and variables are equal in number

Hi again,
Here are the things that went wrong on my side: I declared an array of size 10 but in for loop i used 11th element of that array in an equation. Checking and instantiation didn't consider that 11th element (that variable was simply neglected ). However while compiling it considered that variable which was not declared in the first place (I checked C file). So, I made a change to that equation and it worked fine.

I think it would be better if OM gives a warning that array size has been extended.

Thanks,
Swaroop.

Re: Compilation failed though equations and variables are equal in number

Thanks, now I see the issue. I will bring it up in the weekly developer meeting.

There are 0 guests and 0 other users also viewing this topic
You are here: