Changeset 6ab4ed8 in sasmodels
- Timestamp:
- Mar 18, 2016 9:55:38 AM (9 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:
- 5bfb213
- Parents:
- 5852c86
- Location:
- sasmodels/models
- Files:
-
- 7 moved
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/lamellar_hg.py
raa2edb2 r6ab4ed8 26 26 27 27 where $\delta_T$ is *tail_length*, $\delta_H$ is *head_length*, 28 $\Delta\rho_H$ is the head contrast (* head_sld* $-$ *solvent_sld*),29 and $\Delta\rho_T$ is tail contrast (*sld* $-$ *s olvent_sld*).28 $\Delta\rho_H$ is the head contrast (*sld_head* $-$ *sld_solvent*), 29 and $\Delta\rho_T$ is tail contrast (*sld* $-$ *sld_solvent*). 30 30 31 31 The 2D scattering intensity is calculated in the same way as 1D, where … … 49 49 from numpy import inf 50 50 51 name = "lamellar_ FFHG"52 title = "Random lamellar phase with Head Groups"51 name = "lamellar_hg" 52 title = "Random lamellar phase with Head and Tail Groups" 53 53 description = """\ 54 [Random lamellar phase with Head Groups]54 [Random lamellar phase with Head and Tail Groups] 55 55 I(q)= 2*pi*P(q)/(2(H+T)*q^(2)), where 56 56 P(q)= see manual 57 57 layer thickness =(H+T+T+H) = 2(Head+Tail) 58 58 sld = Tail scattering length density 59 head_sld = Head scattering length density60 s olvent_sld= solvent scattering length density59 sld_head = Head scattering length density 60 sld_solvent = solvent scattering length density 61 61 background = incoherent background 62 62 scale = scale factor … … 66 66 # pylint: disable=bad-whitespace, line-too-long 67 67 # ["name", "units", default, [lower, upper], "type","description"], 68 parameters = [["tail_length", "Ang", 15, [0, inf], "volume", "Tail thickness "],69 ["head_length", "Ang", 10, [0, inf], "volume", " head thickness"],68 parameters = [["tail_length", "Ang", 15, [0, inf], "volume", "Tail thickness ( total = H+T+T+H)"], 69 ["head_length", "Ang", 10, [0, inf], "volume", "Head thickness"], 70 70 ["sld", "1e-6/Ang^2", 0.4, [-inf,inf], "", "Tail scattering length density"], 71 [" head_sld", "1e-6/Ang^2", 3.0, [-inf,inf], "", "Head scattering length density"],72 ["s olvent_sld", "1e-6/Ang^2", 6, [-inf,inf], "", "Solvent scattering length density"]]71 ["sld_head", "1e-6/Ang^2", 3.0, [-inf,inf], "", "Head scattering length density"], 72 ["sld_solvent", "1e-6/Ang^2", 6, [-inf,inf], "", "Solvent scattering length density"]] 73 73 # pylint: enable=bad-whitespace, line-too-long 74 74 … … 81 81 Iq = """ 82 82 const double qsq = q*q; 83 const double drh = head_sld - solvent_sld;84 const double drt = sld - s olvent_sld; //correction 13FEB06 by L.Porcar83 const double drh = sld_head - sld_solvent; 84 const double drt = sld - sld_solvent; //correction 13FEB06 by L.Porcar 85 85 const double qT = q*tail_length; 86 86 double Pq, inten; … … 106 106 demo = dict(scale=1, background=0, 107 107 tail_length=15, head_length=10, 108 sld=0.4, head_sld=3.0, solvent_sld=6.0,108 sld=0.4, sld_head=3.0, sld_solvent=6.0, 109 109 tail_length_pd=0.2, tail_length_pd_n=40, 110 110 head_length_pd=0.01, head_length_pd_n=40) … … 112 112 oldname = 'LamellarFFHGModel' 113 113 oldpars = dict(head_length='h_thickness', tail_length='t_length', 114 sld='sld_tail', head_sld='sld_head', solvent_sld='sld_solvent')114 sld='sld_tail', sld_head='sld_head', sld_solvent='sld_solvent') 115 115 # 116 116 tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 15.0, 'head_length': 10.0, 117 'sld': 0.4, 'head_sld': 3.0, 'solvent_sld': 6.0}, [0.001], [653143.9209]]] 117 'sld': 0.4, 'sld_head': 3.0, 'sld_solvent': 6.0}, [0.001], [653143.9209]]] 118 # ADDED by: RKH ON: 18Mar2016 converted from sasview previously, now renaming everything & sorting the docs -
sasmodels/models/lamellar_hg_stack_caille.py
raa2edb2 r6ab4ed8 9 9 .. math:: 10 10 11 I(q) = 2 \pi \frac{P(q)S(q)}{ \delta q^2}11 I(q) = 2 \pi \frac{P(q)S(q)}{q^2\delta } 12 12 13 13 … … 56 56 results for the next lower and higher values. 57 57 58 Be aware that the computations may be very slow. 59 58 60 The 2D scattering intensity is calculated in the same way as 1D, where 59 61 the $q$ vector is defined as … … 73 75 from numpy import inf 74 76 75 name = "lamellar CailleHG"76 title = "Random lamellar sheet with Caille structure factor"77 name = "lamellar_hg_stack_caille" 78 title = "Random lamellar head/tail/tail/head sheet with Caille structure factor" 77 79 description = """\ 78 80 [Random lamellar phase with Caille structure factor] … … 104 106 ["sld", "1e-6/Ang^2", 0.4, [-inf, inf], "", 105 107 "Tail scattering length density"], 106 [" head_sld", "1e-6/Ang^2", 2.0, [-inf, inf], "",108 ["sld_head", "1e-6/Ang^2", 2.0, [-inf, inf], "", 107 109 "Head scattering length density"], 108 ["s olvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "",110 ["sld_solvent", "1e-6/Ang^2", 6, [-inf, inf], "", 109 111 "Solvent scattering length density"], 110 112 ] 111 113 112 source = ["lamellar CailleHG_kernel.c"]114 source = ["lamellar_hg_stack_caille_kernel.c"] 113 115 114 116 # No volume normalization despite having a volume parameter … … 129 131 Nlayers=20, spacing=200., Caille_parameter=0.05, 130 132 tail_length=15, head_length=10, 131 #sld=-1, head_sld=4.0, solvent_sld=6.0,132 sld=-1, head_sld=4.1, solvent_sld=6.0,133 #sld=-1, sld_head=4.0, sld_solvent=6.0, 134 sld=-1, sld_head=4.1, sld_solvent=6.0, 133 135 tail_length_pd=0.1, tail_length_pd_n=20, 134 136 head_length_pd=0.05, head_length_pd_n=30, … … 140 142 oldpars = dict( 141 143 tail_length='deltaT', head_length='deltaH', Nlayers='n_plates', 142 Caille_parameter='caille', sld='sld_tail', head_sld='sld_head',143 s olvent_sld='sld_solvent')144 Caille_parameter='caille', sld='sld_tail', sld_head='sld_head', 145 sld_solvent='sld_solvent') 144 146 # 145 147 tests = [[{'scale': 1.0, 'background': 0.0, 'tail_length': 10.0, 'head_length': 2.0, 146 148 'Nlayers': 30.0, 'spacing': 40., 'Caille_parameter': 0.001, 'sld': 0.4, 147 ' head_sld': 2.0, 'solvent_sld': 6.0, 'tail_length_pd': 0.0,149 'sld_head': 2.0, 'sld_solvent': 6.0, 'tail_length_pd': 0.0, 148 150 'head_length_pd': 0.0, 'spacing_pd': 0.0}, [0.001], [6838238.571488]]] 151 # ADDED by: RKH ON: 18Mar2016 converted from sasview previously, now renaming everything & sorting the docs -
sasmodels/models/lamellar_stack_caille.py
raa2edb2 r6ab4ed8 11 11 .. math:: 12 12 13 I(q) = 2\pi \frac{P(q)S(q)}{ \delta q^2}13 I(q) = 2\pi \frac{P(q)S(q)}{q^2\delta } 14 14 15 15 The form factor is … … 70 70 from numpy import inf 71 71 72 name = "lamellar PS"72 name = "lamellar_stack_caille" 73 73 title = "Random lamellar sheet with Caille structure factor" 74 74 description = """\ … … 92 92 ["Caille_parameter", "1/Ang^2", 0.1, [0.0,0.8], "", "Caille parameter"], 93 93 ["sld", "1e-6/Ang^2", 6.3, [-inf,inf], "", "layer scattering length density"], 94 ["s olvent_sld", "1e-6/Ang^2", 1.0, [-inf,inf], "", "Solvent scattering length density"],94 ["sld_solvent", "1e-6/Ang^2", 1.0, [-inf,inf], "", "Solvent scattering length density"], 95 95 ] 96 96 # pylint: enable=bad-whitespace, line-too-long 97 97 98 source = ["lamellar Caille_kernel.c"]98 source = ["lamellar_stack_caille_kernel.c"] 99 99 100 100 # No volume normalization despite having a volume parameter … … 113 113 demo = dict(scale=1, background=0, 114 114 thickness=67., Nlayers=3.75, spacing=200., 115 Caille_parameter=0.268, sld=1.0, s olvent_sld=6.34,115 Caille_parameter=0.268, sld=1.0, sld_solvent=6.34, 116 116 thickness_pd=0.1, thickness_pd_n=100, 117 117 spacing_pd=0.05, spacing_pd_n=40) … … 120 120 oldpars = dict(thickness='delta', Nlayers='N_plates', 121 121 Caille_parameter='caille', 122 sld='sld_bi', s olvent_sld='sld_sol')122 sld='sld_bi', sld_solvent='sld_sol') 123 123 # 124 124 tests = [ 125 125 [{'scale': 1.0, 'background': 0.0, 'thickness': 30., 'Nlayers': 20.0, 126 126 'spacing': 400., 'Caille_parameter': 0.1, 'sld': 6.3, 127 's olvent_sld': 1.0, 'thickness_pd': 0.0, 'spacing_pd': 0.0},127 'sld_solvent': 1.0, 'thickness_pd': 0.0, 'spacing_pd': 0.0}, 128 128 [0.001], [28895.13397]] 129 129 ] 130 # ADDED by: RKH ON: 18Mar2016 converted from sasview previously, now renaming everything & sorting the docs -
sasmodels/models/lamellar_stack_paracrystal.py
raa2edb2 r6ab4ed8 16 16 *not* the total excluded volume of the paracrystal), 17 17 18 - *sld* $-$ *s olvent_sld* is the contrast $\Delta \rho$,18 - *sld* $-$ *sld_solvent* is the contrast $\Delta \rho$, 19 19 20 20 - *thickness* is the layer thickness $t$, … … 36 36 37 37 The form factor of the bilayer is approximated as the cross section of an 38 infinite, planar bilayer of thickness $t$ 38 infinite, planar bilayer of thickness $t$ (compare the equations for the 39 lamellar model). 39 40 40 41 .. math:: … … 94 95 from numpy import inf 95 96 96 name = "lamellar PC"97 name = "lamellar_stack_paracrystal" 97 98 title = "Random lamellar sheet with paracrystal structure factor" 98 99 description = """\ … … 120 121 ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 121 122 "layer scattering length density"], 122 ["s olvent_sld", "1e-6/Ang^2", 6.34, [-inf, inf], "",123 ["sld_solvent", "1e-6/Ang^2", 6.34, [-inf, inf], "", 123 124 "Solvent scattering length density"], 124 125 ] 125 126 126 127 127 source = ["lamellar PC_kernel.c"]128 source = ["lamellar_stack_paracrystal_kernel.c"] 128 129 129 130 form_volume = """ … … 140 141 demo = dict(scale=1, background=0, 141 142 thickness=33, Nlayers=20, spacing=250, spacing_polydisp=0.2, 142 sld=1.0, s olvent_sld=6.34,143 sld=1.0, sld_solvent=6.34, 143 144 thickness_pd=0.2, thickness_pd_n=40) 144 145 145 146 oldname = 'LamellarPCrystalModel' 146 147 oldpars = dict(spacing_polydisp='pd_spacing', sld='sld_layer', 147 s olvent_sld='sld_solvent')148 sld_solvent='sld_solvent') 148 149 # 149 150 tests = [ 150 151 [ {'scale': 1.0, 'background' : 0.0, 'thickness' : 33.,'Nlayers' : 20.0, 'spacing' : 250., 'spacing_polydisp' : 0.2, 151 'sld' : 1.0, 's olvent_sld' : 6.34,152 'sld' : 1.0, 'sld_solvent' : 6.34, 152 153 'thickness_pd' : 0.0, 'thickness_pd_n' : 40 }, [0.001, 0.215268], [21829.3, 0.00487686]] 153 154 ] 155 # ADDED by: RKH ON: 18Mar2016 converted from sasview previously, now renaming everything & sorting the docs
Note: See TracChangeset
for help on using the changeset viewer.