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.
arithmetic overflow
Posted 20 avr. 2010, 08:24 UTC−4 1 Reply
Please login with a confirmed email address before reporting spam
Hi. Is it possible for Comsol to encounter an arithmetic overflow, and how do you deal with this? The parameter I am simulating in one of my multiphysics domains is getting very large and then becoming negative.
Specifically, I am using an Arhennius integral that essentially integrates 1/Temperature (calculated from another domain) over time:
d/dt Omega = c1 * exp(-c2 * (1/Temperature)), Omega0 = 0, dOmega0 = 0
The problem is that the Omega tends towards infinity as time goes to infinity. It's never supposed to be negative.
I've tried reforming the equation in terms of the mass fraction, F:
F = exp(-Omega)
so:
d/dt F = -exp(-Omega) * d/dt Omega (chain rule)
d/dt F = -F * c1 * exp(-c2 * (1/Temperature)), F0 = 1, dF0 = 0
thinking that this tends to zero as time (and Omega) tends to infinity. F always is between 1 and 0, and is always decreasing.
But I still am getting negative values and the model gets stuck after a few second of simulation time (which corresponds to quite a lot of real time).
In both cases, negative values of Omega or F messes up my model - they determine coefficients in other domains.
Any good suggestions for how to deal with this?
Kind regards,
Ifung Lu
Specifically, I am using an Arhennius integral that essentially integrates 1/Temperature (calculated from another domain) over time:
d/dt Omega = c1 * exp(-c2 * (1/Temperature)), Omega0 = 0, dOmega0 = 0
The problem is that the Omega tends towards infinity as time goes to infinity. It's never supposed to be negative.
I've tried reforming the equation in terms of the mass fraction, F:
F = exp(-Omega)
so:
d/dt F = -exp(-Omega) * d/dt Omega (chain rule)
d/dt F = -F * c1 * exp(-c2 * (1/Temperature)), F0 = 1, dF0 = 0
thinking that this tends to zero as time (and Omega) tends to infinity. F always is between 1 and 0, and is always decreasing.
But I still am getting negative values and the model gets stuck after a few second of simulation time (which corresponds to quite a lot of real time).
In both cases, negative values of Omega or F messes up my model - they determine coefficients in other domains.
Any good suggestions for how to deal with this?
Kind regards,
Ifung Lu
1 Reply Last Post 21 avr. 2010, 15:37 UTC−4