Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
how to truncate a decimal number??
Posted Jul 12, 2011, 6:43 a.m. EDT Version 4.1, Version 4.2 2 Replies
Please login with a confirmed email address before reporting spam
Hello,
I have a heat source that follows a circular path. When the angle alfa (alfa=omega*t, being "omega" the angular velocity and "t" the time in seconds) is greater than 360degrees (2*pi radians), I am having problems.
So I want to limit "alfa" between 0 and 360 degrees.
I have thought to create a new variable "n" which defines the number of turns that the heat source has already complete.
n=TRUNC((omega*t)/(2*pi))
alfa=(omega*t)*(n<1)+(omega*t-n*2*pi)*(n>=1)
But I can't find a function like "TRUNC" to get the whole part of a number. Is there any way to obtain the integer part of a decimal number in COMSOL??
Thanks,
Itxaso
I have a heat source that follows a circular path. When the angle alfa (alfa=omega*t, being "omega" the angular velocity and "t" the time in seconds) is greater than 360degrees (2*pi radians), I am having problems.
So I want to limit "alfa" between 0 and 360 degrees.
I have thought to create a new variable "n" which defines the number of turns that the heat source has already complete.
n=TRUNC((omega*t)/(2*pi))
alfa=(omega*t)*(n<1)+(omega*t-n*2*pi)*(n>=1)
But I can't find a function like "TRUNC" to get the whole part of a number. Is there any way to obtain the integer part of a decimal number in COMSOL??
Thanks,
Itxaso
2 Replies Last Post Jul 12, 2011, 7:35 a.m. EDT