Multiplication by a small parameter yields zeros.

Asked by Douglas Brinkerhoff

Hello,

I'm trying to multiply a field (called H in this instance, which represents the thickness of a thin film, which has an average value of 1000 or so), by a small parameter, called A, which has a value of around 1e-25. Instead of yielding values around 1e-22 as one might expect, I get all zeros. If I do the multiplication in several steps, (e.g. H*(A*1e15)/1e15), I can coerce the correct result. Any ideas on how to remedy this problem?

Thanks,

Doug Brinkerhoff

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Anders Logg (logg) said :
#1

On Tue, May 17, 2011 at 10:30:59PM -0000, Douglas Brinkerhoff wrote:
> New question #157961 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/157961
>
> Hello,
>
> I'm trying to multiply a field (called H in this instance, which represents the thickness of a thin film, which has an average value of 1000 or so), by a small parameter, called A, which has a value of around 1e-25. Instead of yielding values around 1e-22 as one might expect, I get all zeros. If I do the multiplication in several steps, (e.g. H*(A*1e15)/1e15), I can coerce the correct result. Any ideas on how to remedy this problem?

You need to rescale your problem. If you work with numbers that small,
you will run into all kinds of problems with round-off errors, both
when assembling and solving the linear system. In particular, the form
compiler will round all small numbers down to 0.0.

--
Anders

Can you help with this problem?

Provide an answer of your own, or ask Douglas Brinkerhoff for more information if necessary.

To post a message you must log in.