Hi Chris! I was playing with the adaptive Simpson function and found some problems evaluating numerically a (well-behaved) integral. I've a couple of questions: 1) Why the decision to *not* couple the precision to the value of Digits? Coupling it to Digits would make it available in Ginsh. Wouldn't it do the right thing in almost all cases? 2) Are variations of Simpson's rule really attractive for numerical evaluation? Have you considered/tried something funkier (maybe Romberg's method) or is that a particularly smart implementation? 3) Probably an oversight: the last argument to the adaptivesimpson function is unused. Instead, the code always uses the default. Best wishes -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
On Mon, 12 Sep 2005, Richard B. Kreckel wrote:
I was playing with the adaptive Simpson function and found some problems evaluating numerically a (well-behaved) integral. I've a couple of questions: [...]
4) The lookup table does not seem to discriminate among different precisions. Presuming the last argument to adaptivesimpson() would be used or the precision be coupled to Digits. Then the lookup map would have to hold the precision as well (on the key side, not the value side). Otherwise it becomes impossible to re-run an integration with a higher precision goal. Best wishes -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Hello again, On Mon, 2005-09-12 at 23:19 +0200, Richard B. Kreckel wrote:
4) The lookup table does not seem to discriminate among different precisions. Presuming the last argument to adaptivesimpson() would be used or the precision be coupled to Digits. Then the lookup map would have to hold the precision as well (on the key side, not the value side). Otherwise it becomes impossible to re-run an integration with a higher precision goal.
Yes, this seems a good idea. I think, I will write a path for that when I have some time. Best wishes, Chris
Dear Richy, On Mon, 2005-09-12 at 22:16 +0200, Richard B. Kreckel wrote:
1) Why the decision to *not* couple the precision to the value of Digits? Coupling it to Digits would make it available in Ginsh. Wouldn't it do the right thing in almost all cases?
It depends on what coupling you have in mind. As different users may have different preferences, I thought it was best to leave it up to the user. Note that it would be a highly dangerous idea to make the precision of integration equal to the precision of the other numerical calculations. This is because the last few digits of a calculated number may not be very trustworthy and all kind of artifacts could be in them. A continuous function could look non-continuous depending on the algorithm used for calculation. Then the adaptive simpson method would go *boink*.
2) Are variations of Simpson's rule really attractive for numerical evaluation? Have you considered/tried something funkier (maybe Romberg's method) or is that a particularly smart implementation?
I thought it was quite nice. Convergence as 1/N^4 and adaptivity. It has been some time that I looked at this, so I forgot why I took the adaptive Simpson algorithm. Presumably there was something in the book by Burden and Faires that made me go for the adaptive Simpson algorithm. Unfortunately I do not have that book now that I am in Milan and the library seems to be reorganizing until december or so :-(. Of course, there could also be an integral::integration_method to give the user a choice what method to use.
3) Probably an oversight: the last argument to the adaptivesimpson function is unused. Instead, the code always uses the default.
Yes, the obvious fix for this is to turn all occurances of integral::relative_integration_error into error. Could you do this in CVS? Best wishes, Chris
participants (2)
-
Chris Dams
-
Richard B. Kreckel