Normand Beaudoin

5 Reputation

0 Badges

7 years, 290 days

MaplePrimes Activity


These are replies submitted by Normand Beaudoin

@brian bovril 

Unfortunately I do not have a reworked worksheet.

Do you hace acces to my initial uploaded worksheet entitled Numerical_Integration.mw 

I am still trying to understand the source of the problem and to solve it or at least circumvent it.

Thank you for your concern. NB.

@Carl Love 

Why_numerical_integration_by_segments.mw

You have a good question. The Maple worksheet I just posted, hopefully, answer it. I put comments in the worksheet itself.

In few words. Because Maple cannot integrate symbolically my function (if you look at it you will see why), I have to integrate it numerically. This function contains many very narrow peaks distributed on a very wide range of values of the independant variable. If I integrate over the entire range, Maple miss the peaks. I have to reduce the domain of integration until no peaks are missed, (This is what I try to explain in the Maple worksheet I just uploaded) then I repeat the integration segments by segments to integrate over the entire domain.

Do you think there is a better way to do this?

About the accuracy. You have a good point. But I presume the errors do not add positively, all on the same "side". Of course I checked the results the usual way for that kind of problem by comparing with similar analytical functions for which we know the results. The results obtained with the numerical integration patern I described likely are very safe.

Thank you for your comment. NB.

Do you 

@acer 

6 minutes! Wow!!

What kind of machine do you have? It needs hours on my small laptop! Do you see if the integration time increase with iterations?

Thank you very much for this.

NB.

@tomleslie 

add_for_do.mw

  1. Have to agree with Acer

It seems that it is ok to upload a 10 Meg document so I just did that.

     2. If you have actually been "a Maple user for about 30 years" (which I doubt)

Well ! What can I say? Just ask to Waterloo Maple Software.

       then you probably ought to have worked out by now that using an "add()" command is *much* more efficient than using a "do" loop and adding the results

You must have many examples that show that add() is *much* more efficient than a "do" and I can trust you but maybe it depends on the task. I post a Maple worksheet in which we see that "add()" and "do" are very similar. Sometime "add" is slightly faster, sometime "do" is faster. Does it make sens?

However, it seems to me that one advantage of "do" over "add" for the task I ask Maple to do it that in a "do" loop I can insert commands to output intermediate results and to inform me of the progression of the task. Since this computation needs many hours hours to complete, it allow me to stop the execution (which seems to free memory and accelerate the computation) and restart it at the point where it was stopped.

I am not sur we can do that with an "add" command. What do you think?

        3. Post code

Done!

Thank you for your comment. N.B.

Numerical_Integration.mw 

Hi! Here is the Maple worksheet. I did not remove the output to save time (it need hours to get it) for those who would like to look at it. Thank you very much for your help. N.B.

Page 1 of 1