h(x)/(1+a*h(x))*exp(-x^2) This is more correct to see it that way h(x0-x)/(1+a*h(x0-x))*exp(-x^2)
x0 is a constant h(x0-x) is a Lorentzian profile (with different "locations") we can have a sum of h(x) with different x0. This is not the problem The issue seems to come for the value of g when it is too small (g is always > 0) The function is set to 0 when we are far way from the center of the Lorenztian. The value of the function is always finite. =========================================================================== Patrick DUPRÉ | | email: pdu...@gmx.com Laboratoire interdisciplinaire Carnot de Bourgogne 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE Tel: +33 (0)380395988 =========================================================================== > Sent: Thursday, March 05, 2020 at 4:58 PM > From: "Mike Marchywka" <marchy...@hotmail.com> > To: help-gsl@gnu.org > Subject: Re: Integration > > On Thu, Mar 05, 2020 at 04:01:16PM +0100, Patrick Dupre wrote: > > I also can get roundoff error > > with QAGP > > > > =========================================================================== > > Patrick DUPRÉ | | email: pdu...@gmx.com > > Laboratoire interdisciplinaire Carnot de Bourgogne > > 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE > > Tel: +33 (0)380395988 > > =========================================================================== > > > > > > > Sent: Thursday, March 05, 2020 at 3:48 PM > > > From: "Patrick Dupre" <pdu...@gmx.com> > > > To: "Patrick Alken" <al...@colorado.edu> > > > Cc: help-gsl@gnu.org > > > Subject: Re: Integration > > > > > > Hello, > > > > > > Thank for the suggestions. > > > > > > However, here is the problem. > > > The "singularities" at x=x0 I guess. > > > If I use QAGP and I provide the singular points, then I get: > > > Error during integration: 7168.4707442 (420) integral or series is > > > divergent > > I'm not that familiar with gsl but curious about the integral. Just to > clarify, you have an integrand of the form > > h(x)/(1+a*h(x))*exp(-x^2) > > where h happens to be a sum over n Lorentzians that differ only in their > location and h is bounded between 0 and n/g (x=x_0 all the same ) with g>0 > ? > > > > > > > If I use gsl_integration_cquad > > > there is not error, but I get a wrong value at one of the "singularities" > > > > > > Then I do not see any solution. > > > > > > For the interval, I can calculate the limits. It is not an issue for now. > > > The behavior is the same, what ever is the values are. > > > > > > =========================================================================== > > > Patrick DUPRÉ | | email: pdu...@gmx.com > > > Laboratoire interdisciplinaire Carnot de Bourgogne > > > 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE > > > Tel: +33 (0)380395988 > > > =========================================================================== > > > > > > > > > > Sent: Thursday, March 05, 2020 at 2:49 PM > > > > From: "Patrick Alken" <al...@colorado.edu> > > > > To: help-gsl@gnu.org > > > > Subject: Re: Integration > > > > > > > > Hello, did you try transforming the integral to have finite limits (i.e. > > > > https://www.youtube.com/watch?v=fkxAlCfZ67E). Once you have it in this > > > > form, I would suggest trying the CQUAD algorithm: > > > > > > > > https://www.gnu.org/software/gsl/doc/html/integration.html#cquad-doubly-adaptive-integration > > > > > > > > Patrick > > > > > > > > On 3/5/20 2:02 AM, Patrick Dupre wrote: > > > > > Hello, > > > > > > > > > > > > > > > Can I collect your suggestions: > > > > > > > > > > I need to make the following integration: > > > > > > > > > > int_a^b g(x) f(x) dx > > > > > > > > > > where a can be 0 of -infinity, and b +infinity > > > > > g(x) is a Gaussian function > > > > > f(x) = sum (1/((x-x0)^2 + g)) / (1 + S* sum (1 / ((x-x0)^2 + g))) > > > > > > > > > > Typically, f(x) is a fraction whose numerator is a sum of Lorentzians > > > > > and the denominator is 1 + the same sum of Lorentzians weighted by a > > > > > factor. > > > > > > > > > > Thank for your suggestions > > > > > > > > > > =========================================================================== > > > > > Patrick DUPRÉ | | email: > > > > > pdu...@gmx.com > > > > > Laboratoire interdisciplinaire Carnot de Bourgogne > > > > > 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE > > > > > Tel: +33 (0)380395988 > > > > > =========================================================================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > mike marchywka > 306 charles cox > canton GA 30115 > USA, Earth > marchy...@hotmail.com > 404-788-1216 > ORCID: 0000-0001-9237-455X > >