ModiaSim / Modia.jl

Modeling and simulation of multidomain engineering systems
MIT License
319 stars 37 forks source link

Modia.jl 0.6.1 instantiatemodel fails #137

Closed valfaro closed 2 years ago

valfaro commented 2 years ago

Programs that run fine under Modlia v0.6.0 do not run now under Modia v0.6.1.

Errors messages include for example: "The number of unknowns (13) and equations (1) is not equal!" "The DAE has no unique solution, because 12 equation(s) missing!"

It seems that at instantiate the model the prefix "up." is added to each unknown variable.

Annexed a CSTR model simulation program for testing. test_modia060.zip

MartinOtter commented 2 years ago

Please check: There is one non-backwards compatible change as stated in the release notes:

If equations are not recognized, there are not enough equations.

MartinOtter commented 2 years ago

I had a quick look at test_modia060.zip. If you change meq = :[.. ] to equations = :[..], the model will work.

valfaro commented 2 years ago

Thank you for your prompt response.

I find the "equations" keyword requirement back in ModiaLang release V0.11.0 notes but not in Modia V0.6.1. Sorry for the inconvenience.

Please notice that the first two model examples in Modia Tutorial use the keyword "equation".

It seems that for models based only on connection equations, "connect" and "equations" can be used.

MartinOtter commented 2 years ago

I am very sorry, this should not have happened:

I have fixed these issues now by releasing a new version 0.7.0 and adapted the docs and the tests, so runtests.jl is now successful. I have also written more detailed release notes. Please have especially a look into the non-backwards compatible changes.

It seems that for models based only on connection equations, "connect" and "equations" can be used.

Yes. But I recognized that the "merge" operator should "merge" connect statements. This is done, if the connects are inside equations, but not if key "connect" is used. This can be seen as a bug (I will open a ticket for this issue).