Changeset 71b751d in sasmodels for sasmodels/models/lamellar_stack_paracrystal.c
 Timestamp:
 Aug 14, 2018 12:09:34 PM (2 years ago)
 Branches:
 master, core_shell_microgels, magnetic_model, ticket1257vesicleproduct, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
 Children:
 86aa992
 Parents:
 2f8cbb9
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/models/lamellar_stack_paracrystal.c
r5467cd8 r71b751d 18 18 int n2 = n1 + 1; 19 19 const double xn = (double)n2  fp_Nlayers; //fractional contribution of n1 20 20 21 21 const double ww = exp(0.5*square(qval*pd*davg)); 22 22 … … 27 27 28 28 Znq = xn*Snq; 29 29 30 30 //calculate the n2 contribution 31 31 an = paraCryst_an(ww,qval,davg,n2); … … 33 33 34 34 Znq += (1.0xn)*Snq; 35 35 36 36 //and the independent contribution 37 37 Znq += (1.0ww*ww)/(1.0+ww*ww2.0*ww*cos(qval*davg)); 38 38 39 39 //the limit when Nlayers approaches infinity 40 40 // Zq = (1ww^2)/(1+ww^22*ww*cos(qval*davg)) 41 41 42 42 const double xi = th/2.0; //use 1/2 the bilayer thickness 43 43 const double Pbil = square(sas_sinx_x(qval*xi)); 44 44 45 45 const double contr = sld  solvent_sld; 46 46 const double inten = 2.0*M_PI*contr*contr*Pbil*Znq/(qval*qval); … … 52 52 double 53 53 paraCryst_sn(double ww, double qval, double davg, int Nlayers, double an) { 54 54 55 55 double Snq; 56 56 57 57 Snq = an/( (double)Nlayers*square(1.0+ww*ww2.0*ww*cos(qval*davg)) ); 58 58 59 59 return Snq; 60 60 } … … 63 63 paraCryst_an(double ww, double qval, double davg, int Nlayers) { 64 64 double an; 65 65 66 66 an = 4.0*ww*ww  2.0*(ww*ww*ww+ww)*cos(qval*davg); 67 67 an = 4.0*pow(ww,(Nlayers+2))*cos((double)Nlayers*qval*davg); 68 68 an += 2.0*pow(ww,(Nlayers+3))*cos((double)(Nlayers1)*qval*davg); 69 69 an += 2.0*pow(ww,(Nlayers+1))*cos((double)(Nlayers+1)*qval*davg); 70 70 71 71 return an; 72 72 }
Note: See TracChangeset
for help on using the changeset viewer.