Main Page | Report this Page
 
   
Science Forum Index  »  Math - Numerical Analysis Forum  »  Numerical integration in Javascript
Page 1 of 1    
Author Message
Guest
Posted: Wed May 09, 2007 10:05 am
For whom it may concern.

I have just added a javascript for numerical integration at:
http://www.hvks.com/Numerical/webintegration.htm

The javascript can do all the simple methos: Trapez, Simpson, Romberg
& Fox-Romberg but also the more advance Gauss-Legendre method.
For the Fox-Romberg and Romberg method some resilicency has been built
in, to handle singularities and improving the convergence power og the
methods.

Comments is as always welcome.

Henrik
user923005
Posted: Wed May 09, 2007 2:29 pm
Guest
On May 9, 8:05 am, h...@hvks.com wrote:
Quote:
For whom it may concern.

I have just added a javascript for numerical integration at:http://www.hvks.com/Numerical/webintegration.htm

The javascript can do all the simple methos: Trapez, Simpson, Romberg
& Fox-Romberg but also the more advance Gauss-Legendre method.
For the Fox-Romberg and Romberg method some resilicency has been built
in, to handle singularities and improving the convergence power og the
methods.

Comments is as always welcome.

Among the more effective integration methods is the class of double
exponential transform techniques.
This google search will turn up lots of information: double
exponential (quadrature OR integration)
This paper is really nice:
http://www.tech.port.ac.uk/staffweb/makrogla/athena/projects/Sean_Male/Sean_Male_final_year_project_06.pdf

Other interesting techniques include RMS integration of Favati, Lotti,
and Romani and other nested rules like Gauss-Kronrod quadrature.

I have a (possibly ignorant) question:
What is the modification of Romberg integration to form Romberg-Fox
integration
Guest
Posted: Wed May 09, 2007 5:05 pm
On May 9, 1:29 pm, user923005 <dcor...@connx.com> wrote:
Quote:
On May 9, 8:05 am, h...@hvks.com wrote:

For whom it may concern.

I have just added a javascript for numerical integration at:http://www.hvks.com/Numerical/webintegration.htm

The javascript can do all the simple methos: Trapez, Simpson, Romberg
& Fox-Romberg but also the more advance Gauss-Legendre method.
For the Fox-Romberg and Romberg method some resilicency has been built
in, to handle singularities and improving the convergence power og the
methods.

Comments is as always welcome.

Among the more effective integration methods is the class of double
exponential transform techniques.
This google search will turn up lots of information: double
exponential (quadrature OR integration)
This paper is really nice:http://www.tech.port.ac.uk/staffweb/makrogla/athena/projects/Sean_Mal...

Other interesting techniques include RMS integration of Favati, Lotti,
and Romani and other nested rules like Gauss-Kronrod quadrature.

I have a (possibly ignorant) question:
What is the modification of Romberg integration to form Romberg-Fox
integration

Thank you or your comments. I actually plan to implement your
suggestions in the next release.

The Fox-Romberg is the modification suggested by Fox why the Romberg
method sometimes failed. Take the sqrt(x) in the interval from
[0,0.5]. Fox found out that the convergence power was considerable
less that it should be (around 1.5) and found out that their was a
dangling error term of the power of 1.5 that was never eliminated when
applying a standard Romberg integration with a slower convergence as
the result. By removing the error term the integration qucikly
succeceded. Try the verbose mode with Romberg and Fox-Romberg checked
and you can see the difference in the speed of convergence.

Thanks
Axel Vogt
Posted: Thu May 10, 2007 11:55 am
Guest
user923005 wrote:
Quote:
On May 9, 8:05 am, h...@hvks.com wrote:
For whom it may concern.

I have just added a javascript for numerical integration at:http://www.hvks.com/Numerical/webintegration.htm

The javascript can do all the simple methos: Trapez, Simpson, Romberg
& Fox-Romberg but also the more advance Gauss-Legendre method.
For the Fox-Romberg and Romberg method some resilicency has been built
in, to handle singularities and improving the convergence power og the
methods.

Comments is as always welcome.

Among the more effective integration methods is the class of double
exponential transform techniques.
This google search will turn up lots of information: double
exponential (quadrature OR integration)
This paper is really nice:
http://www.tech.port.ac.uk/staffweb/makrogla/athena/projects/Sean_Male/Sean_Male_final_year_project_06.pdf

Other interesting techniques include RMS integration of Favati, Lotti,
and Romani and other nested rules like Gauss-Kronrod quadrature.

I have a (possibly ignorant) question:
What is the modification of Romberg integration to form Romberg-Fox
integration


A very nice reference! Do you have some for the RMS method as well?
user923005
Posted: Thu May 10, 2007 2:06 pm
Guest
On May 10, 9:55 am, Axel Vogt <&nore...@axelvogt.de> wrote:
Quote:
user923005 wrote:
On May 9, 8:05 am, h...@hvks.com wrote:
For whom it may concern.

I have just added a javascript for numerical integration at:http://www.hvks.com/Numerical/webintegration.htm

The javascript can do all the simple methos: Trapez, Simpson, Romberg
& Fox-Romberg but also the more advance Gauss-Legendre method.
For the Fox-Romberg and Romberg method some resilicency has been built
in, to handle singularities and improving the convergence power og the
methods.

Comments is as always welcome.

