Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5348 closed defect (fixed)

Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!

Reported by: KieranF <kieran.fung@…> Owned by: Francesco Casella
Priority: high Milestone: Future
Component: OMSimulator Version:
Keywords: Pantelides, PFPlusExt, Reduction Method, Singular, Structurally, time-dependant Cc:

Description

I have never seen this type of error before while using OpenModelica and have run out of solutions on how to trouble shoot this error.

I made this HRSG Rankine cycle model imitating a couple of different types of examples available on the Modelica Library. The model can instantiate however when it comes times to simulate my model, this and (6) other errors appear.

Change History (6)

comment:1 by Francesco Casella, 6 years ago

Owner: changed from Lennart Ochel to Francesco Casella
Status: newassigned

@KieranF, I am taking the opportunity to clean up the examples of the ThermoPower library (including HRB and RankineCycle), that used obsolete models and had some issues with OMC. ThermoPower library has been developed with Dymola and, although

I guess we should analyze this kind of issues once you have taken the updated library as a starting point.

I'm also completely rewriting the models in the Electrical package, which were not really object-oriented, based on my recent experience with the PowerGrids library. This may require some update to the electrical part of the models, which is in any case extremely simplified.

I'm not done yet, but I hope to be in a few more days. I would suggest you to check the GitHub commit log for updates, and to use the latest version on the master branch you can get from the Git repository, rather than the version that is shipped with OpenModelica. You can clone the library on your file system and then open the package.mo file in the root directory, or (if you use GIT), clone the repo and keep it up-to-date by pulling regularly from the origin repo.

comment:2 by Adrian Pop, 6 years ago

Resolution: fixed
Status: assignedclosed

Duplicate of #5349.

comment:3 by KieranF <kieran.fung@…>, 6 years ago

@casella ,

Thanks for getting back to me. I actually had no idea that models and components from the ThermoPower Library had issues with them. I guess that explains why I could simulate the Brayton Cycle but also not being able to simulate the Rankine Cycle.

With that being said, I did visit the Git repository you kindly hyperlinked above. I was successfully able to pull the "ThermoPower-Master" folder from the repository. However, I was able to open all of the files within "ThermoPower-Master" except the "package.mo" model. The OMEdit gives me an error saying something like ... ,"Redefining class(es) ThermoPower which already exist(s). Delete the existing class(es) before loading the file/library C:/Users/kfung/Downloads/ThermoPower-master/ThermoPower-master/ThermoPower/package.mo.

I believe my issue has something to do with not opening it properly to the root directory like you mentioned above. This is the one file that was not able to open directly from the Git repository and believe there is more to it than expected.

I also believe this is the reason why the Rankine Cycle, pulled from the updated Git repository still could not simulate. I must be missing some edits that are located inside of the "package.mo" file.

Finally I would like to address some confusion I had with this Ticket and a copied Ticket version going by #5349. I just wanted to make sure that I am responding correctly to you and or @ardpo for this Ticket process. It looks like the uploaded files I meant to be analyzed ended up on Ticket #5349 where I had cloned a library HRSG_3LRh model along with its base class to be used in my HRSG Rankine cycle model. I would really appreciate it if you could give me an update on the ThermoPower Library's HRSG_3LRh reliability and if I should reconsider waiting for an updated and fixed version of this.

Thank you for your time @casella I hope to hear back.

in reply to:  3 comment:4 by Francesco Casella, 6 years ago

Replying to KieranF <kieran.fung@…>:

@casella ,
With that being said, I did visit the Git repository you kindly hyperlinked above. I was successfully able to pull the "ThermoPower-Master" folder from the repository. However, I was able to open all of the files within "ThermoPower-Master" except the "package.mo" model. The OMEdit gives me an error saying something like ... ,"Redefining class(es) ThermoPower which already exist(s). Delete the existing class(es) before loading the file/library C:/Users/kfung/Downloads/ThermoPower-master/ThermoPower-master/ThermoPower/package.mo.

When you open any other file than package.mo, the whole package is loaded automatically. Then, if you try to load package.mo again, OMEdit complains that you are trying to load a package which is already loaded. If you just open package.mo, it should be fine.

I also believe this is the reason why the Rankine Cycle, pulled from the updated Git repository still could not simulate. I must be missing some edits that are located inside of the "package.mo" file.

That would have been too easy :)

