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

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

1 Reply Last Post 21 apr 2010, 15:37 GMT-4
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 21 apr 2010, 15:37 GMT-4
Hi

certainly you can get arithmetic overflow, I beleive its rather easy even, but I would expect an error trap should be activated, still one of the trick of solving large ill conditionned matrices is the normalisation. Comsol is rather good at this I find, but whenyou add your equations and tweak it, you must also check that your normalsiation is correct. There are different ways to get this, but I see that you have already tried.

Now you might have something else wrong, misleading you. HAve you tried the "plot while solving" or the "Probe plots" to fllow the results of te solver during its search for convergence ?

Good luck
Ivar
Hi certainly you can get arithmetic overflow, I beleive its rather easy even, but I would expect an error trap should be activated, still one of the trick of solving large ill conditionned matrices is the normalisation. Comsol is rather good at this I find, but whenyou add your equations and tweak it, you must also check that your normalsiation is correct. There are different ways to get this, but I see that you have already tried. Now you might have something else wrong, misleading you. HAve you tried the "plot while solving" or the "Probe plots" to fllow the results of te solver during its search for convergence ? Good luck Ivar

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.