Changeset e7678b2 in sasmodels for sasmodels/models/flexible_cylinder_ex.c
- Timestamp:
- Feb 29, 2016 8:21:55 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 73860b6
- Parents:
- deac08c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/flexible_cylinder_ex.c
r504abee re7678b2 17 17 elliptical_crosssection(double q, double a, double b) 18 18 { 19 double uplim,lolim,Pi,summ,arg,zi,yyy,answer; 20 int i,nord=76; 19 double summ=0.0; 21 20 22 Pi = 4.0*atan(1.0); 23 lolim=0.0; 24 uplim=Pi/2.0; 25 summ=0.0; 21 for(int i=0;i<N_POINTS_76;i++) { 22 double zi = ( Gauss76Z[i] + 1.0 )*M_PI/4.0; 23 double sn, cn; 24 SINCOS(zi, sn, cn); 25 double arg = q*sqrt(a*a*sn*sn+b*b*cn*cn); 26 double yyy = pow((double)J1c(arg),2); 27 yyy *= Gauss76Wt[i]; 28 summ += yyy; 29 } 26 30 27 for(i=0;i<nord;i++) { 28 zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0; 29 arg = q*sqrt(a*a*sin(zi)*sin(zi)+b*b*cos(zi)*cos(zi)); 30 yyy = pow((2.0 * J1(arg) / arg),2); 31 yyy *= Gauss76Wt[i]; 32 summ += yyy; 33 } 34 answer = (uplim-lolim)/2.0*summ; 35 answer *= 2.0/Pi; 36 return(answer); 31 summ /= 2.0; 32 return(summ); 37 33 38 34 } … … 47 43 { 48 44 49 double Pi,flex,crossSect, cont;45 double flex,crossSect, cont; 50 46 51 Pi = 4.0*atan(1.0); 52 cont = sld - solvent_sld; 53 crossSect = elliptical_crosssection(q,radius,(radius*axis_ratio)); 47 cont = sld - solvent_sld; 48 crossSect = elliptical_crosssection(q,radius,(radius*axis_ratio)); 54 49 55 56 57 flex *= Pi*radius*radius*axis_ratio*axis_ratio*length;58 59 50 flex = Sk_WR(q,length,kuhn_length); 51 flex *= crossSect; 52 flex *= M_PI*radius*radius*axis_ratio*axis_ratio*length; 53 flex *= cont*cont; 54 flex *= 1.0e-4; 60 55 61 56 return flex; 62 57 } 63 58 … … 71 66 { 72 67 73 74 75 76 77 78 79 68 double result = flexible_cylinder_ex_kernel(q, 69 length, 70 kuhn_length, 71 radius, 72 axis_ratio, 73 sld, 74 solvent_sld); 80 75 81 76 return result; 82 77 } 83 78 … … 90 85 double solvent_sld) 91 86 { 92 93 94 95 96 97 98 99 100 87 double q; 88 q = sqrt(qx*qx+qy*qy); 89 double result = flexible_cylinder_ex_kernel(q, 90 length, 91 kuhn_length, 92 radius, 93 axis_ratio, 94 sld, 95 solvent_sld); 101 96 102 97 return result; 103 98 }
Note: See TracChangeset
for help on using the changeset viewer.