[77ad412] | 1 | r""" |
---|
| 2 | Lorentz (Ornstein-Zernicke Model) |
---|
| 3 | |
---|
| 4 | Definition |
---|
| 5 | ---------- |
---|
| 6 | |
---|
| 7 | The Ornstein-Zernicke model is defined by |
---|
| 8 | |
---|
| 9 | .. math:: I(q)=\frac{\text{scale}}{1+(qL)^2}+\text{bkg} |
---|
| 10 | |
---|
| 11 | The parameter *L* is the screening length. |
---|
| 12 | |
---|
| 13 | For 2D data: The 2D scattering intensity is calculated in the same way as 1D, |
---|
| 14 | where the *q* vector is defined as |
---|
| 15 | |
---|
| 16 | .. math:: q=\sqrt{q_x^2 + q_y^2} |
---|
| 17 | |
---|
| 18 | .. image:: img/image179.jpg |
---|
| 19 | |
---|
| 20 | *Figure. 1D plot using the default values (w/200 data point).* |
---|
| 21 | REFERENCE |
---|
| 22 | |
---|
| 23 | L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and |
---|
| 24 | *Z. Phys.* 19, 134 (1918), and 27, 761 {1926); referred to as QZ. |
---|
| 25 | """ |
---|
| 26 | |
---|
| 27 | from numpy import inf |
---|
| 28 | |
---|
| 29 | name = "lorentz" |
---|
| 30 | title = "Ornstein-Zernicke correlation length model" |
---|
| 31 | description = """ |
---|
| 32 | Model that evaluates a Lorentz (Ornstein-Zernicke) model. |
---|
| 33 | |
---|
| 34 | I(q) = scale/( 1 + (q*L)^2 ) + bkd |
---|
| 35 | |
---|
| 36 | The model has three parameters: |
---|
| 37 | length = screening Length |
---|
| 38 | scale = scale factor |
---|
| 39 | background = incoherent background |
---|
| 40 | """ |
---|
| 41 | category = "shape-independent" |
---|
| 42 | |
---|
| 43 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 44 | parameters = [["cor_length", "Ang", 50.0, [0, inf], "", "Screening length"],] |
---|
| 45 | |
---|
| 46 | Iq = """ |
---|
| 47 | double denominator = 1 + (q*cor_length)*(q*cor_length); |
---|
| 48 | return 1/denominator; |
---|
| 49 | """ |
---|
| 50 | |
---|
| 51 | Iqxy = """ |
---|
| 52 | return Iq(sqrt(qx*qx + qy*qy), cor_length); |
---|
| 53 | """ |
---|
| 54 | |
---|
| 55 | # parameters for demo |
---|
| 56 | demo = dict(scale=1.0,background=0.0,cor_length=50.0) |
---|
| 57 | |
---|
| 58 | # For testing against the old sasview models, include the converted parameter |
---|
| 59 | # names and the target sasview model name. |
---|
| 60 | oldname = 'LorentzModel' |
---|
[66ebdd6] | 61 | oldpars = dict(cor_length='length') |
---|
| 62 | |
---|
| 63 | # parameters for unit tests |
---|
| 64 | tests = [ |
---|
| 65 | [{'cor_length' : 250},0.01,0.137931] |
---|
| 66 | ] |
---|