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
23 janv. 2010, 05:02 UTC−5
Hi
my first check, for such an error, is the definition of your variable, or to turn on complex numbers for which the i.e. sqrt(-1) has a meaning. But perhap you can also define your criteria "0" as abs(??)<eps or a abs(??)<10*eps and the solution would probably be as good.
Where ?? being your optimisation/driving variable and "eps" is the internal representation of the "next to zero" magnitude possible in your floating point representation.
In fact its all about "what is "0" often <1% or <10 ppm of your initial values are sufficient to represent "0" and this can still be orders of magnitude away from a true "0.00"
It's all about how much time you want to wait for the solution ...
Good luck
Ivar
Hi
my first check, for such an error, is the definition of your variable, or to turn on complex numbers for which the i.e. sqrt(-1) has a meaning. But perhap you can also define your criteria "0" as abs(??)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
25 janv. 2010, 03:32 UTC−5
Thank you Ivar!
The tip with setting an 'eps' sound very interesting. :)
I will try this next!!!
Till
Thank you Ivar!
The tip with setting an 'eps' sound very interesting. :)
I will try this next!!!
Till
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
29 janv. 2010, 04:41 UTC−5
Hello!
I applied the logical expression according to Ivar's recomendation. It helped, but at last the concentration doesn't reach zero. Comsol includes a lot of frustration... :(
Till
Hello!
I applied the logical expression according to Ivar's recomendation. It helped, but at last the concentration doesn't reach zero. Comsol includes a lot of frustration... :(
Till
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
29 janv. 2010, 05:22 UTC−5
Hi
Well what is "zero", if you compare your 4E-6 to the initial value, could it not just be that regarding the model and the meshing <4e-6 is equivalent to "zero".
Clear if you started from 1E-6 its bigger but if you started at 1 you have already 6 orders of magnitude !
Furthermore, how do you set your convergence limits for the solver, if it considers 1E-6 as "small" then it will stop around E-6.
Mostly our frustration comes from uncomplete understanding of the complexity of our models, and often we would like to be more "perfect" than what our models truely are
Good luck
Ivar
Hi
Well what is "zero", if you compare your 4E-6 to the initial value, could it not just be that regarding the model and the meshing
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
29 janv. 2010, 10:08 UTC−5
Hi,
I've used a neat trick before which I think was from the knowledge database (maybe it was in the model library). Instead of modelling your concentration C, make the dependent variable lnC, which is defined to be ln(C). You'll have to convert your differential equations to the new variable, using the relation C = exp(lnC), but it's straightforward due to the exponential function. The benefit is that C calculated in this way can never be negative, or even equal to zero! Also, you can model a range of orders of magnitudes very easily. You could then use the the threshold argument previously mentioned to say when the concentration was 'low enough' to be essentially zero, although if your reaction rate is proportional to your concentration then I don't think you would ever really hit zero anyway...
Hope this helps!
Mike
Hi,
I've used a neat trick before which I think was from the knowledge database (maybe it was in the model library). Instead of modelling your concentration C, make the dependent variable lnC, which is defined to be ln(C). You'll have to convert your differential equations to the new variable, using the relation C = exp(lnC), but it's straightforward due to the exponential function. The benefit is that C calculated in this way can never be negative, or even equal to zero! Also, you can model a range of orders of magnitudes very easily. You could then use the the threshold argument previously mentioned to say when the concentration was 'low enough' to be essentially zero, although if your reaction rate is proportional to your concentration then I don't think you would ever really hit zero anyway...
Hope this helps!
Mike
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2 févr. 2010, 03:43 UTC−5
Thanks for the tip!
I'll try and write here about the results!
With regards
Till
Thanks for the tip!
I'll try and write here about the results!
With regards
Till
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
13 sept. 2010, 21:19 UTC−4
can you post your comsol file..i will have a look..i had lot of problems when i was performing simulation of very complicated reactor...
can you post your comsol file..i will have a look..i had lot of problems when i was performing simulation of very complicated reactor...