help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Integration routine qawc


From: Thomas Weber
Subject: Re: [Help-gsl] Integration routine qawc
Date: Thu, 10 Nov 2005 13:45:47 +0100

Hi, 

Am Donnerstag, den 10.11.2005, 10:13 +0100 schrieb Silke Diedenhofen:
> Hello!
> 
> I have another problem using the integration routine qawc:
> gsl: ../integration/qawc.c:213: ERROR: maximum number of subdivisions reached
Well, the error message is obvious, isn't it?


>  double f (double y, void * params) {
>       double Wg = *(double *) params;
>       double omega_0 = *(double *) params;
>       double h_quer = *(double *) params;
>       double theta_1 = *(double *) params;
>       double tmp_7 = *(double *) params;
>       double tmp_6_1 = *(double *) params;
>       double tmp_6_2 = *(double *) params;
>       double theta_2 =  *(double *) params;
this plain simply doesn't work! The example in the gsl book takes only
one argument, therefore it's okay there. Please ask someone with some C
knowledge how you can pass your values to this function. Or mail me
privately, it's off-topic for this list here.

>       double f = (tmp_7/sqrt(y))*(tmp_6_1*(sqrt(theta_1) *
> (pow(gsl_sf_airy_Ai_deriv((Wg-h_quer*sqrt(y))/(h_quer * theta_1),
> GSL_PREC_DOUBLE), 2)- (Wg-(h_quer*sqrt(y)))/(h_quer * theta_1) *
> pow(gsl_sf_airy_Ai((Wg-(h_quer*sqrt(y)))/(h_quer * theta_1),
> GSL_PREC_DOUBLE),2))-sqrt(sqrt(y)-(2*PI*C/0.00000087))/PI) + tmp_6_2 *
> (sqrt(theta_2)*(pow(gsl_sf_airy_Ai_deriv((Wg-(h_quer*sqrt(y)))/(h_quer *
> theta_2), GSL_PREC_DOUBLE), 2)- (Wg-(h_quer*sqrt(y)))/(h_quer * theta_2) *
> pow(gsl_sf_airy_Ai((Wg-(h_quer*sqrt(y)))/(h_quer * theta_2),
> GSL_PREC_DOUBLE),2))-sqrt(sqrt(y)-(2*PI*C/0.00000087))/PI)); 
Argh! Do you really expect anybody (including yourself) to be able to
spot an error in this code?
The possibility of local variables in a function exists for reason.

And it's not a good idea to call a function "f" and use the same name
for a variable in the function.

Regards
        Thomas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]