help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] what can I improve in that function ?


From: Emmanuel Favre-Nicolin
Subject: [Help-gsl] what can I improve in that function ?
Date: Tue, 5 Jul 2005 18:55:01 -0300
User-agent: KMail/1.8

Hi,

I have a function  int_PV (see the function at the end of the message) that 
uses gsl_integration_qags routine. There is an error message. I don't know 
what to do with it, what can I do to improve my function or to make 
calculation converging?


cacul at values:
bias =0.001000 mV ; temp_N =0.300000 K ; delta = 0.200000 mV ; Gnn= 1.000000 ; 
temp_S = 0.300000 K
gsl: qags.c:543: ERROR: number of iterations was insufficient
Default GSL error handler invoked.
Aborted


double f_PV (double x, void * p) {
  struct f_params_PV * params = (struct f_params_PV *)p;
  double bias = (params->bias);
  double temp = (params->temp);
  double delta = (params->delta);
  double temp_S = (params->temp_S);
return  1/((x*x*x)*sqrt(1-x*x))*( 1/( exp((1/x-bias)/temp)+1 ) 
+1/( exp((1/x+bias)/temp)+1 ) -2/( exp((1/x)/temp_S)+1 ) );
  }


double int_PV(double bias, double temp, double delta, double Gnn, double 
temp_S)
{double result,error;
struct f_params_PV params_PV;
gsl_integration_workspace * w = gsl_integration_workspace_alloc (100000);
gsl_function F;
//end of declaration
params_PV.temp_S=GSL_CONST_MKSA_BOLTZMANN*temp_S/(0.001*GSL_CONST_MKSA_ELECTRON_CHARGE*delta);//TEMP_S
 
is in DELTA units now
params_PV.temp=GSL_CONST_MKSA_BOLTZMANN*temp/(0.001*GSL_CONST_MKSA_ELECTRON_CHARGE*delta);//TEMP
 
is in DELTA units now
params_PV.delta=delta;
params_PV.Gnn=Gnn;
F.function = &f_PV;
F.params = &params_PV;
gsl_integration_qags (&F, 0, 1, 0, 1e-7, 100000,w, &result, &error);
gsl_integration_workspace_free (w);
//remarque préliminaire a ce niveau du programme on a 
1/params_PV.temp=0.001*e*delta/(kTn)?
return result*Gnn*(0.001*delta)*(0.001*delta);
}




reply via email to

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