Among the more effective integration methods is the class of double
exponential transform techniques.
This google search will turn up lots of information: double
exponential (quadrature OR integration)
This paper is really nice:
http://www.tech.port.ac.uk/staffweb/makrogla/athena/projects/Sean_Mal...

Other interesting techniques include RMS integration of Favati, Lotti,
and Romani and other nested rules like Gauss-Kronrod quadrature.

I have a (possibly ignorant) question:
What is the modification of Romberg integration to form Romberg-Fox
integration

A very nice reference! Do you have some for the RMS method as well
http://portal.acm.org/citation.cfm?id=108580&coll=portal&dl=ACM&CFID=22121415&CFTOKEN=53970447

http://citeseer.ist.psu.edu/402551.html

I had to purchase the articles, as I recall.

I have implemented the algorithms using the MIRACL C++ number class
and I will send a copy to anyone who wants it.
user923005
Posted: Thu May 10, 2007 2:29 pm
Guest
On May 9, 3:05 pm, h...@hvks.com wrote:
Quote:
On May 9, 1:29 pm, user923005 <dcor...@connx.com> wrote:





On May 9, 8:05 am, h...@hvks.com wrote:

For whom it may concern.

I have just added a javascript for numerical integration at:http://www.hvks.com/Numerical/webintegration.htm

The javascript can do all the simple methos: Trapez, Simpson, Romberg
& Fox-Romberg but also the more advance Gauss-Legendre method.
For the Fox-Romberg and Romberg method some resilicency has been built
in, to handle singularities and improving the convergence power og the
methods.

Comments is as always welcome.

Among the more effective integration methods is the class of double
exponential transform techniques.
This google search will turn up lots of information: double
exponential (quadrature OR integration)
This paper is really nice:http://www.tech.port.ac.uk/staffweb/makrogla/athena/projects/Sean_Mal...

Other interesting techniques include RMS integration of Favati, Lotti,
and Romani and other nested rules like Gauss-Kronrod quadrature.

I have a (possibly ignorant) question:
What is the modification of Romberg integration to form Romberg-Fox
integration

Thank you or your comments. I actually plan to implement your
suggestions in the next release.

The Fox-Romberg is the modification suggested by Fox why the Romberg
method sometimes failed. Take the sqrt(x) in the interval from
[0,0.5]. Fox found out that the convergence power was considerable
less that it should be (around 1.5) and found out that their was a
dangling error term of the power of 1.5 that was never eliminated when
applying a standard Romberg integration with a slower convergence as
the result. By removing the error term the integration qucikly
succeceded. Try the verbose mode with Romberg and Fox-Romberg checked
and you can see the difference in the speed of convergence.

Can you send me a copy of the Java code for Fox-Romberg?

Here is my current Romberg implementation, and I would be anxious for
an improvement:

/*
Hello Dann,

Sorry for the mix up but your message had been held in the wrong
mail box for ages.

Please feel free to use the Romberg code as you like, there are no
restrictions on it.
I took the standard algorithm and changed it according to an idea
used by the hp15c calculator
and documented in the advanced functions handbook for that machine.

This idea improves the algorithm by transforming the sample points
to be non uniformly spaced.
I also find that it generally gets better results in my tests.

best wishes,
-- hugh.
*/

#define ROMB_MAX 40

template < class Number >
Number romberg(Number(*f) (Number), Number a, Number b, Number eps)
{
/* Approximate integral of f() between [a, b] subject to a given
epsilon of error.
* This routine is originally from Hugh at Voidware. I made a few
changes - DRC.
* Use Romberg method with refinement substitution, x = (3u-u^3)/2
which
* prevents endpoint evaluation and causes non-uniform sampling.
*
* max samples 2^(ROMB_MAX)+1
*/
static const Number mpHalf(0.5);
static const Number mpThree(3.0);
static const Number mpZero(0.0);
static const Number mpOne(1.0);
static const Number mpFour(4.0);
static const Number mpThreeFourths(0.75);
static const Number mpSixteen(16.0);

unsigned n,
i,
lim = 1;
Number mpH(2.0),
mpS;
Number mpaC[ROMB_MAX + 1];
Number mpP;
Number mpT,
mpU;
Number mpL = mpZero;
mpaC[0] = mpZero;
b -= a;
for (n = 0; n < ROMB_MAX; ++n) {
mpP = mpH * mpHalf - mpOne;
mpS = mpZero;
for (i = 0; i < lim; i++) {
mpT = mpOne - mpP * mpP;
mpU = mpP + mpT * mpP * mpHalf;
mpU = (mpU * b + b) * mpHalf + a;
mpS = mpS + mpT * (*f) (mpU);
mpP += mpH;
}
mpP = mpFour;
mpT = mpaC[0];
mpaC[0] = (mpaC[0] + mpH * mpS) * mpHalf;
for (i = 0; i <= n; i++) {
mpU = mpaC[i + 1];
mpaC[i + 1] = (mpP * mpaC[i] - mpT) / (mpP - mpOne);
mpT = mpU;
mpP *= mpFour;
}
if (abs(mpaC[i] - mpL) < eps * abs(mpaC[i]) * mpSixteen)
break;
mpL = mpaC[i];
lim <<= 1;
mpH *= mpHalf;
}
return mpaC[i] * b * mpThreeFourths;
}
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Wed Jan 07, 2009 11:49 pm