core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 3e8ea5d was
4962519,
checked in by Paul Kienzle <pkienzle@…>, 8 years ago
|
use square and cube instead of pow()
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[19b6d28] | 1 | r""" |
---|
| 2 | This model fits the Porod function |
---|
| 3 | |
---|
[40a87fa] | 4 | .. math:: I(q) = C/q^4 |
---|
[19b6d28] | 5 | |
---|
| 6 | to the data directly without any need for linearisation (cf. Log I(q) vs Log q). |
---|
| 7 | |
---|
[40a87fa] | 8 | Here $C = 2\pi (\Delta\rho)^2 S_v$ is the scale factor where $S_v$ is |
---|
| 9 | the specific surface area (ie, surface area / volume) of the sample, and |
---|
| 10 | $\Delta\rho$ is the contrast factor. |
---|
[19b6d28] | 11 | |
---|
[cc3fac6] | 12 | For 2D data: The 2D scattering intensity is calculated in the same way as 1D, |
---|
[16bb433] | 13 | where the q vector is defined as |
---|
[19b6d28] | 14 | |
---|
[40a87fa] | 15 | .. math:: q = \sqrt{q_x^2+q_y^2} |
---|
[19b6d28] | 16 | |
---|
[2f63032] | 17 | References |
---|
| 18 | ---------- |
---|
| 19 | |
---|
| 20 | G Porod. *Kolloid Zeit*. 124 (1951) 83. |
---|
[40a87fa] | 21 | |
---|
| 22 | L A Feigin, D I Svergun, G W Taylor. *Structure Analysis by Small-Angle |
---|
| 23 | X-ray and Neutron Scattering*. Springer. (1987) |
---|
[19b6d28] | 24 | """ |
---|
| 25 | |
---|
[2c74c11] | 26 | from numpy import power, inf, errstate |
---|
[19b6d28] | 27 | |
---|
| 28 | name = "porod" |
---|
| 29 | title = "Porod function" |
---|
| 30 | description = """\ |
---|
| 31 | I(q) = scale/q^4 + background |
---|
| 32 | """ |
---|
| 33 | |
---|
| 34 | category = "shape-independent" |
---|
| 35 | |
---|
| 36 | parameters = [] |
---|
| 37 | |
---|
| 38 | def Iq(q): |
---|
| 39 | """ |
---|
| 40 | @param q: Input q-value |
---|
| 41 | """ |
---|
[82923a6] | 42 | with errstate(divide='ignore'): |
---|
[4962519] | 43 | return q**-4 |
---|
[19b6d28] | 44 | |
---|
| 45 | Iq.vectorized = True # Iq accepts an array of q values |
---|
| 46 | |
---|
| 47 | demo = dict(scale=1.5, background=0.5) |
---|
| 48 | |
---|
[82923a6] | 49 | tests = [ |
---|
| 50 | [{'scale': 0.00001, 'background':0.01}, 0.04, 3.916250], |
---|
| 51 | [{}, 0.0, inf], |
---|
| 52 | ] |
---|
Note: See
TracBrowser
for help on using the repository browser.