Changeset 56b0435 in sasmodels
- Timestamp:
- Dec 20, 2016 5:07:15 PM (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:
- a0168e8
- Parents:
- abb6e4f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/lamellar_stack_caille.c
r0bef47b r56b0435 3 3 */ 4 4 5 double Iq(double qval, 6 double del, 7 double Nlayers, 8 double dd, 9 double Cp, 10 double sld, 11 double solvent_sld); 12 13 double Iq(double qval, 14 double del, 15 double Nlayers, 16 double dd, 17 double Cp, 18 double sld, 19 double solvent_sld) 5 static double 6 Iq(double qval, 7 double del, 8 double fp_Nlayers, 9 double dd, 10 double Cp, 11 double sld, 12 double solvent_sld) 20 13 { 21 double contr,NN; //local variables of coefficient wave 14 int Nlayers = (int)(fp_Nlayers+0.5); //cast to an integer for the loop 15 double contr; //local variables of coefficient wave 22 16 double inten,Pq,Sq,alpha,temp,t2; 23 17 //double dQ, dQDefault, t1, t3; 24 int ii,NNint;25 18 // from wikipedia 0.577215664901532860606512090082402431042159335 26 19 const double Euler = 0.577215664901533; // Euler's constant, increased sig figs for new models Feb 2015 … … 28 21 //dQ = dQDefault; // REMOVED UNUSED dQ calculations for new models Feb 2015 29 22 30 NN = trunc(Nlayers); //be sure that NN is an integer31 32 23 contr = sld - solvent_sld; 33 24 34 25 Pq = 2.0*contr*contr/qval/qval*(1.0-cos(qval*del)); 35 26 36 NNint = (int)NN; //cast to an integer for the loop37 ii=0;38 27 Sq = 0.0; 39 28 // the vital "=" in ii<= added March 2015 40 for (ii=1;ii<=(NNint-1);ii+=1) {29 for (int ii=1; ii<=Nlayers-1; ii++) { 41 30 42 31 //fii = (double)ii; //do I really need to do this? - unused variable, removed 18Feb2015 … … 48 37 //t3 = dQ*dQ*dd*dd*ii*ii; 49 38 50 temp = 1.0 -ii/NN;39 temp = 1.0 - (double)ii / (double)Nlayers; 51 40 //temp *= cos(dd*qval*ii/(1.0+t1)); 52 41 temp *= cos(dd*qval*ii);
Note: See TracChangeset
for help on using the changeset viewer.