Finally I would like to address some confusion I had with this Ticket and a copied Ticket version going by #5349. I just wanted to make sure that I am responding correctly to you and or @ardpo for this Ticket process. It looks like the uploaded files I meant to be analyzed ended up on Ticket #5349 where I had cloned a library HRSG_3LRh model along with its base class to be used in my HRSG Rankine cycle model. I would really appreciate it if you could give me an update on the ThermoPower Library's HRSG_3LRh reliability and if I should reconsider waiting for an updated and fixed version of this.

Please open a ticket on this specific subject, I'll be happy to follow that up.

comment:5 by KieranF <kieran.fung@…>, 6 years ago

Hey @casella,

I am still not 100% certain whether I used the current master branch that you hyperlinked above ... I only say this because I still was not able to simulate the closed Rankine Cycle Example from the ThermoPower Library.

The issue I had earlier stemmed from the package.mo file that was within the master folder.

This time most recently, I initially started by opening that file first, which opened OMEdit as well as loaded the ThermoPower Library. Then I opened the rest of the Master folder. By opening the package.mo file first, I was able to conclude the package was opened without trying to "open it again" like how I previously mentioned above.

However, when trying to simulate, I only received translation warnings, which made me think that it was a step in the right direction since no errors were received. But still, no simulations so I am unsure whther it was correct or not. The warnings I received are copied below:

[1] 10:14:06 Translation Notification
The given system is mixed-determined. [index = 2]

[2] 10:14:06 Translation Warning
The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").

[3] 10:14:06 Translation Warning
The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").

[4] 10:14:06 Translation Warning
There are iteration variables with default zero start attribute. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").

[5] 10:14:06 Symbolic Warning
The model contains alias variables with conflicting start and/or nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.

Let me know what you think about the matter. Hopefully we can figure out if I opened the Master File correctly or not. Also, I hope to use the information given to me by you, within Ticket #2059 outlining the old front end and the new front end.

I apologize for the continual questions pertaining to the ThermoPower Library and thank you for being patient with me. It means a lot and it has been helping me out tremendously :)

Thanks for you time! I hope to hear back.

in reply to:  5 comment:6 by Francesco Casella, 6 years ago

Replying to KieranF <kieran.fung@…>:

The issue I had earlier stemmed from the package.mo file that was within the master folder.

This time most recently, I initially started by opening that file first, which opened OMEdit as well as loaded the ThermoPower Library.

That's it. You don't need any further action to open the package, all other files are loaded automatically by OMC.

However, when trying to simulate, I only received translation warnings, which made me think that it was a step in the right direction since no errors were received. But still, no simulations so I am unsure whther it was correct or not. The warnings I received are copied below:

I think if you use the latest nightly build of OMC, possibly with -d=newInst, and the latest version of ThermoPower, after I managed to make the last commits, some of these warnings will go away.

[1] 10:14:06 Translation Notification
The given system is mixed-determined. [index = 2]

This means the initialization problem is under- and over-determined two times. A tool can figure out how to deal with this, by removing redundant initial conditions and adding some extra ones, but different tools could do this differently, ending up in different simulation results. Reliable models do not have this kind of problems, but you need to be careful to set all the initial conditions correctly.

[2] 10:14:06 Translation Warning
The initial conditions are not fully specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").

Ditto. In ThermoPower, the system object allows to set the default initialization option. If you select FixedState or SteadyState, all ThermoPower components will have the right number of initial conditions. In fact, you may have some redundant ones in case of index reduction, if you connect two or more components that have a pressure state equal to the pressure on the connetor. In this case, either OMC tells you that it identified and removed the redundant initial condition(s), or you can remove them manually with the noInitialPressure flag in the involved components.

Of course if you use components from other libraries (e.g., the Modelica Standard Library) you need to make sure you select the right initial conditions to fully specify the initialization problem.

[3] 10:14:06 Translation Warning
The initial conditions are over specified. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").

Here the -d=initialization flage could give you some more info about the redundant initial equations - most likely on pressures.

[4] 10:14:06 Translation Warning
There are iteration variables with default zero start attribute. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").

This warning tells you that there are algebraic equations to be solved iteratively, either in the initialization or in the simulation problem. Now, the first guess for the iterative solver is given by the start attribute. If it is still zero, it is possible that it leads to a failure (e.g. division by zero, or out-of-range function calls), so this warning tells you that you may want to set those start attributes to meaningful values.

[5] 10:14:06 Symbolic Warning
The model contains alias variables with conflicting start and/or nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.

This may or may not be a proble. It's a long story, see #5252.

I apologize for the continual questions pertaining to the ThermoPower Library and thank you for being patient with me. It means a lot and it has been helping me out tremendously :)

No problem. I should write a book about this, but it's hard to find the time to do this :)

Note: See TracTickets for help on using tickets.