Sign in to follow this  
HappyCoder

FINT

Recommended Posts

TheAdmiral    1122
Numerically or analytically?

Analytic evaluation of an expression containing moduli is often, but not always, possible by separating the integrand into terms with known sign. After doing this, all the moduli may be ironed out.

Numerical integration, on the other hand, has no problems with such badly-behaved operators. A common term for definite numerical integration is 'quadrature' - people spend their lives researching this. The general problem is balancing accuracy, speed and simplicity.

Tell us which you're after, where the data came from and what resources you have at your disposal and we'll try to suggest a good approach.

Admiral

Share this post


Link to post
Share on other sites
HappyCoder    5053
Quote:
Original post by TheAdmiral
The general problem is balancing accuracy, speed and simplicity.

Tell us which you're after, where the data came from and what resources you have at your disposal and we'll try to suggest a good approach.


I would be mostly after accuracy. The user enters in a function and I need to be able to integrate it.

Share this post


Link to post
Share on other sites
TheAdmiral    1122
Okay, that's half an answer. I'll assume that you want to integrate numerically.

Perhaps the best all-round method out there is to use Romberg's method (a generalisation of Simpson's Rule) on abscissas derived and adapted from the Chebyshev Roots. This is probably overkill for your needs. If you need a one-off calculation of a reasonably tame curve, you'll probably get away with applying the Trapezium Rule on a mesh of paranoidly high resolution. All such situations will take good care of your absolute function.

Then again, you could just ask Maple or Matlab to do it for you. Again, tell us more.

Admiral

Share this post


Link to post
Share on other sites
erissian    727
Quote:
Original post by HappyCoder
Quote:
Original post by TheAdmiral
The general problem is balancing accuracy, speed and simplicity.

Tell us which you're after, where the data came from and what resources you have at your disposal and we'll try to suggest a good approach.


I would be mostly after accuracy. The user enters in a function and I need to be able to integrate it.


No, I think what he wants is to take the user input of "x2</sup + sin(2x)" and generate the output of "[2x + 2cos(2x)]dx" and so on.

Share this post


Link to post
Share on other sites
HappyCoder    5053
Quote:
Original post by TheAdmiral
Okay, that's half an answer. I'll assume that you want to integrate numerically.


Sorry, I'm not being clear. I do want it numerically.

Quote:
Original post by erissian
No, I think what he wants is to take the user input of "x2</sup + sin(2x)" and generate the output of "[2x + 2cos(2x)]dx" and so on.


Though thats not what I want exactly, It still could be a bonus.

[Edited by - HappyCoder on May 9, 2007 9:55:19 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this