- Index
- » Programming
- » Modelica Language
- » noEvent() and smooth()
noEvent() and smooth()
noEvent() and smooth()
Hey guys,
I am new to modelica and I have a question about the smooth operator.
What is the acutal usage of smooth().
The description of a smooth() I found reads like:
"Hey, use it instead of noEvent because of performence. But sometimes you still need noEvent, but we do not tell you when exactly, LOL."
"The smooth operator should be used instead of noEvent, in order to avoid events for efficiency reasons. A tool is free to not generate events for expressions inside smooth. However, smooth does not guarantee that no events will be generated, and thus it can be necessary to use noEvent inside smooth. [Note that smooth does not guarantee a smooth output if any of the occurring variables change discontinuously."
Re: noEvent() and smooth()
https://mbe.modelica.university/behavio … ete/decay/
https://mbe.modelica.university/behavio … te/events/
Hi, above link give you an example and can better explain the different than me. Hope it helps.
- Arinomo23
- 120 Posts
Re: noEvent() and smooth()
It is hard for a Modelica compiler to reliably determine that such a function is continuous and has continuous derivatives. For this reason, Modelica includes the smooth operator to explicitly express such conditions
But how exactly does the smooth operator solve the problem?
What I understood is that the smooth operator lets the solver know that the Expression can be continuous differentiated p times.
I think my problem is that I do not know how exactly modelica solves the equations, Maybe you have a link that describes this?
- Index
- » Programming
- » Modelica Language
- » noEvent() and smooth()