Changeset 463eb76e in sasview for sansmodels/src/sans/models/c_extensions/pearlnecklace.c
- Timestamp:
- Jul 25, 2011 3:43:34 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- bc7bc839
- Parents:
- 38155f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/pearlnecklace.c
r8c8cb05 r463eb76e 53 53 // Note take only 20 terms in Si series: 10 terms may be enough though. 54 54 double gamma; 55 gamma = Si(q* edge_separation , 6);55 gamma = Si(q* edge_separation); 56 56 gamma /= (q* edge_separation); 57 57 double beta; 58 beta = Si(q * (edge_separation + radius) , 6);59 beta -= Si(q * radius , 6);58 beta = Si(q * (edge_separation + radius)); 59 beta -= Si(q * radius); 60 60 beta /= (q* edge_separation); 61 61 … … 68 68 69 69 // form factor for num_pearls 70 sss = 1.0 - pow(sin _x(q*A_s), (int)num_pearls );71 sss /= pow((1.0-sin _x(q*A_s)), 2);72 sss *= sin_x(q*A_s);70 sss = 1.0 - pow(sinc(q*A_s), num_pearls ); 71 sss /= pow((1.0-sinc(q*A_s)), 2); 72 sss *= -sinc(q*A_s); 73 73 sss -= num_pearls/2.0; 74 sss += num_pearls/(1.0-sin _x(q*A_s));74 sss += num_pearls/(1.0-sinc(q*A_s)); 75 75 sss *= 2.0 * pow((m_s*psi), 2); 76 76 77 77 // form factor for num_strings (like thin rods) 78 78 double srr_1; 79 srr_1 = -pow(sin _x(q*edge_separation/2.0), 2);80 //printf ("sss %g, %g, %g\n",sss, srr_1, gamma); 79 srr_1 = -pow(sinc(q*edge_separation/2.0), 2); 80 81 81 srr_1 += 2.0 * gamma; 82 82 srr_1 *= num_strings; 83 83 double srr_2; 84 srr_2 = 2.0/(1.0-sin _x(q*A_s));84 srr_2 = 2.0/(1.0-sinc(q*A_s)); 85 85 srr_2 *= num_strings; 86 86 srr_2 *= pow(beta, 2); 87 87 double srr_3; 88 srr_3 = 1.0 - pow(sin _x(q*A_s), (int)num_strings);89 srr_3 /= pow((1.0-sin _x(q*A_s)), 2);88 srr_3 = 1.0 - pow(sinc(q*A_s), num_strings); 89 srr_3 /= pow((1.0-sinc(q*A_s)), 2); 90 90 srr_3 *= pow(beta, 2); 91 91 srr_3 *= -2.0; … … 96 96 97 97 // form factor for correlations 98 srs = -1.0;99 srs -= pow(sin _x(q*A_s), (int)num_strings);100 srs /= pow((1.0-sin _x(q*A_s)), 2);101 srs *= sin_x(q*A_s);102 srs += (num_strings/(1.0-sin _x(q*A_s)));98 srs = 1.0; 99 srs -= pow(sinc(q*A_s), num_strings); 100 srs /= pow((1.0-sinc(q*A_s)), 2); 101 srs *= -sinc(q*A_s); 102 srs += (num_strings/(1.0-sinc(q*A_s))); 103 103 srs *= 4.0; 104 104 srs *= (m_r * m_s * beta * psi); … … 111 111 form_factor *= scale; 112 112 form_factor += background; 113 114 113 return (form_factor); 115 114 }
Note: See TracChangeset
for help on using the changeset viewer.