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
2012年5月2日 GMT-4 17:25
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
2012年5月2日 GMT-4 17:34
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
2012年5月3日 GMT-4 03:05
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
2012年5月3日 GMT-4 10:02
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
2012年5月6日 GMT-4 07:16
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