Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
May 2, 2012, 5:25 p.m. EDT
Hi
never hear of that, but perhaps something like ((x-floor(x))<eps) might work, but check carefully the positive and negative side effects, and you ight need several times of "eps" if x is getting large
--
Good luck
Ivar
Hi
never hear of that, but perhaps something like ((x-floor(x))
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
May 2, 2012, 5:34 p.m. EDT
Possibly, we could use the 'mod' function i.e.
If mod(var,1) == 0 , it is an integer;
If you use matlab scripting 'isinteger' function could be used.
Possibly, we could use the 'mod' function i.e.
If mod(var,1) == 0 , it is an integer;
If you use matlab scripting 'isinteger' function could be used.
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
May 3, 2012, 3:05 a.m. EDT
Hi
but what about the numerical precision ? in "automatic" mode COMSOL might stop and solve for a value very close to the integer, but not exactly "on" it
--
Good luck
Ivar
Hi
but what about the numerical precision ? in "automatic" mode COMSOL might stop and solve for a value very close to the integer, but not exactly "on" it
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
May 3, 2012, 10:02 a.m. EDT
Yes, we need to use some threshold (eps) as Ivar suggested in last post.
Yes, we need to use some threshold (eps) as Ivar suggested in last post.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
May 6, 2012, 7:16 a.m. EDT
Thanks Ivar and Mranal. I used (ceil(t)-t<eps) and it works well. Thanks for your input.
Thanks Ivar and Mranal. I used (ceil(t)-t