Changeset 44e8a93 in sasmodels
- Timestamp:
- Apr 8, 2017 6:05:01 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 85190c2
- Parents:
- f3073b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_bicelle_elliptical.c
rf4f85b3 r44e8a93 1 double form_volume(double radius, double x_core, double thick_rim, double thick_face, double length);2 double Iq(double q,3 double radius,4 double x_core,5 double thick_rim,6 double thick_face,7 double length,8 double core_sld,9 double face_sld,10 double rim_sld,11 double solvent_sld);12 13 14 double Iqxy(double qx, double qy,15 double radius,16 double x_core,17 double thick_rim,18 double thick_face,19 double length,20 double core_sld,21 double face_sld,22 double rim_sld,23 double solvent_sld,24 double theta,25 double phi,26 double psi);27 28 1 // NOTE that "length" here is the full height of the core! 29 double form_volume(double radius, double x_core, double thick_rim, double thick_face, double length) 2 static double 3 form_volume(double r_minor, 4 double x_core, 5 double thick_rim, 6 double thick_face, 7 double length) 30 8 { 31 return M_PI*(r adius+thick_rim)*(radius*x_core+thick_rim)*(length+2.0*thick_face);9 return M_PI*(r_minor+thick_rim)*(r_minor*x_core+thick_rim)*(length+2.0*thick_face); 32 10 } 33 11 34 double Iq(double q, 35 double rad, 36 double x_core, 37 double radthick, 38 double facthick, 39 double length, 40 double rhoc, 41 double rhoh, 42 double rhor, 43 double rhosolv) 12 static double 13 Iq(double q, 14 double r_minor, 15 double x_core, 16 double thick_rim, 17 double thick_face, 18 double length, 19 double rhoc, 20 double rhoh, 21 double rhor, 22 double rhosolv) 44 23 { 45 24 double si1,si2,be1,be2; … … 54 33 //const double vbj=M_PI; 55 34 56 const double r adius_major = rad* x_core;57 const double rA = 0.5*(square(r adius_major) + square(rad));58 const double rB = 0.5*(square(r adius_major) - square(rad));59 const double dr1 = (rhoc-rhoh) *M_PI*r ad*radius_major*(2.0*halfheight);;60 const double dr2 = (rhor-rhosolv)*M_PI*(r ad+radthick)*(radius_major+radthick)*2.0*(halfheight+facthick);61 const double dr3 = (rhoh-rhor) *M_PI*r ad*radius_major*2.0*(halfheight+facthick);62 //const double vol1 = M_PI*r ad*radius_major*(2.0*halfheight);63 //const double vol2 = M_PI*(r ad+radthick)*(radius_major+radthick)*2.0*(halfheight+facthick);64 //const double vol3 = M_PI*r ad*radius_major*2.0*(halfheight+facthick);35 const double r_major = r_minor * x_core; 36 const double rA = 0.5*(square(r_major) + square(r_minor)); 37 const double rB = 0.5*(square(r_major) - square(r_minor)); 38 const double dr1 = (rhoc-rhoh) *M_PI*r_minor*r_major*(2.0*halfheight);; 39 const double dr2 = (rhor-rhosolv)*M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); 40 const double dr3 = (rhoh-rhor) *M_PI*r_minor*r_major*2.0*(halfheight+thick_face); 41 //const double vol1 = M_PI*r_minor*r_major*(2.0*halfheight); 42 //const double vol2 = M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); 43 //const double vol3 = M_PI*r_minor*r_major*2.0*(halfheight+thick_face); 65 44 66 45 //initialize integral … … 74 53 double inner_sum=0; 75 54 double sinarg1 = q*halfheight*cos_alpha; 76 double sinarg2 = q*(halfheight+ facthick)*cos_alpha;55 double sinarg2 = q*(halfheight+thick_face)*cos_alpha; 77 56 si1 = sas_sinx_x(sinarg1); 78 57 si2 = sas_sinx_x(sinarg2); … … 83 62 const double rr = sqrt(rA - rB*cos(beta)); 84 63 double besarg1 = q*rr*sin_alpha; 85 double besarg2 = q*(rr+ radthick)*sin_alpha;64 double besarg2 = q*(rr+thick_rim)*sin_alpha; 86 65 be1 = sas_2J1x_x(besarg1); 87 66 be2 = sas_2J1x_x(besarg2); … … 97 76 } 98 77 99 double 78 static double 100 79 Iqxy(double qx, double qy, 101 double r ad,80 double r_minor, 102 81 double x_core, 103 double radthick,104 double facthick,82 double thick_rim, 83 double thick_face, 105 84 double length, 106 85 double rhoc, … … 118 97 const double dr2 = rhor-rhosolv; 119 98 const double dr3 = rhoh-rhor; 120 const double r adius_major = rad*x_core;99 const double r_major = r_minor*x_core; 121 100 const double halfheight = 0.5*length; 122 const double vol1 = M_PI*r ad*radius_major*length;123 const double vol2 = M_PI*(r ad+radthick)*(radius_major+radthick)*2.0*(halfheight+facthick);124 const double vol3 = M_PI*r ad*radius_major*2.0*(halfheight+facthick);101 const double vol1 = M_PI*r_minor*r_major*length; 102 const double vol2 = M_PI*(r_minor+thick_rim)*(r_major+thick_rim)*2.0*(halfheight+thick_face); 103 const double vol3 = M_PI*r_minor*r_major*2.0*(halfheight+thick_face); 125 104 126 // Compute: r = sqrt((radius_major*zhat)^2 + (radius_minor*yhat)^2) 127 // Given: radius_major = r_ratio * radius_minor 128 // ASSUME the sin_alpha is included in the separate integration over orientation of rod angle 129 const double rad_minor = rad; 130 const double rad_major = rad*x_core; 131 const double r_hat = sqrt(square(rad_major*xhat) + square(rad_minor*yhat)); 132 const double rshell_hat = sqrt(square((rad_major+radthick)*xhat) 133 + square((rad_minor+radthick)*yhat)); 105 // Compute effective radius in rotated coordinates 106 const double r_hat = sqrt(square(r_major*xhat) + square(r_minor*yhat)); 107 const double rshell_hat = sqrt(square((r_major+thick_rim)*xhat) 108 + square((r_minor+thick_rim)*yhat)); 134 109 const double be1 = sas_2J1x_x( q*r_hat ); 135 110 const double be2 = sas_2J1x_x( q*rshell_hat ); 136 111 const double si1 = sas_sinx_x( q*halfheight*zhat ); 137 const double si2 = sas_sinx_x( q*(halfheight + facthick)*zhat );112 const double si2 = sas_sinx_x( q*(halfheight + thick_face)*zhat ); 138 113 const double Aq = square( vol1*dr1*si1*be1 + vol2*dr2*si2*be2 + vol3*dr3*si2*be1); 139 //const double vol = form_volume(radius_minor, r_ratio, length);140 114 return 1.0e-4 * Aq; 141 115 }
Note: See TracChangeset
for help on using the changeset viewer.