Hamed_148

15 Reputation

3 Badges

8 years, 303 days

MaplePrimes Activity


These are questions asked by Hamed_148

I am trying to integrate a very large matrix. In order to increase the speed I am using Grid[Map] to integrate the elements of the matrix in parallel. 

The only problem that I am having is that no matter what precision I set, it reduces to 10 digit when I use Grid[Map] package. This only happens if there are floating coefficients involved.

Let me show you by an example:

In the first example, I am not putting any coeffcients before the function:

Digits := 30;
Integrands := [seq(sin((1/10)*k*x), k = 1 .. 2^8)];
evalf(Grid[Map](int, Integrands, x = 0 .. Pi));

Here are the first 5 elements of the output: 
[0.489434837048464278835606666210,
0.954915028125262879488532914080,
1.374049159025089569437646817870,
1.727457514062631439744266457040,
2.000000000000000000000000000000,, ....]

as we see here the precision is 30 as we defined

 

Now let's run it again, but this time put a random 30 digit (or any other digits) coeficient before sin function :

Digits := 30; 
Integrands := [seq(1.000000000000000000000000000000*sin((1/10)*k*x), k = 1 .. 2^8)]; 
evalf(Grid[Map](int, Integrands, x = 0 .. Pi))

Now the first 5 elements of the output change to:

[.489434837000000000000000000000, 
.954915028100000000000000000000, 
1.374049159000000000000000000000, 
1.727457514000000000000000000000, 
2.000000000000000000000000000000,...]

 

It is visible that the precision changes to 10 numbers (not even 10 digits!)...It is really important for my problem to keep the calculation at least up to 30 digits...

Does anyone know why such a problem occurs? and how to solve it?

Thanks in advance...

Page 1 of 1