Page: 1 | Go to End | |
Author | Topic:Question regarding integration | 2879 Views |
27 October 2012 at 7:41pm
Dear Fairmat,
I tried to write a plug-in and have some questions. I saw that you have Rectangle, AdaptLobatto, AdaptLobatto, and Romberg integration. However, I would like to use adaptive Simpson quadrature integration. If you have this integration, please give me some examples. I have the functions in Matlab that want to write in fairmat plug-in as
Matlab
F=@(x)(x.^(l-1)).*((1-x).^(n-l-1)).*((1-x.*o).^(-h)).*exp(x.*p);
quad(F,0,1);
This integration will have a problem with singularity. Moreover, I tried adaptive Gauss-Kronrod quadrature (quadgk and adaptiveSimpson), adaptive Lobatto quadrature (quadl and adaptiveLobatto), Gauss-Legendre quadrature (quadgr), some type of Gaussian quadrature (quadg), cumulative integral of adaptive Simpson quadrature (cumquad) in Matlab and they are not as good as adaptive Simpson quadrature integration. I wonder your integration will work same as Matlab or not. If you have any suggestion, please give me some examples in adaptive Simpson quadrature. Or if you don't have adaptive Simpson quadrature, could you show me in AdaptLobatto.
Best Regards,
Khampol
29 October 2012 at 8:47am
Dear Khampol,
Thanks for writing us,
If you want to see how to perform integrations using the Fairmat API you can look to the following document (Section 3 treats integration)
http://www.fairmat.com/assets/General/Numerical-API-Introduction.pdf
For what concerns your problem, we do not support adaptive Simpson integration and we do not have benchmark with Matlab.
In any case, if the number of singular points of your integrand function are few, and you know where the singularity are placed (if the integrand is analytic, this should be the case) you can always split the integrand in parts.
Basically, Let's suppose that you have to integrate f in [0, + infinite] and you know that you have a singular value in b>0. The integral can be reasonably approximated by the sum of the two integrals in [0, b-epsilon], and [b+epsilon, +infinite].
I hope it can help,
best regards,
Matteo
2879 Views | ||
Go to Top |
Currently Online: There is nobody online.
Welcome to our latest member: User4b2c