Help - Search - Members - Calendar
Full Version: Round function?
Modelica Forum > Modelica > Modelica
MrBlonde81
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
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.