[group] Form Factors [name] ellipsoid-of-revolution-glq [number parameters] 10, [description]

2016-02-18: Form Factor of Ellipsoid of Revolution with Semi-Axes R,R,eR:

I(Q) = I0 x P(Q);

P(Q) = integral[0..p/2] F 2 [ Q , r(a,R,e) ] sin(a) da;

r(a,R,e) = R[ sin2(e) + e2cos2(a) ]1/2;

F(Q,R) = 3( SIN( R Q ) - R Q COS( R Q ) ) / ( R Q )3.

I0= eta * volume * contrast ...

integration: Gauss-Legendre-Quadrature: nodes = fixed number of nodes

[x] Q [y] I [parameter names] epsilon,R,rhoE,rhoS,eta,nodes,bgd,I0,N,V, [initial values] 1[0.001..1000],50[1..10000],3e+10[-0.6e+10..7e+10],6.33e+10[-0.6e+10..7e+10],0.001[0..1],25[10..1000],0[0..2],1,1,1 [adjustibility] 1,1,0,0,1,0,0,0,0,0 [parameter description] Semi-Axes Ratio [1],Semi-Axe Length [A],SLD of solvent [cm^-2],SLD of solvent [cm^-2],[1] volume fraction of ellipsoids,[1] Gauss-Legendre quadrature :: control parameter,[cm^-1] background,[cm^-1] calculated :: forward scattering I(Q=0)=eta V contrast ,[cm^-3] calculated :: number density of ellipsoids N=eta/V,[A^3] calculated :: volume of ellipsoids [A^3] V=4Pi/3 epsilon R^3, [h-headers] #include "IncludedFunctions/gauss-legendre-quadrature.h" [included functions] //++++++++++++++++++++++++++ //+++ Sphere Form-Factor ++++++ //++++++++++++++++++++++++++ double sphere_form_factor (double Q, double R) { double FS; double RQ=fabs(R*Q); // if (RQ>0.00001) FS=3*(sin(RQ)-RQ*cos(RQ))/pow((RQ),3); else FS=cos(RQ/sqrt(5)); // return FS*FS; } //++++++++++++++++++++++++++ //+++ Function under integral +++ //++++++++++++++++++++++++++ double ellipsoidRevolution_under_integral(double alfa, void * ParaM) { //+++ getting of Q from data structure double Q = ((struct functionT *) ParaM)->Q [currentPoint]; //+++ double r = R*sqrt(sin(alfa)*sin(alfa)+epsilon*epsilon*cos(alfa)*cos(alfa)); //+++ return sphere_form_factor (Q, r) *sin(alfa); }; [code] int no=int(nodes); // number nodes Gauss-Legendre quadrature //+++ Gauss-Legendre quadrature :: weight and position of the quadrature //+++ defined as "static", survive between calls of function //+++ static gsl_vector *x; static gsl_vector *w; if (beforeIter || beforeFit) { x=gsl_vector_alloc(no); w=gsl_vector_alloc(no); GaussLegendreQuadrature(no, x,w); } //+++ alfa integral if (epsilon!=1) I=integral_GLI_fast(ellipsoidRevolution_under_integral,ParaM, no, x, w, 0,M_PI/2.0); else I=sphere_form_factor (Q, R); //+++ V=4*M_PI/3*epsilon*pow(R,3); // calculation if (V!=0) N=eta/V*1e24; // calculation I0=eta*V*pow(rhoE-rhoS,2.0)*1e-24; // calculation //+++ I=I0*I+bgd; //+++ cleen memory if (afterIter || afterFit) { gsl_vector_free(x); gsl_vector_free(w); }; [fortran] 0, [end]