Changeset 785cbec in sasmodels
- Timestamp:
- Aug 5, 2016 11:03:19 AM (8 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:
- c8de1bd
- Parents:
- e187b25
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/conf.py
r39674a0 r785cbec 36 36 #'only_directives', 37 37 #'matplotlib.sphinxext.mathmpl', 38 'matplotlib.sphinxext.only_directives',38 #'matplotlib.sphinxext.only_directives', 39 39 'matplotlib.sphinxext.plot_directive', 40 40 'dollarmath', -
sasmodels/generate.py
r0f00d95 r785cbec 145 145 146 146 :func:`load_kernel_module` loads the model definition file and 147 : modelinfo:`make_model_info` parses it. :func:`make_source`147 :func:`modelinfo.make_model_info` parses it. :func:`make_source` 148 148 converts C-based model definitions to C source code, including the 149 149 polydispersity integral. :func:`model_sources` returns the list of -
sasmodels/list_pars.py
r6d6508e r785cbec 13 13 import sys 14 14 15 from .core import load_model_info 16 from .compare import MODELS,columnize15 from .core import load_model_info, list_models 16 from .compare import columnize 17 17 18 18 def find_pars(): … … 23 23 """ 24 24 partable = {} 25 for name in sorted(MODELS):25 for name in list_models(): 26 26 model_info = load_model_info(name) 27 27 for p in model_info.parameters.kernel_parameters: -
sasmodels/models/fractal.py
r42356c8 r785cbec 7 7 .. math:: 8 8 9 I(q) &=& \phi\ V_{block} (\rho_{block} - \rho_{solvent})^2 P(q)S(q)10 + background9 I(q) = \phi\ V_\text{block} (\rho_\text{block} 10 - \rho_\text{solvent})^2 P(q)S(q) + \text{background} 11 11 12 12 where $\phi$ is The volume fraction of the spherical "building block" particles … … 20 20 .. math:: 21 21 22 \begin{eqnarray} 23 P(q)&=& F(qR_0)^2 \\ 24 F(q)&=& \frac{3 (sinx - x cosx)}{x^3} \\ 25 V_{particle} &=& \frac{4}{3}\ \pi R_0 \\ 26 S(q) &=& 1 + \frac{D_f\ \Gamma\!(D_f-1)}{[1+1/(q \xi)^2\ ]^{(D_f -1)/2}} 27 \frac{sin[(D_f-1) \tan^{-1}(q \xi) ]}{(q R_0)^{D_f}} 28 \end{eqnarray} 22 P(q)&= F(qR_0)^2 23 24 F(q)&= \frac{3 (\sin x - x \cos x)}{x^3} 25 26 V_\text{particle} &= \frac{4}{3}\ \pi R_0 27 28 S(q) &= 1 + \frac{D_f\ \Gamma\!(D_f-1)}{[1+1/(q \xi)^2\ ]^{(D_f -1)/2}} 29 \frac{\sin[(D_f-1) \tan^{-1}(q \xi) ]}{(q R_0)^{D_f}} 29 30 30 31 where $\xi$ is the correlation length representing the cluster size and $D_f$ -
sasmodels/models/onion.py
re187b25 r785cbec 36 36 37 37 \begin{align*} 38 39 38 f_\text{core} 40 39 &= 4\pi\int_0^{r_\text{core}} \rho_\text{core} … … 75 74 thickness of the $k^\text{th}$ shell in the equation above, respectively. 76 75 77 For $A \gt 0$, 78 79 .. math:: 80 :nowrap: 81 82 \begin{align*} 76 For $A > 0$, 77 78 .. math:: 79 83 80 f_\text{shell} &= 4 \pi \int_{r_{\text{shell}-1}}^{r_\text{shell}} 84 81 \left[ B\exp 85 82 \left(A (r - r_{\text{shell}-1}) / \Delta t_\text{shell} \right) + C 86 \right] \frac{\sin(qr)}{qr}\,r^2\,\mathrm{d}r \\ 83 \right] \frac{\sin(qr)}{qr}\,r^2\,\mathrm{d}r 84 87 85 &= 3BV(r_\text{shell}) e^A h(\alpha_\text{out},\beta_\text{out}) 88 86 - 3BV(r_{\text{shell}-1}) h(\alpha_\text{in},\beta_\text{in}) 89 87 + 3CV(r_{\text{shell}}) \frac{j_1(\beta_\text{out})}{\beta_\text{out}} 90 88 - 3CV(r_{\text{shell}-1}) \frac{j_1(\beta_\text{in})}{\beta_\text{in}} 91 \end{align*}92 89 93 90 for … … 102 99 &\alpha_\text{out} &= A\frac{r_\text{shell}}{\Delta t_\text{shell}} \\ 103 100 \beta_\text{in} &= qr_{\text{shell}-1} 104 &\beta_\text{out} &= qr_\text{shell} 101 &\beta_\text{out} &= qr_\text{shell} \\ 105 102 \end{align*} 106 103 -
sasmodels/models/spherical_sld.py
r50ec515 r785cbec 46 46 47 47 .. math:: 48 f_\text{core} = 4 \pi \int_{0}^{r_\text{core}} \rho_\text{core} 48 49 f_\text{core} &= 4 \pi \int_{0}^{r_\text{core}} \rho_\text{core} 49 50 \frac{\sin(qr)} {qr} r^2 dr = 50 51 3 \rho_\text{core} V(r_\text{core}) … … 52 53 {qr_\text{core}^3} \Big] 53 54 54 f_{\text{inter}_i} = 4 \pi \int_{\Delta t_{ \text{inter}_i } }55 f_{\text{inter}_i} &= 4 \pi \int_{\Delta t_{ \text{inter}_i } } 55 56 \rho_{ \text{inter}_i } \frac{\sin(qr)} {qr} r^2 dr 56 57 57 f_{\text{shell}_i} = 4 \pi \int_{\Delta t_{ \text{inter}_i } }58 f_{\text{shell}_i} &= 4 \pi \int_{\Delta t_{ \text{inter}_i } } 58 59 \rho_{ \text{flat}_i } \frac{\sin(qr)} {qr} r^2 dr = 59 60 3 \rho_{ \text{flat}_i } V ( r_{ \text{inter}_i } + … … 67 68 \cos(qr_{\text{inter}_i}) } {qr_{\text{inter}_i}^3} \Big] 68 69 69 f_\text{solvent} = 4 \pi \int_{r_N}^{\infty} \rho_\text{solvent}70 f_\text{solvent} &= 4 \pi \int_{r_N}^{\infty} \rho_\text{solvent} 70 71 \frac{\sin(qr)} {qr} r^2 dr = 71 72 3 \rho_\text{solvent} V(r_N) … … 80 81 81 82 .. math:: 82 \rho_{{inter}_i} (r) = \begin{cases} 83 84 \rho_{{inter}_i} (r) &= \begin{cases} 83 85 B \exp\Big( \frac {\pm A(r - r_{\text{flat}_i})} 84 {\Delta t_{ \text{inter}_i }} \Big) +C & \ text{for} A \neq 0 \\86 {\Delta t_{ \text{inter}_i }} \Big) +C & \mbox{for } A \neq 0 \\ 85 87 B \Big( \frac {(r - r_{\text{flat}_i})} 86 {\Delta t_{ \text{inter}_i }} \Big) +C & \ text{for} A = 0 \\88 {\Delta t_{ \text{inter}_i }} \Big) +C & \mbox{for } A = 0 \\ 87 89 \end{cases} 88 90 … … 90 92 91 93 .. math:: 92 \rho_{{inter}_i} (r) = \begin{cases} 94 95 \rho_{{inter}_i} (r) &= \begin{cases} 93 96 \pm B \Big( \frac {(r - r_{\text{flat}_i} )} {\Delta t_{ \text{inter}_i }} 94 \Big) ^A +C & \ text{for} A \neq 0 \\95 \rho_{\text{flat}_{i+1}} & \ text{for} A = 0 \\97 \Big) ^A +C & \mbox{for } A \neq 0 \\ 98 \rho_{\text{flat}_{i+1}} & \mbox{for } A = 0 \\ 96 99 \end{cases} 97 100 … … 101 104 \rho_{{inter}_i} (r) = \begin{cases} 102 105 B \text{erf} \Big( \frac { A(r - r_{\text{flat}_i})} 103 {\sqrt{2} \Delta t_{ \text{inter}_i }} \Big) +C & \ text{for} A \neq 0 \\106 {\sqrt{2} \Delta t_{ \text{inter}_i }} \Big) +C & \mbox{for } A \neq 0 \\ 104 107 B \Big( \frac {(r - r_{\text{flat}_i} )} {\Delta t_{ \text{inter}_i }} 105 \Big) +C & \ text{for} A = 0 \\108 \Big) +C & \mbox{for } A = 0 \\ 106 109 \end{cases} 107 110 … … 114 117 115 118 .. math:: 116 f_{\text{inter}_i} = 4 \pi \int_{\Delta t_{ \text{inter}_i } } 119 120 f_{\text{inter}_i} &= 4 \pi \int_{\Delta t_{ \text{inter}_i } } 117 121 \rho_{ \text{inter}_i } \frac{\sin(qr)} {qr} r^2 dr = 118 4 \pi \sum_{j= 0}^{npts_{\text{inter}_i} -1}122 4 \pi \sum_{j=1}^{n_\text{steps}} 119 123 \int_{r_j}^{r_{j+1}} \rho_{ \text{inter}_i } (r_j) 120 \frac{\sin(qr)} {qr} r^2 dr \approx121 122 4 \pi \sum_{j=0}^{npts_{\text{inter}_i} -1} \Big[124 \frac{\sin(qr)} {qr} r^2 dr 125 126 &\approx 4 \pi \sum_{j=1}^{n_\text{steps}} \Big[ 123 127 3 ( \rho_{ \text{inter}_i } ( r_{j+1} ) - \rho_{ \text{inter}_i } 124 ( r_{j} ) V ( r_{ \text{subshell}_j })128 ( r_{j} ) V (r_j) 125 129 \Big[ \frac {r_j^2 \beta_\text{out}^2 \sin(\beta_\text{out}) 126 130 - (\beta_\text{out}^2-2) \cos(\beta_\text{out}) } 127 131 {\beta_\text{out}^4 } \Big] 128 132 129 - 3 ( \rho_{ \text{inter}_i } ( r_{j+1} ) - \rho_{ \text{inter}_i }130 ( r_{j} ) V ( r_{ \text{subshell}_j-1} )133 &{} - 3 ( \rho_{ \text{inter}_i } ( r_{j+1} ) - \rho_{ \text{inter}_i } 134 ( r_{j} ) V ( r_{j-1} ) 131 135 \Big[ \frac {r_{j-1}^2 \sin(\beta_\text{in}) 132 136 - (\beta_\text{in}^2-2) \cos(\beta_\text{in}) } 133 137 {\beta_\text{in}^4 } \Big] 134 138 135 + 3 \rho_{ \text{inter}_i } ( r_{j+1} ) V ( r_j )139 &{} + 3 \rho_{ \text{inter}_i } ( r_{j+1} ) V ( r_j ) 136 140 \Big[ \frac {\sin(\beta_\text{out}) - \cos(\beta_\text{out}) } 137 141 {\beta_\text{out}^4 } \Big] 138 139 142 - 3 \rho_{ \text{inter}_i } ( r_{j} ) V ( r_j ) 140 143 \Big[ \frac {\sin(\beta_\text{in}) - \cos(\beta_\text{in}) } … … 145 148 146 149 .. math:: 147 V(a) = \frac {4\pi}{3}a^3 148 149 a_\text{in} ~ \frac{r_j}{r_{j+1} -r_j} \text{, } a_\text{out} 150 ~ \frac{r_{j+1}}{r_{j+1} -r_j} 151 152 \beta_\text{in} = qr_j \text{, } \beta_\text{out} = qr_{j+1} 150 :nowrap: 151 152 \begin{align*} 153 V(a) &= \frac {4\pi}{3}a^3 && \\ 154 a_\text{in} &\sim \frac{r_j}{r_{j+1} -r_j} \text{, } &a_\text{out} 155 &\sim \frac{r_{j+1}}{r_{j+1} -r_j} \\ 156 \beta_\text{in} &= qr_j \text{, } &\beta_\text{out} &= qr_{j+1} 157 \end{align*} 153 158 154 159 … … 160 165 .. math:: 161 166 162 P(q) = \frac{[f]^2} {V_\text{particle}} \ text{where} V_\text{particle}167 P(q) = \frac{[f]^2} {V_\text{particle}} \mbox{ where } V_\text{particle} 163 168 = V(r_{\text{shell}_N}) 164 169 … … 172 177 .. note:: 173 178 174 The outer most radius is used as the effective radius for S(Q)179 The outer most radius is used as the effective radius for $S(Q)$ 175 180 when $P(Q) * S(Q)$ is applied. 176 181 -
sasmodels/models/unified_power_Rg.py
rec77322 r785cbec 72 72 ["G[level]", "1/cm", 400, [0, inf], "", ""], 73 73 ] 74 category = "shape-independent" 74 75 75 76 def Iq(q, level, rg, power, B, G):
Note: See TracChangeset
for help on using the changeset viewer.