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

How to get instantiated model

How to get instantiated model

Using omc, I would like to ask you how to get an output or dump of all instantiated equations.

The reason is for debugging. I have got the error "Too few equations, under-determined system". I would like to check thoroughly the final equations.

Using OMEdit is easy, just with option "Simulation/Instantiate model".

Running omc using +i=className, I do not get any output.

Best regards

Re: How to get instantiated model

Oh, found!

There is a lot of power in .mos file. Just adding some lines to .mos we can get it.

buildModel(MyModel);
writeFile("MyModel_instantiated.mo", instantiateModel(MyModel));
dumpXMLDAE(MyModel);

Best regards

Re: How to get instantiated model

Well. In fact instantiateModel() or dumpXMLDAE() do not require a previous call to buildModel().

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