- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Compilation failed though equations...
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.
Any possible reasons for it? (do the start values effect compilation?)
-Swaroop
- swaroop.katta
- 23 Posts
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.
- lochel
- 45 Posts
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
- swaroop.katta
- 23 Posts
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
- lochel
- 45 Posts
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
- swaroop.katta
- 23 Posts
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.
- swaroop.katta
- 23 Posts
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.
- lochel
- 45 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Compilation failed though equations...