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

Safe symbolic manipulations only?

Safe symbolic manipulations only?

New equations involving division are introduced when I pass +d=tearing,dumpindxdae,backenddaeinfo to the compiler.

Unfortunately I get division by zero errors.

I tried setting start=1 on the critical variables so no division by zero occurs. Unfortunately my attemps have no effect and I do not know why.

How can I ask the compiler to do as much symbolic simplification as it can but avoid dangerous ones?

Many thanks!

Re: Safe symbolic manipulations only?

I'm not an OpenModelica developer, but I have asked about the tearing (since I've done that part for JModelica.org) and I was told that it's unsafe in OpenModelica. In JModelica.org, the selection of tearing-variables and residual-equations guarantees that no divisions by variables and even parameters are imposed by this selection. I'm not sure if the OpenModelica compiler can guarantee this. It looks like it doesn't.

So to answer your question - don't use tearing in OpenModelica. (Since evidently you get divisions by zero).

The BLT-transformation (which is default) shouldn't introduce any divisions by zero (unless they are inherent in the model itself).

cheers,

patrik

Re: Safe symbolic manipulations only?

Hi,

unfortunately the tearing implementation is not yet finished.

If you want to do more symbolic simplification than in default case you could use additional optimization modules  via the flags
+preOptModules=""
or/and
+postOptModules=""

for the preOptModules the default case is "removeFinalParameters,removeEqualFunctionCalls,partitionIndependentBlocks,expandDerOperator, removeSimpleEquationsFast"

Additionally you cold use for example removeProtectedParameters. This module replace all protected parameters with there value.
If you want to add, it simply write it in an appropriate place in the list. Node the order of the list is the same as the compiler performs the modules. A good place for  removeProtectedParameters is before  removeSimpleEquationsFast. This is because replacing protected parameters with there value will result in more simple equations.

(Node, there are also script functions to set the flags)

You could check the order of the modules by adding the flag +d=execstat

More Ideas about simplification modules are very welcome.

Jens

Re: Safe symbolic manipulations only?

Dear Jens, dear Patrik,

Thanks for the response, for some reason I did not get a notification in e-mail (or accidentaly deleted with the junk mail).

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