[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and abo
From: |
Juan Pablo Amorocho |
Subject: |
Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts |
Date: |
Sun, 5 Oct 2014 08:53:35 +0200 |
HI all,
I evaluated the function on the integration, and didn’t see anything
suspicious. Though one thing caught my eye. Vipin, you are passing a relative
error of 10e-12. Have you tried a value of 10e-6 or 10e-7? By the way, what’s
is the value of n and what does int n(1) resolves to? In the code below I
assume n = 1. I don’t mean to be picky, but could you please send us (or me)
code that we could “just” copy& paste without further modification in order to
compile and run? Thanks!
— Juan Pablo
#include <stdio.h>
#include <math.h>
double f (double x){
const double a = 0.992*M_PI/2;
const double n = 1.0;
return cos(n*x)*log((cos(a) - cos(x))/(x - a));
}
int main(){
double a = 0.0;
double h = 0.01;
double fa = 0.;
do{
fa = f(a);
printf("(%f, %f)\n", a, fa);
a+=h;
}while(a <=M_PI);
return 0;
}
On 04 Oct 2014, at 19:08, Klaus Huthmacher <address@hidden> wrote:
> Dear Vipin,
>
>> // double f = cos(n*x)*log((cos(a) - cos(x))/(x - a));//
>
> Is it possible that the argument of your logarithm can be zero for PI? Or
> that you divide by zero, if x-a becomes zero for PI?
>
> Kind regards,
> Klaus.
>
>
- [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Vipin K. Varma, 2014/10/04
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Klaus Huthmacher, 2014/10/04
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts,
Juan Pablo Amorocho <=
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Vipin K. Varma, 2014/10/05
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Juan Pablo Amorocho D., 2014/10/05
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Vipin K. Varma, 2014/10/05
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Juan Pablo Amorocho, 2014/10/05
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Vipin K. Varma, 2014/10/06
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Juan Pablo Amorocho D., 2014/10/07
- Re: [Help-gsl] Numerical integration QAGS cannot reach tolerance and aborts, Vipin K. Varma, 2014/10/08