MrBlonde81
Dec 3 2009, 07:53 AM
Hello,
I am doing a calculation in one of my models and I want to trunkate the result in a subtraction, i.e. if the nubmers have at least lets say 5 significants digits in common I want to round the result to zero.
Does somebody know of any built in function for this in Modelica, i.e. without using if-cases etc.?
MrBlonde
goo
Dec 12 2009, 07:18 PM
Hi,
I don't know of any function like that.
I guess that you do not want to use if statements because you want to avoid generating events. In that case have a look at Modelica.Media.Common.smoothStep. Some of the ideas in here might be helpful for you to create a numerically efficient function to perform your task.