#include#include #include double INTERPOLATE1D( double logx,const vector & logx0, const vector & logy0) { const gsl_interp_type *T = gsl_interp_cspline;//gsl_interp_linear; gsl_spline *s = gsl_spline_alloc(T,logx0.size()); gsl_interp_accel *acc = gsl_interp_accel_alloc(); gsl_spline_init(s,&logx0[0],&logy0[0],logx0.size()); double logy = gsl_spline_eval(s,logx,acc); gsl_spline_free(s); gsl_interp_accel_free(acc); return pow(10,logy); }
Interested in particle astrophysics and plasma astrophysics. This blog is my research/private notebook.
Friday, August 2, 2024
GSL interpolation
Thursday, August 1, 2024
pass parameters in GSL integration
struct my_f_params {int a; int b;};
gsl_function F1;
struct my_f_params alpha = {2,2};
F1.function = &f1;
F1.params = & alpha;
struct my_f_params * params = (struct my_f_params *)p;
int n = (params->a);
int m = (params->b);
----------
double params[] = { y, z };
F.params = params;
double y = ((double *)params)[0];
double z = *((double *)p+1);
Thursday, June 6, 2024
Levi-Civita symbol and cross product
http://www.homepages.ucl.ac.uk/~ucappgu/seminars/levi-civita.pdf
https://en.wikipedia.org/wiki/Levi-Civita_symbol
Sunday, May 26, 2024
Tools
https://www.oacommunity.org/resources
// resources related to academic writing
Resources: applying for PhD / Postdoc / Faculty and more
save website as pdf https://pdfmage.org/
Monday, March 11, 2024
Sunday, January 21, 2024
Subscribe to:
Posts (Atom)