Changeset 12c810f in sasmodels
- Timestamp:
- Mar 4, 2015 2:33:25 PM (10 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:
- b89f519
- Parents:
- d6adfbe
- Location:
- sasmodels/models
- Files:
-
- 3 deleted
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/lamellarCailleHG.py
rbfb195e r12c810f 1 1 # Note: model title and parameter table are inserted automatically 2 2 r""" 3 This model provides the scattering intensity, *I(q)* = *P(q)* \* *S(q)*, for a lamellar phase where a random 4 distribution in solution are assumed. Here a Caille S(Q) is used for the lamellar stacks. 3 This model provides the scattering intensity, $I(q) = P(q)S(q)$, for a lamellar 4 phase where a random distribution in solution are assumed. Here a Caille $S(Q)$ 5 is used for the lamellar stacks. 5 6 6 The scattering intensity *I(q)*is7 The scattering intensity $I(q)$ is 7 8 8 .. image:: img/lamellarCailleHG_139.PNG9 .. math:: 9 10 10 The form factor is 11 I(q) = 2 \pi \frac{P(q)S(q)}{\delta q^2} 11 12 12 .. image:: img/lamellarCailleHG_143.PNG13 13 14 and the structure factoris14 The form factor $P(q)$ is 15 15 16 .. image:: img/lamellarCailleHG_140.PNG 16 .. math:: 17 18 P(q) = \frac{4}{q^2}\big\{ 19 \Delta\rho_H \left[\sin[q(\delta_H + \delta_T)] - \sin(q\delta_T)\right] 20 + \Delta\rho_T\sin(q\delta_T)\big\}^2 21 22 and the structure factor $S(q)$ is 23 24 .. math:: 25 26 S(q) = 1 + 2 \sum_1^{N-1}\left(1-\frac{n}{N}\right) 27 \cos(qdn)\exp\left(-\frac{2q^2d^2\alpha(n)}{2}\right) 17 28 18 29 where 19 30 20 .. image:: img/lamellarCailleHG_141.PNG31 .. math:: 21 32 22 where |delta|\ T = tail length (or *tail_length*), |delta|\ H = head thickness (or *h_thickness*), 23 |drho|\ H = SLD(headgroup) - SLD(solvent), and |drho|\ T = SLD(tail) - SLD(headgroup). 24 Here *d* = (repeat) spacing, *K* = smectic bending elasticity, *B* = compression modulus, and N = number of lamellar 25 plates (*n_plates*). 33 \begin{eqnarray} 34 \alpha(n) &=& \frac{\eta_{cp}}{4\pi^2} \left(\ln(\pi n)+\gamma_E\right) \\ 35 \gamma_E &=& 0.5772156649&&\text{Euler's constant} \\ 36 \eta_{cp} &=& \frac{q_o^2k_B T}{8\pi\sqrt{K\overline{B}}} && \text{Caille constant} 37 \end{eqnarray} 26 38 27 NB: **When the Caille parameter is greater than approximately 0.8 to 1.0, the assumptions of the model are incorrect.**28 And due to a complication of the model function, users are responsible for making sure that all the assumptions are29 handled accurately (see the original reference below for more details).30 39 31 Non-integer numbers of stacks are calculated as a linear combination of results for the next lower and higher values. 40 $\delta_T$ is the tail length (or *tail_length*), $\delta_H$ is the head 41 thickness (or *head_length*), $\Delta\rho_H$ is SLD(headgroup) - SLD(solvent), 42 and $\Delta\rho_T$ is SLD(tail) - SLD(headgroup). Here $d$ is (repeat) spacing, 43 $K$ is smectic bending elasticity, $B$ is compression modulus, and $N$ is the 44 number of lamellar plates (*Nlayers*). 32 45 33 The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as 46 NB: **When the Caille parameter is greater than approximately 0.8 to 1.0, the 47 assumptions of the model are incorrect.** And due to a complication of the 48 model function, users are responsible for making sure that all the assumptions 49 are handled accurately (see the original reference below for more details). 50 51 Non-integer numbers of stacks are calculated as a linear combination of 52 results for the next lower and higher values. 53 54 The 2D scattering intensity is calculated in the same way as 1D, where 55 the $q$ vector is defined as 34 56 35 57 .. math:: 36 58 37 Q = \sqrt{Q_x^2 + Q_y^2}59 q = \sqrt{q_x^2 + q_y^2} 38 60 39 61 The returned value is in units of |cm^-1|, on absolute scale. 40 62 41 ============== ======== ============= 42 Parameter name Units Default value 43 ============== ======== ============= 44 background |cm^-1| 0.001 45 sld_head |Ang^-2| 2e-06 46 scale None 1 47 sld_solvent |Ang^-2| 6e-06 48 deltaH |Ang| 2 49 deltaT |Ang| 10 50 sld_tail |Ang^-2| 0 51 n_plates None 30 52 spacing |Ang| 40 53 caille |Ang^-2| 0.001 54 ============== ======== ============= 55 56 .. image:: img/lamellarCailleHG_142.jpg 63 .. image:: img/lamellarCailleHG_1d.jpg 57 64 58 65 *Figure. 1D plot using the default values (w/6000 data point).* 59 66 60 Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron Research61 (Kline, 2006).67 Our model uses the form factor calculations implemented in a C library provided 68 by the NIST Center for Neutron Research (Kline, 2006). 62 69 63 70 REFERENCE … … 122 129 demo = dict( 123 130 scale=1, background=0, 124 Nlayers=20,spacing=200., 125 Caille_parameter=0.05, 126 tail_length=15,head_length=10, 127 sld=-1, head_sld=4.0, solvent_sld=6.0, 128 tail_length_pd= 0.1, tail_length_pd_n=20, 129 head_length_pd= 0.05, head_length_pd_n=30, 130 spacing_pd= 0.2, spacing_pd_n=40 131 ) 131 Nlayers=20, 132 spacing=200., Caille_parameter=0.05, 133 tail_length=15,head_length=10, 134 #sld=-1, head_sld=4.0, solvent_sld=6.0, 135 sld=-1, head_sld=4.1, solvent_sld=6.0, 136 tail_length_pd= 0.1, tail_length_pd_n=20, 137 head_length_pd= 0.05, head_length_pd_n=30, 138 spacing_pd= 0.2, spacing_pd_n=40 139 ) 132 140 133 141 oldname = 'LamellarPSHGModel' -
sasmodels/models/lamellarCailleHG_kernel.c
r95e861b r12c810f 8 8 double Nlayers, 9 9 double dd, 10 double Cp, 10 double Cp, 11 11 double tail_sld, 12 12 double head_sld, … … 18 18 double Nlayers, 19 19 double dd, 20 double Cp, 20 double Cp, 21 21 double tail_sld, 22 22 double head_sld, … … 34 34 NN = trunc(Nlayers); //be sure that NN is an integer 35 35 36 Pq = (head_sld-solvent_sld)*(sin(qval*(head_length+tail_length))-sin(qval*tail_length)) + 36 Pq = (head_sld-solvent_sld)*(sin(qval*(head_length+tail_length))-sin(qval*tail_length)) + 37 37 (tail_sld-solvent_sld)*sin(qval*tail_length); 38 38 Pq *= Pq; … … 42 42 ii=0; 43 43 Sq = 0.0; 44 for(ii=1;ii< (NNint-1);ii+=1) {44 for(ii=1;ii<=(NNint-1);ii+=1) { 45 45 46 46 //fii = (double)ii; //do I really need to do this? - unused variable, removed 18Feb2015 … … 66 66 Sq += 1.0; 67 67 68 //if (Sq < 0) printf("q=%g: S(q) =%g\n", qval, Sq); 69 68 70 inten = 2.0*M_PI*Pq*Sq/(dd*qval*qval); 69 71
Note: See TracChangeset
for help on using the changeset viewer.