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
2 mai 2012, 17:25 UTC−4
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
2 mai 2012, 17:34 UTC−4
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
3 mai 2012, 03:05 UTC−4
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
3 mai 2012, 10:02 UTC−4
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
6 mai 2012, 07:16 UTC−4
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