Index: src/sans/models/media/model_functions.rst
===================================================================
--- src/sans/models/media/model_functions.rst	(revision 2005bb56af5bae71410330e5ea2b906b71640249)
+++ src/sans/models/media/model_functions.rst	(revision eacf6a8c90a006ec898dc069e532baeb0e99d197)
@@ -25,5 +25,5 @@
 .. |pi| unicode:: U+03C0
 .. |rho| unicode:: U+03C1
-.. |sigma| unicode:: U+03C2
+.. |sigma| unicode:: U+03C3
 .. |tau| unicode:: U+03C4
 .. |upsilon| unicode:: U+03C5
@@ -32,4 +32,9 @@
 .. |psi| unicode:: U+03C8
 .. |omega| unicode:: U+03C9
+
+.. |bigdelta| unicode:: U+0394
+.. |biggamma| unicode:: U+0393
+
+.. |drho| replace:: |bigdelta|\ |rho|
 
 .. |Ang| unicode:: U+212B
@@ -43,6 +48,8 @@
 .. |cm^3| replace:: cm\ :sup:`3`
 .. |cm^-3| replace:: cm\ :sup:`-3`
+.. |sr^-1| replace:: sr\ :sup:`-1`
 
 .. |P0| replace:: P\ :sub:`0`\
+.. |A2| replace:: A\ :sub:`2`\
 
 
@@ -140,15 +147,15 @@
 - SphereModel_ (including magnetic 2D version)
 - BinaryHSModel_
-- FuzzySphereModel
-- RaspBerryModel
-- CoreShellModel (including magnetic 2D version)
-- CoreMultiShellModel (including magnetic 2D version)
-- Core2ndMomentModel
-- MultiShellModel
-- OnionExpShellModel
-- VesicleModel
-- SphericalSLDModel
-- LinearPearlsModel
-- PearlNecklaceModel
+- FuzzySphereModel_
+- RaspBerryModel_
+- CoreShellModel_ (including magnetic 2D version)
+- CoreMultiShellModel_ (including magnetic 2D version)
+- Core2ndMomentModel_
+- MultiShellModel_
+- OnionExpShellModel_
+- VesicleModel_
+- SphericalSLDModel_
+- LinearPearlsModel_
+- PearlNecklaceModel_
 
 Cylinder-based
@@ -247,10 +254,10 @@
 ------------------------
 
-- testmodel
-- testmodel_2
-- sum_p1_p2
-- sum_Ap1_1_Ap2
-- polynomial5
-- sph_bessel_jn
+- testmodel_
+- testmodel_2_
+- sum_p1_p2_
+- sum_Ap1_1_Ap2_
+- polynomial5_
+- sph_bessel_jn_
 
 
@@ -329,5 +336,5 @@
 The 2D scattering intensity is the same as above, regardless of the orientation of the q vector.
 
-The returned value is scaled to units of |cm^-1| and the parameters of the sphere model are the following:
+The returned value is scaled to units of |cm^-1| and the parameters of the SphereModel are the following:
 
 ==============  ========  =============
@@ -344,4 +351,7 @@
 Research (Kline, 2006).
 
+REFERENCE
+A. Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and Sons, New York, (1955)
+
 *2.1.1.2. Validation of the SphereModel*
 
@@ -380,5 +390,5 @@
 .. image:: img/image008.PNG
 
-The parameters of the binary hard sphere are the following (in the names, *l* (or *ls*\ ) stands for larger spheres
+The parameters of the BinaryHSModel are the following (in the names, *l* (or *ls*\ ) stands for larger spheres
 while *s* (or *ss*\ ) for the smaller spheres).
 
@@ -392,6 +402,6 @@
 solvent_sld     |Ang^-2|  6e-6
 s_radius        |Ang|     25.0
-vol_frac_ls               0.1
-vol_frac_ss               0.2
+vol_frac_ls     None      0.1
+vol_frac_ss     None      0.2
 ==============  ========  =============
 
@@ -406,7 +416,6 @@
 
 REFERENCE
-N. W. Ashcroft and D. C. Langreth, Physical Review, v. 156 (1967) 685-692
-
-[Errata found in Phys. Rev. 166 (1968) 934.]
+N. W. Ashcroft and D. C. Langreth, *Physical Review*, 156 (1967) 685-692
+[Errata found in *Phys. Rev.* 166 (1968) 934]
 
 
@@ -416,1346 +425,759 @@
 **2.1.3. FuzzySphereModel**
 
-**This model is to calculate the scattering from spherical particles
-with a "fuzzy" interface.**
+This model is to calculate the scattering from spherical particles with a "fuzzy" interface.
 
 *2.1.3.1. Definition*
 
+The scattering intensity *I(q)* is calculated as:
+
+.. image:: img/image010.PNG
+
+where the amplitude *A(q)* is given as the typical sphere scattering convoluted with a Gaussian to get a gradual
+drop-off in the scattering length density
+
+.. image:: img/image011.PNG
+
+Here |A2|\ *(q)* is the form factor, *P(q)*. The scale is equivalent to the volume fraction of spheres, each of
+volume, *V*\. Contrast (|drho|) is the difference of scattering length densities of the sphere and the surrounding
+solvent.
+
+Poly-dispersion in radius and in fuzziness is provided for.
+
+The returned value is scaled to units of |cm^-1|\ |sr^-1|; ie, absolute scale.
+
+From the reference
+
+The "fuzziness" of the interface is defined by the parameter |sigma| :sub:`fuzzy`\ . The particle radius *R*
+represents the radius of the particle where the scattering length density profile decreased to 1/2 of the core
+density. The |sigma| :sub:`fuzzy`\ is the width of the smeared particle surface; i.e., the standard deviation
+from the average height of the fuzzy interface. The inner regions of the microgel that display a higher density
+are described by the radial box profile extending to a radius of approximately *Rbox* ~ *R* - 2\ |sigma|\ . The
+profile approaches zero as *Rsans* ~ *R* + 2\ |sigma|\ .
+
+For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as
+
+.. image:: img/image008.PNG
+
+This example dataset is produced by running the FuzzySphereModel, using 200 data points, *qmin* = 0.001 -1,
+*qmax* = 0.7 |Ang^-1| and the default values
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+scale           None      1.0
+radius          |Ang|     60
+fuzziness       |Ang|     10
+sldSolv         |Ang^-2|  3e-6
+sldSph          |Ang^-2|  1e-6
+background      |cm^-1|   0.001
+==============  ========  =============
+
+.. image:: img/image012.JPG
+
+*Figure. 1D plot using the default values (w/200 data point).*
+
+REFERENCE
+M. Stieger, J. S. Pedersen, P. Lindner, W. Richtering, *Langmuir*, 20 (2004) 7283-7292
+
+
+
+.. _RaspBerryModel:
+
+**2.1.4. RaspBerryModel**
+
+Calculates the form factor, *P(q)*, for a "Raspberry-like" structure where there are smaller spheres at the surface
+of a larger sphere, such as the structure of a Pickering emulsion.
+
+*2.1.4.1. Definition*
+
+The structure is:
+
+.. image:: img/raspberry_pic.JPG
+
+where *Ro* = the radius of the large sphere, *Rp* = the radius of the smaller sphere on the surface, |delta| = the
+fractional penetration depth, and surface coverage = fractional coverage of the large sphere surface (0.9 max).
+
+The large and small spheres have their own SLD, as well as the solvent. The surface coverage term is a fractional
+coverage (maximum of approximately 0.9 for hexagonally-packed spheres on a surface). Since not all of the small
+spheres are necessarily attached to the surface, the excess free (small) spheres scattering is also included in the
+calculation. The function calculated follows equations (8)-(12) of the reference below, and the equations are not
+reproduced here.
+
+The returned value is scaled to units of |cm^-1|. No inter-particle scattering is included in this model.
+
+For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as
+
+.. image:: img/image008.PNG
+
+This example dataset is produced by running the RaspBerryModel, using 2000 data points, *qmin* = 0.0001 |Ang^-1|,
+*qmax* = 0.2 |Ang^-1| and the default values below, where *Ssph/Lsph* stands for smaller or larger sphere, respectively,
+and *surfrac_Ssph* is the surface fraction of the smaller spheres.
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+delta_Ssph      None      0
+radius_Lsph     |Ang|     5000
+radius_Ssph     |Ang|     100
+sld_Lsph        |Ang^-2|  -4e-07
+sld_Ssph        |Ang^-2|  3.5e-6
+sld_solv        |Ang^-2|  6.3e-6
+surfrac_Ssph    None      0.4
+volf_Lsph       None      0.05
+volf_Lsph       None      0.005
+background      |cm^-1|   0
+==============  ========  =============
+
+.. image:: img/raspberry_plot.JPG
+
+*Figure. 1D plot using the values of /2000 data points.*
+
+REFERENCE
+K. Larson-Smith, A. Jackson, and D.C. Pozzo, *Small angle scattering model for Pickering emulsions and raspberry*
+*particles*, *Journal of Colloid and Interface Science*, 343(1) (2010) 36-41
+
+
+
+.. _CoreShellModel:
+
+**2.1.5. CoreShellModel**
+
+This model provides the form factor, *P(q)*, for a spherical particle with a core-shell structure. The form factor is
+normalized by the particle volume.
+
+For information about polarised and magnetic scattering, click here_.
+
+*2.1.5.1. Definition*
+
+The 1D scattering intensity is calculated in the following way (Guinier, 1955)
+
+.. image:: img/image013.PNG
+
+where *scale* is a scale factor, *Vs* is the volume of the outer shell, *Vc* is the volume of the core, *rs* is the
+radius of the shell, *rc* is the radius of the core, *c* is the scattering length density of the core, *s* is the
+scattering length density of the shell, *solv* is the scattering length density of the solvent, and *bkg* is the
+background level.
+
+The 2D scattering intensity is the same as *P(q)* above, regardless of the orientation of the *q* vector.
+
+NB: The outer most radius (ie, = *radius* + *thickness*) is used as the effective radius for *S(Q)* when
+*P(Q)* \* *S(Q)* is applied.
+
+The returned value is scaled to units of |cm^-1| and the parameters of the CoreShellModel are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+scale           None      1.0
+(core) radius   |Ang|     60
+thickness       |Ang|     10
+core_sld        |Ang^-2|  1e-6
+shell_sld       |Ang^-2|  2e-6
+solvent_sld     |Ang^-2|  3e-6
+background      |cm^-1|   0.001
+==============  ========  =============
+
+Here, *radius* = the radius of the core and *thickness* = the thickness of the shell.
+
+Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron
+Research (Kline, 2006).
+
+REFERENCE
+A. Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and Sons, New York, (1955)
+
+*2.1.5.2. Validation of the core-shell sphere model*
+
+Validation of our code was done by comparing the output of the 1D model to the output of the software provided by
+NIST (Kline, 2006). Figure 1 shows a comparison of the output of our model and the output of the NIST software.
+
+.. image:: img/image014.JPG
+
+Figure 1: Comparison of the SasView scattering intensity for a core-shell sphere with the output of the NIST SANS
+analysis software. The parameters were set to: *Scale* = 1.0, *Radius* = 60 , *Contrast* = 1e-6 |Ang^-2|, and
+*Background* = 0.001 |cm^-1|.
+
+
+
+.. _CoreMultiShellModel:
+
+**2.1.6. CoreMultiShellModel**
+
+This model provides the scattering from a spherical core with 1 to 4 concentric shell structures. The SLDs of the core
+and each shell are individually specified.
+
+For information about polarised and magnetic scattering, click here_.
+
+*2.1.6.1. Definition*
+
+This model is a trivial extension of the CoreShell function to a larger number of shells. See the CoreShell function
+for a diagram and documentation.
+
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
+
+Be careful! The SLDs and scale can be highly correlated. Hold as many of these parameters fixed as possible.
+
+The 2D scattering intensity is the same as P(q) of 1D, regardless of the orientation of the q vector.
+
+NB: The outer most radius (ie, = *radius* + 4 *thicknesses*) is used as the effective radius for *S(Q)* when
+*P(Q)* \* *S(Q)* is applied.
+
+The returned value is scaled to units of |cm^-1| and the parameters of the CoreMultiShell model are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+scale           None      1.0
+rad_core        |Ang|     60
+sld_core        |Ang^-2|  6.4e-6
+sld_shell1      |Ang^-2|  1e-6
+sld_shell2      |Ang^-2|  2e-6
+sld_shell3      |Ang^-2|  3e-6
+sld_shell4      |Ang^-2|  4e-6
+sld_solv        |Ang^-2|  6.4e-6
+thick_shell1    |Ang|     10
+thick_shell2    |Ang|     10
+thick_shell3    |Ang|     10
+thick_shell4    |Ang|     10
+background      |cm^-1|   0.001
+==============  ========  =============
+
+NB: Here, *rad_core* = the radius of the core, *thick_shelli* = the thickness of the shell *i* and
+*sld_shelli* = the SLD of the shell *i*. *sld_core* and the *sld_solv* are the SLD of the core and the solvent,
+respectively.
+
+Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron
+Research (Kline, 2006).
+
+This example dataset is produced by running the CoreMultiShellModel using 200 data points, *qmin* = 0.001 -1,
+*qmax* = 0.7 -1 and the above default values.
+
+.. image:: img/image015.JPG
+
+*Figure: 1D plot using the default values (w/200 data point).*
+
+The scattering length density profile for the default sld values (w/ 4 shells).
+
+.. image:: img/image016.JPG
+
+*Figure: SLD profile against the radius of the sphere for default SLDs.*
+
+REFERENCE
+See the CoreShell documentation.
+
+
+
+.. _Core2ndMomentModel:
+
+**2.1.7. Core2ndMomentModel**
+
+This model describes the scattering from a layer of surfactant or polymer adsorbed on spherical particles under the
+conditions that (i) the particles (cores) are contrast-matched to the dispersion medium, (ii) *S(Q)* ~ 1 (ie, the
+particle volume fraction is dilute), (iii) the particle radius is >> layer thickness (ie, the interface is locally
+flat), and (iv) scattering from excess unadsorbed adsorbate in the bulk medium is absent or has been corrected for.
+
+Unlike a core-shell model, this model does not assume any form for the density distribution of the adsorbed species
+normal to the interface (cf, a core-shell model which assumes the density distribution to be a homogeneous
+step-function). For comparison, if the thickness of a (core-shell like) step function distribution is *t*, the second
+moment, |sigma| = sqrt((*t* :sup:`2` )/12). The |sigma| is the second moment about the mean of the density distribution
+(ie, the distance of the centre-of-mass of the distribution from the interface).
+
+*2.1.7.1. Definition*
+
+The *I* :sub:`0` is calculated in the following way (King, 2002)
+
+.. image:: img/secondmeq1.JPG
+
+where *scale* is a scale factor, *poly* is the sld of the polymer (or surfactant) layer, *solv* is the sld of the
+solvent/medium and cores, |phi|\ :sub:`cores` is the volume fraction of the core paraticles, and |biggamma| and
+|delta| are the adsorbed amount and the bulk density of the polymers respectively. The |sigma| is the second moment
+of the thickness distribution.
+
+Note that all parameters except the |sigma| are correlated for fitting so that fitting those with more than one
+parameter will generally fail. Also note that unlike other shape models, no volume normalization is applied to this
+model (the calculation is exact).
+
+The returned value is scaled to units of |cm^-1| and the parameters are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+scale           None      1.0
+density_poly    g/cm2     0.7
+radius_core     |Ang|     500
+ads_amount      mg/m 2    1.9
+second_moment   |Ang|     23.0
+volf_cores      None      0.14
+sld_poly        |Ang^-2|  1.5e-6
+sld_solv        |Ang^-2|  6.3e-6
+background      |cm^-1|   0.0
+==============  ========  =============
+
+.. image:: img/secongm_fig1.JPG
+
+REFERENCE
+S. King, P. Griffiths, J. Hone, and T. Cosgrove, *SANS from Adsorbed Polymer Layers*,
+*Macromol. Symp.*, 190 (2002) 33-42
+
+
+
+.. _MultiShellModel:
+
+**2.1.8. MultiShellModel**
+
+This model provides the form factor, *P(q)*, for a multi-lamellar vesicle with *N* shells where the core is filled with
+solvent and the shells are interleaved with layers of solvent. For *N* = 1, this returns the VesicleModel (above).
+
+.. image:: img/image020.JPG
+
+The 2D scattering intensity is the same as 1D, regardless of the orientation of the *q* vector which is defined as
+
+.. image:: img/image008.PNG
+
+NB: The outer most radius (= *core_radius* + *n_pairs* \* *s_thickness* + (*n_pairs* - 1) \* *w_thickness*) is used
+as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied.
+
+The returned value is scaled to units of |cm^-1| and the parameters of the MultiShellModel are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+scale           None      1.0
+core_radius     |Ang|     60.0
+n_pairs         None      2.0
+core_sld        |Ang^-2|  6.3e-6
+shell_sld       |Ang^-2|  0.0
+background      |cm^-1|   0.0
+s_thickness     |Ang|     10
+w_thickness     |Ang|     10
+==============  ========  =============
+
+NB: *s_thickness* is the shell thickness while the *w_thickness* is the solvent thickness, and *n_pair*
+is the number of shells.
+
+.. image:: img/image021.JPG
+
+*Figure. 1D plot using the default values (w/200 data point).*
+
+Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron
+Research (Kline, 2006).
+
+REFERENCE
+B. Cabane, *Small Angle Scattering Methods*, in *Surfactant Solutions: New Methods of Investigation*, Ch.2,
+Surfactant Science Series Vol. 22, Ed. R. Zana and M. Dekker, New York, (1987).
+
+
+
+.. _OnionExpShellModel:
+
+**2.1.9. OnionExpShellModel**
+
+This model provides the form factor, *P(q)*, for a multi-shell sphere where the scattering length density (SLD) of the
+each shell is described by an exponential (linear, or flat-top) function. The form factor is normalized by the volume
+of the sphere where the SLD is not identical to the SLD of the solvent. We currently provide up to 9 shells with this
+model.
+
+*2.1.9.1. Definition*
+
 The 1D scattering intensity is calculated in the following way
-(Guinier, 1955):
-
-The returned value is scaled to units of [cm-1 sr-1], absolute scale.
-
-The scattering intensity I(q) is calculated as:
-
-
-
-where the amplitude A(q) is given as the typical sphere scattering
-convoluted with a Gaussian to get a gradual drop-off in the scattering
-length density:
-
-
-
-Here A2(q) is the form factor, P(q). The scale is equivalent to the
-volume fraction of spheres, each of volume, V. Contrast ( * ) is the
-difference of scattering length densities of the sphere and the
-surrounding solvent.
-
-The poly-dispersion in radius and in fuzziness is provided.
-
-(direct from the reference)
-
-The "fuzziness" of the interface is defined by the parameter
-(sigma)fuzzy. The particle radius R represents the radius of the
-particle where the scattering length density profile decreased to 1/2
-of the core density. The (sigma)fuzzy is the width of the smeared
-particle surface: i.e., the standard deviation from the average height
-of the fuzzy interface. The inner regions of the microgel that display
-a higher density are described by the radial box profile extending to
-a radius of approximately Rbox ~ R - 2(sigma). the profile approaches
-zero as Rsans ~ R + 2(sigma).
-
-For 2D data: The 2D scattering intensity is calculated in the same way
-as 1D, where the *q* vector is defined as .
+
+.. image:: img/image022.GIF
+
+.. image:: img/image023.GIF
+
+where, for a spherically symmetric particle with a particle density |rho|\ *(r)*
+
+.. image:: img/image024.GIF
+
+so that
+
+.. image:: img/image025.GIF
+
+.. image:: img/image026.GIF
+
+.. image:: img/image027.GIF
+
+Here we assumed that the SLDs of the core and solvent are constant against *r*.
+
+Now lets consider the SLD of a shell, *r*\ :sub:`shelli`, defined by
+
+.. image:: img/image028.GIF
+
+An example of a possible SLD profile is shown below where *sld_in_shelli* (|rho|\ :sub:`in`\ ) and
+*thick_shelli* (|bigdelta|\ *t* :sub:`shelli`\ ) stand for the SLD of the inner side of the *i*\ th shell and the
+thickness of the *i*\ th shell in the equation above, respectively.
+
+For \| *A* \| > 0,
+
+.. image:: img/image029.GIF
+
+For *A* ~ 0 (eg., *A* = -0.0001), this function converges to that of the linear SLD profile (ie,
+|rho|\ :sub:`shelli`\ *(r)* = *A*\ :sup:`'` ( *r* - *r*\ :sub:`shelli` - 1) / |bigdelta|\ *t* :sub:`shelli`) + *B*\ :sup:`'`),
+so this case is equivalent to
+
+.. image:: img/image030.GIF
+
+.. image:: img/image031.GIF
+
+.. image:: img/image032.GIF
+
+.. image:: img/image033.GIF
+
+For *A* = 0, the exponential function has no dependence on the radius (so that *sld_out_shell* (|rho|\ :sub:`out`) is
+ignored this case) and becomes flat. We set the constant to |rho|\ :sub:`in` for convenience, and thus the form
+factor contributed by the shells is
+
+.. image:: img/image034.GIF
+
+.. image:: img/image035.GIF
+
+In the equation
+
+.. image:: img/image036.GIF
+
+Finally, the form factor can be calculated by
+
+.. image:: img/image037.GIF
+
+where
+
+.. image:: img/image038.GIF
+
+and
+
+.. image:: img/image039.GIF
+
+The 2D scattering intensity is the same as *P(q)* above, regardless of the orientation of the *q* vector which is
+defined as
+
+.. image:: img/image040.GIF
+
+NB: The outer most radius is used as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied.
+
+The returned value is scaled to units of |cm^-1| and the parameters of this model (for only one shell) are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+A_shell1        None      1
+scale           None      1.0
+rad_core        |Ang|     200
+thick_shell1    |Ang|     50
+sld_core        |Ang^-2|  1.0e-06
+sld_in_shell1   |Ang^-2|  1.7e-06
+sld_out_shell1  |Ang^-2|  2.0e-06
+sld_solv        |Ang^-2|  6.4e-06
+background      |cm^-1|   0.0
+==============  ========  =============
+
+NB: *rad_core* represents the core radius (*R1*) and *thick_shell1* (*R2* - *R1*) is the thickness of the shell1, etc.
+
+.. image:: img/image041.JPG
+
+*Figure. 1D plot using the default values (w/400 point).*
+
+.. image:: img/image042.JPG
+
+*Figure. SLD profile from the default values.*
 
 REFERENCE
-
-M. Stieger, J. S. Pedersen, P. Lindner, W. Richtering, Langmuir 20
-(2004) 7283-7292.
-
-*2.1.3.2. Validation of the fuzzy sphere model*
-
-This example dataset is produced by running the FuzzySphereModel,
-using 200 data points, qmin = 0.001 -1, qmax = 0.7 A-1 and the default
-values:
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-radius
-
-
-
-60
-
-fuzziness
-
-
-
-10
-
-sldSolv
-
--2
-
-3e-6
-
-sldSph
-
--2
-
-1e-6
-
-background
-
-cm-1
-
-0.001
-
-
+L. A. Feigin and D. I. Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*,
+Plenum Press, New York, (1987).
+
+
+
+.. _VesicleModel:
+
+**2.1.10. VesicleModel**
+
+This model provides the form factor, *P(q)*, for an unilamellar vesicle. The form factor is normalized by the volume
+of the shell.
+
+*2.1.10.1. Definition*
+
+The 1D scattering intensity is calculated in the following way (Guinier, 1955)
+
+.. image:: img/image017.PNG
+
+where *scale* is a scale factor, *Vshell* is the volume of the shell, *V1* is the volume of the core, *V2* is the total
+volume, *R1* is the radius of the core, *R2* is the outer radius of the shell, |rho|\ :sub:`1` is the scattering
+length density of the core and the solvent, |rho|\ :sub:`2` is the scattering length density of the shell, *bkg* is
+the background level, and *J1* = (sin\ *x*- *x* cos\ *x*)/ *x* :sup:`2`\ . The functional form is identical to a
+"typical" core-shell structure, except that the scattering is normalized by the volume that is contributing to the
+scattering, namely the volume of the shell alone. Also, the vesicle is best defined in terms of a core radius (= *R1*)
+and a shell thickness, *t*.
+
+.. image:: img/image018.JPG
+
+The 2D scattering intensity is the same as *P(q)* above, regardless of the orientation of the *q* vector which is
+defined as
+
+.. image:: img/image008.PNG
+
+For P*S:  toward S(Q) when P(Q)*S(Q) is applied.
+
+NB: The outer most radius (= *radius* + *thickness*) is used as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)*
+is applied.
+
+The returned value is scaled to units of |cm^-1| and the parameters of the VesicleModel are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+scale           None      1.0
+radius          |Ang|     100
+thickness       |Ang|     30
+core_sld        |Ang^-2|  6.3e-6
+shell_sld       |Ang^-2|  0
+background      |cm^-1|   0.0
+==============  ========  =============
+
+NB: *radius* represents the core radius (*R1*) and the *thickness* (*R2* - *R1*) is the shell thickness.
+
+.. image:: img/image019.JPG
 
 *Figure. 1D plot using the default values (w/200 data point).*
-
-
-
-.. _RaspBerryModel:
-
-**2.1.4. RaspBerryModel**
-
-Calculates the form factor, P(q), for a "Raspberry-like" structure
-where there are smaller spheres at the surface of a larger sphere,
-such as the structure of a Pickering emulsion.
-
-*2.1.4.1. Definition*
-
-The structure is:
-
-
-
-Ro = the radius of thelarge sphere
-Rp = the radius of the smaller sphere on the surface
-delta = the fractional penetration depth
-surface coverage = fractional coverage of the large sphere surface
-(0.9 max)
-
-
-The large and small spheres have their own SLD, as well as the
-solvent. The surface coverage term is a fractional coverage (maximum
-of approximately 0.9 for hexagonally packed spheres on a surface).
-Since not all of the small spheres are necessarily attached to the
-surface, the excess free (small) spheres scattering is also included
-in the calculation. The function calculated follows equations (8)-(12)
-of the reference below, and the equations are not reproduced here.
-
-The returned value is scaled to units of [cm-1]. No interparticle
-scattering is included in this model.
-
-For 2D data: The 2D scattering intensity is calculated in the same way
-as 1D, where the *q* vector is defined as .
-
-REFERENCE
-Kjersta Larson-Smith, Andrew Jackson, and Danilo C Pozzo, "Small angle
-scattering model for Pickering emulsions and raspberry particles."
-Journal of Colloid and Interface Science (2010) vol. 343 (1) pp.
-36-41.
-
-*2.1.4.2. Validation of the RaspBerry Model*
-
-This example dataset is produced by running the RaspBerryModel, using
-2000 data points, qmin = 0.0001 -1, qmax = 0.2 A-1 and the default
-values, where Ssph/Lsph stands for Smaller/Large sphere
-andsurfrac_Ssph for the surface fraction of the smaller spheres.
-
-Parameter name
-
-Units
-
-Default value
-delta_Ssph 0 radius_Lsph 5000 radius_Ssph 100 sld_Lsph -2 -4e-07
-sld_Ssph
-
--2
-
-3.5e-6
-
-sld_solv
-
--2
-
-6.3e-6
-
-surfrac_Ssph
-
-
-
-0.4
-
-volf_Lsph
-
-0.05
-
-volf_Lsph
-
-
-
-0.005
-
-background
-
-cm-1
-
-0
-
-
-
-*Figure. 1D plot using the values of /2000 data points.*
-
-
-
-.. _CoreShellModel:
-
-**2.1.5. CoreShellModel**
-
-This model provides the form factor, P( *q*), for a spherical particle
-with a core-shell structure. The form factor is normalized by the
-particle volume.
-
-For information about polarised and magnetic scattering, click here_.
-
-*2.1.5.1. Definition*
-
-The 1D scattering intensity is calculated in the following way
-(Guinier, 1955):
-
-
-
-
-
-where *scale* is a scale factor, *Vs* is the volume of the outer
-shell, *Vc* is the volume of the core, *rs* is the radius of the
-shell, *rc* is the radius of the core, *c* is the scattering length
-density of the core, *s* is the scattering length density of the
-shell, solv is the scattering length density of the solvent, and *bkg*
-is the background level.
-
-The 2D scattering intensity is the same as P(q) above, regardless of
-the orientation of the q vector.
-
-For P*S: The outer most radius (= radius + thickness) is used as the
-effective radius toward S(Q) when P(Q)*S(Q) is applied.
-
-The returned value is scaled to units of [cm-1] and the parameters of
-the core-shell sphere model are the following:
-
-Here, radius = the radius of the core and thickness = the thickness of
-the shell.
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-(core) radius
-
-
-
-60
-
-thickness
-
-
-
-10
-
-core_sld
-
--2
-
-1e-6
-
-shell_sld
-
--2
-
-2e-6
-
-solvent_sld
-
--2
-
-3e-6
-
-background
-
-cm-1
-
-0.001
 
 Our model uses the form factor calculations implemented in a c-library
 provided by the NIST Center for Neutron Research (Kline, 2006).
 
-
-
 REFERENCE
-
-Guinier, A. and G. Fournet, "Small-Angle Scattering of X-Rays", John
-Wiley and Sons, New York, (1955).
-
-*2.1.5.2. Validation of the core-shell sphere model*
-
-Validation of our code was done by comparing the output of the 1D
-model to the output of the software provided by the NIST (Kline,
-2006). Figure 1 shows a comparison of the output of our model and the
-output of the NIST software.
-
-
-
-Figure 7: Comparison of the DANSE scattering intensity for a core-
-shell sphere with the output of the NIST SANS analysis software. The
-parameters were set to: Scale=1.0, Radius=60 , Contrast=1e-6 -2, and
-Background=0.001 cm -1.
-
-
-
-.. _CoreMultiShellModel:
-
-**2.1.6. CoreMultiShellModel**
-
-This model provides the scattering from spherical core with from 1 up
-to 4 shell structures. Ithas a core of a specified radius, with four
-shells. The SLDs of the core and each shell are individually
-specified.
-
-For information about polarised and magnetic scattering, click here_.
-
-*1.1. Definition*
-
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
-
-This model is a trivial extension of the CoreShell function to a
-larger number of shells. See the CoreShell function for a diagram and
-documentation.
-
-Be careful that the SLDs and scale can be highly correlated. Hold as
-many of these fixed as possible.
-
-The 2D scattering intensity is the same as P(q) of 1D, regardless of
-the orientation of the q vector.
-
-For P*S: The outer most radius (= radius + 4 thicknesses) is used as
-the effective radius toward S(Q) if P(Q)*S(Q) is applied.
-
-The returned value is scaled to units of [cm-1] and the parameters of
-the CoreFourshell sphere model are the following:
-
-Here, rad_core = the radius of the core, thick_shelli = the thickness
-of the shell i and sld_shelli = the SLD of the shell i.
-
-And the sld_core and the sld_solv are the SLD of the core and the
-solvent, respectively.
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-rad_core
-
-
-
-60
-
-sld_core
-
--2
-
-6.4e-6
-
-sld_shell1
-
--2
-
-1e-6
-
-sld_shell2
-
--2
-
-2e-6
-
-sld_shell3
-
--2
-
-3e-6
-
-sld_shell4
-
--2
-
-4e-6
-
-sld_solv
-
--2
-
-6.4e-6
-
-thick_shell1
-
-
-
-10
-
-thick_shell2
-
-
-
-10
-
-thick_shell3
-
-
-
-10
-
-thick_shell4
-
-
-
-10
-
-background
-
-cm-1
-
-0.001
-
-Our model uses the form factor calculations implemented in a c-library
-provided by the NIST Center for Neutron Research (Kline, 2006).
-
-
+A. Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and Sons, New York, (1955)
+
+
+
+.. _SphericalSLDModel:
+
+**2.1.11. SphericalSLDModel**
+
+Similarly to the OnionExpShellModel, this model provides the form factor, *P(q)*, for a multi-shell sphere, where the
+interface between the each neighboring shells can be described by one of a number of functions including error,
+power-law, and exponential functions. This model is to calculate the scattering intensity by building a continuous
+custom SLD profile against the radius of the particle. The SLD profile is composed of a flat core, a flat solvent,
+a number (up to 9 ) flat shells, and the interfacial layers between the adjacent flat shells (or core, and solvent)
+(see below). Unlike the OnionExpShellModel (using an analytical integration), the interfacial layers here are
+sub-divided and numerically integrated assuming each of the sub-layers are described by a line function. The number
+of the sub-layer can be given by users by setting the integer values of *npts_inter* in the GUI. The form factor is
+normalized by the total volume of the sphere.
+
+*2.1.11.1. Definition*
+
+The 1D scattering intensity is calculated in the following way:
+
+.. image:: img/image022.GIF
+
+.. image:: img/image043.GIF
+
+where, for a spherically symmetric particle with a particle density |rho|\ *(r)*
+
+.. image:: img/image024.GIF
+
+so that
+
+.. image:: img/image044.GIF
+
+.. image:: img/image045.GIF
+
+.. image:: img/image046.GIF
+
+.. image:: img/image047.GIF
+
+.. image:: img/image048.GIF
+
+.. image:: img/image027.GIF
+
+Here we assumed that the SLDs of the core and solvent are constant against *r*. The SLD at the interface between
+shells, |rho|\ :sub:`inter_i`, is calculated with a function chosen by an user, where the functions are
+
+1) Exp
+
+.. image:: img/image049.GIF
+
+2) Power-Law
+
+.. image:: img/image050.GIF
+
+3) Erf
+
+.. image:: img/image051.GIF
+
+The functions are normalized so that they vary between 0 and 1, and they are constrained such that the SLD is
+continuous at the boundaries of the interface as well as each sub-layers. Thus *B* and *C* are determined.
+
+Once |rho|\ :sub:`rinter_i` is found at the boundary of the sub-layer of the interface, we can find its contribution
+to the form factor *P(q)*
+
+.. image:: img/image052.GIF
+
+.. image:: img/image053.GIF
+
+.. image:: img/image054.GIF
+
+where we assume that |rho|\ :sub:`inter_i`\ *(r)* can be approximately linear within a sub-layer *j*.
+
+In the equation
+
+.. image:: img/image055.GIF
+
+Finally, the form factor can be calculated by
+
+.. image:: img/image037.GIF
+
+where
+
+.. image:: img/image038.GIF
+
+and
+
+.. image:: img/image056.GIF
+
+The 2D scattering intensity is the same as *P(q)* above, regardless of the orientation of the *q* vector which is
+defined as
+
+.. image:: img/image040.GIF
+
+NB: The outer most radius is used as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied.
+
+The returned value is scaled to units of |cm^-1| and the parameters of this model (for just one shell) are the following
+
+==============  ========  =============
+Parameter name  Units     Default value
+==============  ========  =============
+background      |cm^-1|   0.0
+npts_inter      None      35
+scale           None      1
+sld_solv        |Ang^-2|  1e-006
+func_inter1     None      Erf
+nu_inter        None      2.5
+thick_inter1    |Ang|     50
+sld_flat1       |Ang^-2|  4e-006
+thick_flat1     |Ang|     100
+func_inter0     None      Erf
+nu_inter0       None      2.5
+rad_core0       |Ang|     50
+sld_core0       |Ang^-2|  2.07e-06
+thick_core0     |Ang|     50
+==============  ========  =============
+
+NB: *rad_core0* represents the core radius (*R1*).
+
+.. image:: img/image057.JPG
+
+*Figure. 1D plot using the default values (w/400 point).*
+
+.. image:: img/image058.JPG
+
+*Figure. SLD profile from the default values.*
 
 REFERENCE
-
-See the CoreShell documentation.
-
-TEST DATASET
-
-This example dataset is produced by running the CoreMultiShellModel
-using 200 data points, qmin = 0.001 -1, qmax = 0.7 -1 and the above
-default values.
-
-
-
-*Figure: 1D plot using the default values (w/200 data point).*
-
-The scattering length density profile for the default sld values (w/ 4
-shells).
-
-
-
-*Figure: SLD profile against the radius of the sphere for default
-SLDs.*
-
-
-
-.. _Core2ndMomentModel:
-
-**2.1.7. Core2ndMomentModel**
-
-This model describes the scattering from a layer of surfactant or
-polymer adsorbed on spherical particles under the conditions that (i)
-theparticles (cores) are contrast-matched to the dispersion medium,
-(ii) S(Q)~1 (ie, the particle volume fraction is dilute), (iii) the
-particle radius is >> layer thickness (ie, the interface is locally
-flat), and (iv) scattering from excess unadsorbed adsorbate in the
-bulk medium is absent or has been corrected for.
-
-Unlike a core-shell model, this model does not assume any form for the
-density distribution of the adsorbed species normal to the interface
-(cf, a core-shell model which assumes the density distribution to be a
-homogeneous step-function). For comparison, if the thickness of a
-(core-shell like) step function distribution is t, the second moment,
-sigma = sqrt((t^2)/12). Thesigma is the second moment about the mean
-of the density distribution (ie, the distance of the centre-of-mass of
-the distribution from the interface).
-
-*1.1. Definition*
-
-The I0 is calculated in the following way (King, 2002):
-
-
-
-
-
-where *scale* is a scale factor, *poly* is the sld of the polymer (or
-surfactant) layer,solv is the sld of the solvent/medium and cores,
-phi_cores is the volume fraction of the core paraticles, and Gamma and
-delta arethe adsorbed amount and the bulk density of the polymers
-respectively. The sigma is the second moment of the thickness
-distribution.
-
-
-
-Note that all parameters except the 'sigma' are correlated for fitting
-so that fittingthose with more than one parameters will be generally
-failed. And note that unlike other shape models, no volume
-normalization was applied to this model.
-
-The returned value is scaled to units of [cm-1] and the parameters are
-the following:
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-density_poly
-
-g/cm2
-
-0.7
-
-radius_core
-
-
-
-500
-
-ads_amount
-
-mg/m2
-
-1.9
-second_moment 23.0 volf_cores None 0.14
-sld_poly
-
--2
-
-1.5e-6
-
-sld_solv
-
--2
-
-6.3e-6
-
-background
-
-cm-1
-
-0.0
-
-
+L. A. Feigin and D. I. Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*,
+Plenum Press, New York, (1987)
+
+
+
+.. _LinearPearlsModel:
+
+**2.1.12. LinearPearlsModel**
+
+This model provides the form factor for *N* spherical pearls of radius *R* linearly joined by short strings (or segment
+length or edge separation) *l* (= *A* - 2\ *R*)). *A* is the center-to-center pearl separation distance. The thickness
+of each string is assumed to be negligible.
+
+.. image:: img/linearpearls.jpg
+
+*2.1.12.1. Definition*
+
+The output of the scattering intensity function for the LinearPearlsModel is given by (Dobrynin, 1996)
+
+.. image:: img/linearpearl_eq1.gif
+
+where the mass *m*\ :sub:`p` is (SLD\ :sub:`pearl` - SLD\ :sub:`solvent`) \* (volume of *N* pearls). V is the total
+volume.
+
+The 2D scattering intensity is the same as *P(q)* above, regardless of the orientation of the *q* vector.
+
+The returned value is scaled to units of |cm^-1| and the parameters of the LinearPearlsModel are the following
+
+===============  ========  =============
+Parameter name   Units     Default value
+===============  ========  =============
+scale            None      1.0
+radius           |Ang|     80.0
+edge_separation  |Ang|     350.0
+num_pearls       None      3
+sld_pearl        |Ang^-2|  1e-6
+sld_solv         |Ang^-2|  6.3e-6
+background       |cm^-1|   0.0
+===============  ========  =============
+
+NB: *num_pearls* must be an integer.
+
+.. image:: img/linearpearl_plot.jpg
 
 REFERENCE
-
-S. King, P. Griffiths, J. Hone, and T. Cosgrove, "SANS from Adsorbed
-Polymer Lyaers", Macromol. Symp. 190, 33-42 (2002).
-
-
-
-.. _MultiShellModel:
-
-**2.1.8. MultiShellModel**
-
-This model provides the form factor, P( *q*), for a multi-lamellar
-vesicle with N shells where the core is filled with solvent and the
-shells are interleaved with layers of solvent. For N = 1, this return
-to the vesicle model (above).
-
-
-
-The 2D scattering intensity is the same as 1D, regardless of the
-orientation of the *q* vector which is defined as .
-
-For P*S: The outer most radius (= core_radius + n_pairs * s_thickness
-+ (n_pairs -1) * w_thickness) is used as the effective radius toward
-S(Q) when P(Q)*S(Q) is applied.
-
-The returned value is scaled to units of [cm-1] and the parameters of
-the multi-shell model are the following:
-
-In the parameters, the s_thickness is the shell thickness while the
-w_thickness is the solvent thickness, and the n_pair is the number of
-shells.
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-core_radius
-
-
-
-60.0
-
-n_pairs
-
-None
-
-2.0
-
-core_sld
-
--2
-
-6.3e-6
-
-shell_sld
-
--2
-
-0.0
-
-background
-
-cm-1
-
-0.0
-
-s_thickness
-
-
-
-10
-
-w_thickness
-
-
-
-10
-
-
-
-*Figure. 1D plot using the default values (w/200 data point).*
-
-Our model uses the form factor calculations implemented in a c-library
-provided by the NIST Center for Neutron Research (Kline, 2006).
+A. V. Dobrynin, M. Rubinstein and S. P. Obukhov, *Macromol.*, 29 (1996) 2974-2979
+
+
+
+.. _PearlNecklaceModel:
+
+**2.1.13. PearlNecklaceModel**
+
+This model provides the form factor for a pearl necklace composed of two elements: *N* pearls (homogeneous spheres
+of radius *R*) freely jointed by *M* rods (like strings - with a total mass *Mw* = *M* \* *m*\ :sub:`r` + *N* \* *m*\ :sub:`s`,
+and the string segment length (or edge separation) *l* (= *A* - 2\ *R*)). *A* is the center-to-center pearl separation
+distance.
+
+.. image:: img/pearl_fig.jpg
+
+*2.1.13.1. Definition*
+
+The output of the scattering intensity function for the PearlNecklaceModel is given by (Schweins, 2004)
+
+.. image:: img/pearl_eq1.gif
+
+where
+
+.. image:: img/pearl_eq2.gif
+
+.. image:: img/pearl_eq3.gif
+
+.. image:: img/pearl_eq4.gif
+
+.. image:: img/pearl_eq5.gif
+
+.. image:: img/pearl_eq6.gif
+
+and
+
+.. image:: img/pearl_eq7.gif
+
+where the mass *m*\ :sub:`i` is (SLD\ :sub:`i` - SLD\ :sub:`solvent`) \* (volume of the *N* pearls/rods). *V* is the
+total volume of the necklace.
+
+The 2D scattering intensity is the same as *P(q)* above, regardless of the orientation of the *q* vector.
+
+The returned value is scaled to units of |cm^-1| and the parameters of the PearlNecklaceModel are the following
+
+===============  ========  =============
+Parameter name   Units     Default value
+===============  ========  =============
+scale            None      1.0
+radius           |Ang|     80.0
+edge_separation  |Ang|     350.0
+num_pearls       None      3
+sld_pearl        |Ang^-2|  1e-6
+sld_solv         |Ang^-2|  6.3e-6
+sld_string       |Ang^-2|  1e-6
+thick_string
+(=rod diameter)  |Ang|     2.5
+background       |cm^-1|   0.0
+===============  ========  =============
+
+NB: *num_pearls* must be an integer.
+
+.. image:: img/pearl_plot.jpg
 
 REFERENCE
-
-Cabane, B., Small Angle Scattering Methods, Surfactant Solutions: New
-Methods of Investigation, Ch.2, Surfactant Science Series Vol. 22, Ed.
-R. Zana, M. Dekker, New York, 1987.
-
-
-
-.. _OnionExpShellModel:
-
-**2.1.9. OnionExpShellModel**
-
-This model provides the form factor, *P*( *q*), for a multi-shell
-sphere where the scattering length density (SLD) of the each shell is
-described by an exponential (linear, or flat-top) function. The form
-factor is normalized by the volume of the sphere where the SLD is not
-identical to the SLD of the solvent. We currently provide up to 9
-shells with this model.
-
-The 1D scattering intensity is calculated in the following way:
-
-
-
-
-
-where, for a spherically symmetric particle with a particle density
-*r*( *r*) [L.A.Feigin and D.I.Svergun, Structure Analysis by Small-
-Angle X-Ray and Neutron Scattering, Plenum Press, New York, 1987],
-
-
-
-so that
-
-
-
-
-
-
-
-
-Here we assumed that the SLDs of the core and solvent are constant
-against *r*. Now lets consider the SLD of a shell, *rshelli*,
-defineded by
-
-
-
-An example of a possible SLD profile is shown below where
-sld_in_shelli ( *rin* ) and thick_shelli ( *Dtshelli* ) stand for the
-SLD of the inner side of the ith shell and the thickness of the ith
-shell in the equation above, respectively.
-
-For \|A\|>0,
-
-
-
-For A *~ *0 (eg., A = - 0.0001), this function converges to that of
-the linear SLD profile (ie, *rshelli*( *r*) = *A \*( *r* -
-*rshelli-1*) / *Dtshelli*) + *B \*), so this case it is equivalent
-to
-
-
-
-
-
-
-
-
-
-For A = 0, the exponential function has no dependence on the radius
-(so that sld_out_shell# ( *rout*) is ignored this case) and becomes
-flat. We set the constant to *rin* for convenience, and thus the form
-factor contributed by the shells is
-
-
-
-
-
-In the equation,
-
-
-
-Finally, the form factor can be calculated by
-
-
-
-where
-
-
-
-
-
-
-
-
-
-
-
-The 2D scattering intensity is the same as *P*( *q*) above, regardless
-of the orientation of the *q* vector which is defined as .
-
-For P*S: The outer most radius is used as the effective radius toward
-S(Q) when P(Q)*S(Q) is applied.
-
-The returned value is scaled to units of [cm-1] and the parameters of
-this model are the following:
-
-In the parameters, the rad_core represents the core radius (R1) and
-the thick_shell1 (R2 R1) is the thickness of the shell1, etc.
-
-Note: Only No. of shells = 1 is given below.
-
-Parameter name
-
-Units
-
-Default value
-
-A_shell1
-
-None
-
-1
-
-scale
-
-None
-
-1.0
-
-rad_core
-
-
-
-200
-
-thick_shell1
-
-
-
-50
-
-sld_core
-
--2
-
-1.0e-06
-
-sld_in_shell1
-
--2
-
-1.7e-06
-
-sld_out_shell1
-
--2
-
-2.0e-06
-
-sld_solv
-
--2
-
-6.4e-06
-
-background
-
-cm-1
-
-0.0
-
-
-
-*Figure. 1D plot using the default values (w/400 point).*
-
-
-
-*Figure. SLD profile from the default values.*
-
-REFERENCE
-
-L.A.Feigin and D.I.Svergun, Structure Analysis by Small-Angle X-Ray
-and Neutron Scattering, Plenum Press, New York, 1987
-
-
-
-.. _VesicleModel:
-
-**2.1.10. VesicleModel**
-
-This model provides the form factor, P( *q*), for an unilamellar
-vesicle. The form factor is normalized by the volume of the shell.
-
-The 1D scattering intensity is calculated in the following way
-(Guinier, 1955):
-
-
-
-
-
-where *scale* is a scale factor, *Vshell* is the volume of the shell, *V1* is the volume of the core, *V2* is the total
-volume, *R1* is the radius of the core, *r2* is the outer radius of the shell, *1* is the scattering length density of
-the core and the solvent, *2* is the scattering length density of the shell, and *bkg* is the background level. And
-*J1* = (sin *x *- *x*cos *x*)/ *x*2. The functional form is identical to a "typical" core-shell structure, except that
-the scattering is normalized by the volume that is contributing to the scattering, namely the volume of the shell alone.
-Also, the vesicle is best defined in terms of a core radius (= R1) and a shell thickness, t.
-
-
-
-The 2D scattering intensity is the same as *P*( *q*) above, regardless
-of the orientation of the *q* vector which is defined as .
-
-For P*S: The outer most radius (= radius + thickness) is used as the
-effective radius toward S(Q) when P(Q)*S(Q) is applied.
-
-The returned value is scaled to units of [cm-1] and the parameters of
-the vesicle model are the following:
-
-In the parameters, the radius represents the core radius (R1) and the
-thickness (R2 R1) is the shell thickness.
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-radius
-
-
-
-100
-
-thickness
-
-
-
-30
-
-core_sld
-
--2
-
-6.3e-6
-
-shell_sld
-
--2
-
-0
-
-background
-
-cm-1
-
-0.0
-
-
-
-*Figure. 1D plot using the default values (w/200 data point).*
-
-Our model uses the form factor calculations implemented in a c-library
-provided by the NIST Center for Neutron Research (Kline, 2006).
-
-REFERENCE
-
-Guinier, A. and G. Fournet, "Small-Angle Scattering of X-Rays", John
-Wiley and Sons, New York, (1955).
-
-
-
-.. _SphericalSLDModel:
-
-**2.1.11. SphericalSLDModel**
-
-Similarly to the OnionExpShellModel, this model provides the form
-factor, *P*( *q*), for a multi-shell sphere, where the interface
-between the each neighboring shells can be described by one of the
-functions including error, power-law, and exponential functions. This
-model is to calculate the scattering intensity by building a
-continuous custom SLD profile against the radius of the particle. The
-SLD profile is composed of a flat core, a flat solvent, a number (up
-to 9 shells) of flat shells, and the interfacial layers between the
-adjacent flat shells (or core, and solvent) (See below). Unlike
-OnionExpShellModel (using an analytical integration), the interfacial
-layers are sub-divided and numerically integrated assuming each sub-
-layers are described by a line function. The number of the sub-layer
-can be given by users by setting the integer values of npts_inter# in
-GUI. The form factor is normalized by the total volume of the sphere.
-
-The 1D scattering intensity is calculated in the following way:
-
-
-
-
-
-where, for a spherically symmetric particle with a particle density
-*r*( *r*) [L.A.Feigin and D.I.Svergun, Structure Analysis by Small-
-Angle X-Ray and Neutron Scattering, Plenum Press, New York, 1987],
-
-
-
-so that
-
-
-
-
-
-
-
-
-
-
-
-
-
-Here we assumed that the SLDs of the core and solvent are constant
-against *r*. The SLD at the interface between shells, *rinter_i*, is
-calculated with a function chosen by an user, where the functions are:
-
-1) Exp;
-
-
-
-2) Power-Law;
-
-
-
-
-
-3) Erf;
-
-
-
-
-
-
-
-Then the functions are normalized so that it varies between 0 and 1
-and they are constrained such that the SLD is continuous at the
-boundaries of the interface as well as each sub-layers and thus the B
-and C are determined.
-
-Once the *rinter_i* is found at the boundary of the sub-layer of the
-interface, we can find its contribution to the form factor P(q);
-
-
-
-
-
-
-
-where we assume that rho_inter_i (r) can be approximately linear
-within a sub-layer j.
-
-In the equation,
-
-
-
-Finally, the form factor can be calculated by
-
-
-
-where
-
-
-
-
-
-
-
-
-
-
-
-The 2D scattering intensity is the same as *P*( *q*) above, regardless
-of the orientation of the *q* vector which is defined as .
-
-For P*S: The outer most radius is used as the effective radius toward
-S(Q) when P(Q)*S(Q) is applied.
-
-The returned value is scaled to units of [cm-1] and the parameters of
-this model are the following:
-
-In the parameters, the rad_core0 represents the core radius (R1).
-
-Note: Only No. of shells = 1 is given below.
-
-Parameter name
-
-Units
-
-Default value
-
-background
-
-cm-1
-
-0.0
-
-npts_inter
-
-35
-
-scale
-
-1
-
-sld_solv
-
--2
-
-1e-006
-
-func_inter1
-
-Erf
-
-nu_inter
-
-2.5
-
-thick_inter1
-
-
-
-50
-
-sld_flat1
-
--2
-
-4e-006
-
-thick_flat1
-
-
-
-100
-
-func_inter0
-
-Erf
-
-nu_inter0
-
-2.5
-
-rad_core0
-
-
-
-50
-
-sld_core0
-
--2
-
-2.07e-06
-
-thick_core0
-
-
-
-50
-
-
-
-*Figure. 1D plot using the default values (w/400 point).*
-
-
-
-*Figure. SLD profile from the default values.*
-
-REFERENCE
-
-L.A.Feigin and D.I.Svergun, Structure Analysis by Small-Angle X-Ray
-and Neutron Scattering, Plenum Press, New York, 1987
-
-
-
-.. _LinearPearlsModel:
-
-**2.1.12. LinearPearlsModel**
-
-This model provides the form factor for pearls linearly joined by
-short strings: N pearls (homogeneous spheres), the radius R and the
-string segment length (or edge separation) l (= A- 2R)). The A is the
-center to center pearl separation distance. The thickness of each
-string is assumed to be negligable.
-
-
-
-
-
-*1.1. Definition*
-
-
-
-The output of the scattering intensity function for the linearpearls
-model is given by (Dobrynin, 1996):
-
-
-
-where the mass mp is (sld(of a pearl) sld(of solvent)) * (volume of
-the N pearls), V is the total volume.
-
-The 2D scattering intensity is the same as P(q) above, regardless of
-the orientation of the q vector.
-
-The returned value is scaled to units of [cm-1] and the parameters are
-the following:
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-radius
-
-
-
-80.0
-
-edge_separation
-
-
-
-350.0
-
-num_pearls
-
-(integer)
-
-3
-
-sld_pearl
-
--2
-
-1e-6
-
-sld_solv
-
--2
-
-6.3e-6
-
-background
-
-cm-1
-
-0.0
-
-
-
-
-
-REFERENCE
-
-A. V. Dobrynin, M. Rubinstein and S. P. Obukhov, Macromol. 29,
-2974-2979, 1996.
-
-
-
-.. _PearlNecklaceModel:
-
-**2.1.13. PearlNecklaceModel**
-
-This model provides the form factor for a pearl necklace composed of
-two elements: N pearls (homogeneous spheres) freely jointed by M rods
-(like strings) (with a total mass Mw = M *mr + N * ms, the radius R
-and the string segment length (or edge separation) l (= A- 2R)). The A
-is the center to center pearl separation distance.
-
-
-
-
-
-*1.1. Definition*
-
-The output of the scattering intensity function for the pearlnecklace
-model is given by (Schweins, 2004):
-
-
-
-where
-
-,
-
-,
-
-,
-
-,
-
-,
-
-and
-
-.
-
-
-
-where the mass mi is (sld(of i) sld(of solvent)) * (volume of the N
-pearls/rods), V is the total volume of the necklace.
-
-The 2D scattering intensity is the same as P(q) above, regardless of
-the orientation of the q vector.
-
-The returned value is scaled to units of [cm-1] and the parameters are
-the following:
-
-Parameter name
-
-Units
-
-Default value
-
-scale
-
-None
-
-1.0
-
-radius
-
-
-
-80.0
-
-edge_separation
-
-
-
-350.0
-
-num_pearls
-
-(integer)
-
-3
-
-sld_pearl
-
--2
-
-1e-6
-
-sld_solv
-
--2
-
-6.3e-6
-
-sld_string
-
--2
-
-1e-6
-
-thick_string
-
-(=rod diameter)
-
-
-
-2.5
-
-background
-
-cm-1
-
-0.0
-
-
-
-
-
-REFERENCE
-
-R. Schweins and K. Huber, Particle Scattering Factor of Pearl Necklace
-Chains, Macromol. Symp., 211, 25-42, 2004.
+R. Schweins and K. Huber, *Particle Scattering Factor of Pearl Necklace Chains*, *Macromol. Symp.* 211 (2004) 25-42 2004
 
 
@@ -1774,5 +1196,5 @@
 
 The output of the 2D scattering intensity function for oriented
-cylinders is given by (Guinier, 1955):
+cylinders is given by (Guinier, 1955)
 
 
@@ -1803,5 +1225,5 @@
 toward S(Q) when P(Q)*S(Q) is applied.
 
-The returned value is scaled to units of [cm-1] and the parameters of
+The returned value is scaled to units of |cm^-1| and the parameters of
 the cylinder model are the following:
 
@@ -1838,5 +1260,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -1886,5 +1308,5 @@
 
 
-Figure 3: Comparison of the DANSE scattering intensity for a cylinder
+Figure 3: Comparison of the SasView scattering intensity for a cylinder
 with the output of the NIST SANS analysis software. The parameters
 were set to: Scale=1.0, Radius=20 , Length=400 , Contrast=3e-6 -2, and
@@ -1916,13 +1338,11 @@
 hollow cylinder have the same SLD.
 
-The 1D scattering intensity is calculated in the following way
-(Guinier, 1955):
-
-
-
-
-
-where *scale* is a scale factor, *J1* is the 1st order Bessel
-function, *J1* (x)= (sin *x *- *x*cos *x*)/ *x*2.
+The 1D scattering intensity is calculated in the following way (Guinier, 1955)
+
+
+
+
+
+where *scale* is a scale factor, *J1* is the 1st order Bessel function, *J1(x)* = (sin *x - *x* cos *x*)/ *x*\ :sup:`2`.
 
 
@@ -1986,5 +1406,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.01
@@ -2028,5 +1448,5 @@
 *1.1. Definition*
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The Capped Cylinder geometry is defined as:
@@ -2077,5 +1497,5 @@
 
 This example dataset is produced by running the Macro
-CappedCylinder(), using 200 data points, qmin = 0.001 -1, qmax = 0.7
+CappedCylinder(), using 200 data points, *qmin* = 0.001 -1, *qmax* = 0.7
 -1 and the above default values.
 
@@ -2190,5 +1610,5 @@
 used as the effective radius toward S(Q) when P(Q)*S(Q) is applied.
 
-The returned value is scaled to units of [cm-1] and the parameters of
+The returned value is scaled to units of |cm^-1| and the parameters of
 the core-shell cylinder model are the following:
 
@@ -2243,5 +1663,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -2284,5 +1704,5 @@
 
 
-Figure 8: Comparison of the DANSE scattering intensity for a core-
+Figure 8: Comparison of the SasView scattering intensity for a core-
 shell cylinder with the output of the NIST SANS analysis software. The
 parameters were set to: Scale=1.0, Radius=20 , Thickness=10 ,
@@ -2354,5 +1774,5 @@
 normalized by the particle volume: P(q) = scale*<f^2>/V .
 
-The returned value is scaled to units of [cm-1].
+The returned value is scaled to units of |cm^-1|.
 
 To provide easy access to the orientation of the elliptical, we define
@@ -2452,7 +1872,5 @@
 
 
-*Figure. The intensities averaged from 2D over different number *
-
-*of points of binning of angles.*
+*Figure. The intensities averaged from 2D over different numbers of bins and angles.*
 
 REFERENCE
@@ -2481,5 +1899,5 @@
 flexible cylinder can be considered a rigid rod. The Kuhn length (b =
 2*lp) is also used to describe the stiffness of a chain. The returned
-value is in units of [cm-1], on absolute scale. In the parameters, the
+value is in units of |cm^-1|, on absolute scale. In the parameters, the
 sldCyl and sldSolv represent SLD (chain/cylinder) and SLD (solvent)
 respectively.
@@ -2527,5 +1945,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.01
@@ -2568,10 +1986,10 @@
 **2.1.20 FlexCylEllipXModel**
 
-*Flexible Cylinder with Elliptical Cross-Section: *Calculates the
+*Flexible Cylinder with Elliptical Cross-Section:* Calculates the
 form factor for a flexible cylinder with an elliptical cross section
 and a uniform scattering length density. The non-negligible diameter
 of the cylinder is included by accounting for excluded volume
 interactions within the walk of a single cylinder. The form factor is
-normalized by the particle volume such that P(q) = scale*<f^2>/Vol +
+normalized by the particle volume such that P(q) = scale\*<f^2>/Vol +
 bkg, where < > is an average over all possible orientations of the
 flexible cylinder.
@@ -2586,5 +2004,5 @@
 for the details.
 
-NOTE: there are several typos in the original reference that have been
+NB: there are several typos in the original reference that have been
 corrected by WRC. Details of the corrections are in the reference
 below.
@@ -2612,5 +2030,5 @@
 curve fitting to maintain this inequality.
 
-The returned value is in units of [cm-1], on absolute scale.
+The returned value is in units of |cm^-1|, on absolute scale.
 
 The sldCyl = SLD (chain), sldSolv = SLD (solvent). The scale, and the
@@ -2644,5 +2062,5 @@
 
 This example dataset is produced by running the Macro
-FlexCylEllipXModel, using 200 data points, qmin = 0.001 -1, qmax = 0.7
+FlexCylEllipXModel, using 200 data points, *qmin* = 0.001 -1, *qmax* = 0.7
 -1 and the default values below.
 
@@ -2659,5 +2077,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0001
@@ -2717,5 +2135,5 @@
 
 
-The returned value is scaled to units of [cm-1] and the parameters of
+The returned value is scaled to units of |cm^-1| and the parameters of
 the core-shell cylinder model are the following:
 
@@ -2770,5 +2188,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -2829,7 +2247,7 @@
 *1.1. Definition*
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
-
-The barbell geometry is defined as:
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
+
+The barbell geometry is defined as
 
 
@@ -2837,5 +2255,5 @@
 r is the radius of the cylinder. All other parameters are as defined
 in the diagram. Since the end cap radius R >= r and by definition for
-this geometry h > 0, h is then defined by r and R as:
+this geometry h > 0, h is then defined by r and R as
 
 h = sqrt(R^2 - r^2).
@@ -2880,5 +2298,5 @@
 
 This example dataset is produced by running the Macro PlotBarbell(),
-using 200 data points, qmin = 0.001 -1, qmax = 0.7 -1 and the above
+using 200 data points, *qmin* = 0.001 -1, *qmax* = 0.7 -1 and the above
 default values.
 
@@ -2975,5 +2393,5 @@
 
 
-The returned value is in units of [cm-1 sr-1], on absolute scale.
+The returned value is in units of [|cm^-1| |sr^-1|, on absolute scale.
 
 The scattering intensity I(q) is:
@@ -3022,5 +2440,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.001
@@ -3112,5 +2530,5 @@
 
 
-The returned value is in units of [cm-1], on absolute scale.
+The returned value is in units of |cm^-1|, on absolute scale.
 
 The form factor calculated is:
@@ -3135,5 +2553,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -3223,5 +2641,5 @@
 effective radius toward S(Q) when P(Q)*S(Q) is applied.
 
-The returned value is scaled to units of [cm-1] and the parameters of
+The returned value is scaled to units of |cm^-1| and the parameters of
 the ellipsoid model are the following:
 
@@ -3264,5 +2682,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -3314,5 +2732,5 @@
 The NIST software performs that integration with a 76-point Gaussian
 quadrature rule, which will become imprecise at high q where the
-amplitude varies quickly as a function of q. The DANSE result shown
+amplitude varies quickly as a function of q. The SasView result shown
 has been obtained by summing over 501 equidistant points in . Our
 result was found to be stable over the range of q shown for a number
@@ -3321,5 +2739,5 @@
 * *
 
-Figure 5: Comparison of the DANSE scattering intensity for an
+Figure 5: Comparison of the SasView scattering intensity for an
 ellipsoid with the output of the NIST SANS analysis software. The
 parameters were set to: Scale=1.0, Radius_a=20 , Radius_b=400 ,
@@ -3351,5 +2769,5 @@
 
 
-The returned value is in units of [cm-1], on absolute scale.
+The returned value is in units of |cm^-1|, on absolute scale.
 
 The form factor calculated is:
@@ -3386,5 +2804,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.001
@@ -3472,5 +2890,5 @@
 
 
-The returned value is in units of [cm-1], on absolute scale.
+The returned value is in units of |cm^-1|, on absolute scale.
 
 The form factor calculated is:
@@ -3508,5 +2926,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -3601,5 +3019,5 @@
 
 
-The returned value is in units of [cm-1], on absolute scale. In the
+The returned value is in units of |cm^-1|, on absolute scale. In the
 parameters, sld_bi = SLD of the bilayer, sld_sol = SLD of the solvent,
 and bi_thick = the thickness of the bilayer.
@@ -3615,5 +3033,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -3682,5 +3100,5 @@
 
 
-The returned value is in units of [cm-1], on absolute scale. In the
+The returned value is in units of |cm^-1|, on absolute scale. In the
 parameters, sld_tail = SLD of the tail group, and sld_head = SLD of
 the head group.
@@ -3696,5 +3114,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -3781,5 +3199,5 @@
 B=compression modulus, and N = number of lamellar plates (n_plates).
 
-Note: When the Caille parameter is greater than approximately 0.8 to
+NB: When the Caille parameter is greater than approximately 0.8 to
 1.0, the assumptions of the model are incorrect. And due to the
 complication of the model function, users are responsible to make sure
@@ -3790,5 +3208,5 @@
 the *q* vector is defined as .
 
-The returned value is in units of [cm-1], on absolute scale.
+The returned value is in units of |cm^-1|, on absolute scale.
 
 
@@ -3802,5 +3220,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -3888,5 +3306,5 @@
 (n_plates).
 
-Note: When the Caille parameter is greater than approximately 0.8 to
+NB: When the Caille parameter is greater than approximately 0.8 to
 1.0, the assumptions of the model are incorrect. And due to the
 complication of the model function, users are responsible to make sure
@@ -3899,5 +3317,5 @@
 
 
-The returned value is in units of [cm-1], on absolute scale. In the
+The returned value is in units of |cm^-1|, on absolute scale. In the
 parameters, sld_tail = SLD of the tail group, sld_head = SLD of the
 head group, and sld_solvent = SLD of the solvent.
@@ -3913,5 +3331,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.001
@@ -4028,5 +3446,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0
@@ -4095,7 +3513,7 @@
 characterized by a Gaussian distribution.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
-
-The scattering intensity I(q) is calculated as:
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
+
+The scattering intensity I(q) is calculated as
 
 
@@ -4135,5 +3553,5 @@
 
 
-NOTE: The calculation of Z(q) is a double numerical integral that must
+NB: The calculation of Z(q) is a double numerical integral that must
 be carried out with a high density of points to properly capture the
 sharp peaks of the paracrystalline scattering. So be warned that the
@@ -4160,5 +3578,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0
@@ -4198,6 +3616,6 @@
 TEST DATASET
 
-This example dataset is produced using 200 data points, qmin = 0.01
--1, qmax = 0.1 -1 and the above default values.
+This example dataset is produced using 200 data points, *qmin* = 0.01
+-1, *qmax* = 0.1 -1 and the above default values.
 
 
@@ -4237,5 +3655,5 @@
 characterized by a Gaussian distribution.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The scattering intensity I(q) is calculated as:
@@ -4279,5 +3697,5 @@
 
 
-NOTE: The calculation of Z(q) is a double numerical integral that must
+NB: The calculation of Z(q) is a double numerical integral that must
 be carried out with a high density of points to properly capture the
 sharp peaks of the paracrystalline scattering. So be warned that the
@@ -4306,5 +3724,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0
@@ -4344,6 +3762,6 @@
 TEST DATASET
 
-This example dataset is produced using 200 data points, qmin = 0.01
--1, qmax = 0.1 -1 and the above default values.
+This example dataset is produced using 200 data points, *qmin* = 0.01
+-1, *qmax* = 0.1 -1 and the above default values.
 
 
@@ -4371,5 +3789,5 @@
 Paracrystalline distortion is assumed to be isotropic and
 characterized by a Gaussian distribution.The returned value is scaled
-to units of [cm-1sr-1], absolute scale.
+to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The scattering intensity I(q) is calculated as:
@@ -4413,5 +3831,5 @@
 
 
-NOTE: The calculation of Z(q) is a double numerical integral that must
+NB: The calculation of Z(q) is a double numerical integral that must
 be carried out with a high density of points to properly capture the
 sharp peaks of the paracrystalline scattering. So be warned that the
@@ -4440,5 +3858,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0
@@ -4478,6 +3896,6 @@
 TEST DATASET
 
-This example dataset is produced using 200 data points, qmin = 0.001
--1, qmax = 0.1 -1 and the above default values.
+This example dataset is produced using 200 data points, *qmin* = 0.001
+-1, *qmax* = 0.1 -1 and the above default values.
 
 
@@ -4535,5 +3953,5 @@
 
 The scattering intensity per unit volume is returned in the unit of
-[cm-1]; I(q) = fP(q).
+|cm^-1|; I(q) = fP(q).
 
 For P*S: The 2nd virial coefficient of the solid cylinder is calculate
@@ -4566,5 +3984,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -4681,5 +4099,5 @@
 an error, but the results will not be correct.
 
-The returned value is in units of [cm-1], on absolute scale.
+The returned value is in units of |cm^-1|, on absolute scale.
 
 For P*S: The 2nd virial coefficient of this CSPP is calculate based on
@@ -4708,5 +4126,5 @@
 
 This example dataset is produced by running the Macro
-Plot_CSParallelepiped(), using 100 data points, qmin = 0.001 -1, qmax
+Plot_CSParallelepiped(), using 100 data points, *qmin* = 0.001 -1, *qmax*
 = 0.7 -1 and the below default values.
 
@@ -4719,5 +4137,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.06
@@ -4856,5 +4274,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -4879,5 +4297,5 @@
 structures).
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The scattering intensity I(q) is calculated by:
@@ -4933,5 +4351,5 @@
 Background (=B)
 
-cm-1
+|cm^-1|
 
 0.1
@@ -4952,5 +4370,5 @@
 a low-Q signal and a high-Q signal
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The scattering intensity I(q) is calculated by:
@@ -5004,5 +4422,5 @@
 Background (=B)
 
-cm-1
+|cm^-1|
 
 0.1
@@ -5061,5 +4479,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5113,5 +4531,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5134,5 +4552,7 @@
 2013/09/09 - Description reviewed by King, S. and Parker, P.
 
-*3.6.  Absolute Power_Law *
+
+
+**3.6. AbsolutePowerLaw**
 
 This model describes a power law with background.
@@ -5166,5 +4586,5 @@
 Background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5217,5 +4637,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5238,5 +4658,5 @@
 Calculates the scattering from fractal-like aggregates built from
 spherical building blocks following the Texiera reference. The value
-returned is in cm-1.
+returned is in |cm^-1|.
 
 
@@ -5302,5 +4722,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5339,5 +4759,5 @@
 scattering length density of particles.
 
-Note: The mass fractal dimension is valid for 1<mass_dim<6.
+NB: The mass fractal dimension is valid for 1<mass_dim<6.
 
 
@@ -5416,5 +4836,5 @@
 scattering length density of particles.
 
-Note: The surface fractal dimension is valid for 1<surface_dim<3. Also
+NB: The surface fractal dimension is valid for 1<surface_dim<3. Also
 it is valid in a limited q range (see the reference for details).
 
@@ -5507,5 +4927,5 @@
 length density of particles.
 
-Note: The surface and mass fractal dimensions are valid for
+NB: The surface and mass fractal dimensions are valid for
 0<surface_dim<6, 0<mass_dim<6, and (surface_mass+mass_dim)<6.
 
@@ -5583,5 +5003,5 @@
 provided.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 See each of these individual models for full documentation.
@@ -5641,5 +5061,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5664,5 +5084,5 @@
 structures.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The scattering intensity I(q) is calculated as (eqn 5 from the
@@ -5717,5 +5137,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5738,5 +5158,5 @@
 Calculates the structure factor of a polyelectrolyte solution with the
 RPA expression derived by Borue and Erukhimovich. The value returned
-is in cm-1.
+is in |cm^-1|.
 
 
@@ -5803,5 +5223,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -5844,5 +5264,5 @@
 scale
 
-cm-1
+|cm^-1|
 
 1.0
@@ -5863,5 +5283,5 @@
 
 The returned value is P(Q) as written in equation (1), plus the
-incoherent background term. The result is in the units of [cm-1sr-1],
+incoherent background term. The result is in the units of [|cm^-1|\ |sr^-1|,
 absolute scale.
 
@@ -5925,5 +5345,5 @@
 Scale(=Guinier scale, G)
 
-cm-1
+|cm^-1|
 
 1.0
@@ -5990,5 +5410,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0
@@ -6023,5 +5443,5 @@
 scale
 
-cm-1
+|cm^-1|
 
 100
@@ -6080,5 +5500,5 @@
 scale
 
-cm-1
+|cm^-1|
 
 100
@@ -6112,5 +5532,5 @@
 molecular weight distribution.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 
@@ -6135,5 +5555,5 @@
 
 This example dataset is produced by running the Poly_GaussCoil, using
-200 data points, qmin = 0.001 -1, qmax = 0.7 -1 and the default values
+200 data points, *qmin* = 0.001 -1, *qmax* = 0.7 -1 and the default values
 below.
 
@@ -6164,5 +5584,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.001
@@ -6189,8 +5609,8 @@
 Calculates the scattering from polymers with excluded volume effects.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The returned value is P(Q) as written in equation (2), plus the
-incoherent background term. The result is in the units of [cm-1sr-1],
+incoherent background term. The result is in the units of [|cm^-1|\ |sr^-1|,
 absolute scale.
 
@@ -6260,6 +5680,6 @@
 TEST DATASET
 
-This example dataset is produced, using 200 data points, qmin = 0.001
--1, qmax = 0.2 -1 and the default values below.
+This example dataset is produced, using 200 data points, *qmin* = 0.001
+-1, *qmax* = 0.2 -1 and the default values below.
 
 Parameter name
@@ -6287,5 +5707,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -6325,5 +5745,5 @@
 Case 9: A-B-C-D Four-block copolymer
 
-Note: the case numbers are different from the IGOR/NIST SANS package.
+NB: the case numbers are different from the IGOR/NIST SANS package.
 
 
@@ -6332,5 +5752,5 @@
 will overwrite the original parameter waves.
 
-The returned value is scaled to units of [cm-1].
+The returned value is scaled to units of |cm^-1|.
 
 Component D is assumed to be the "background" component (all contrasts
@@ -6368,5 +5788,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -6447,5 +5867,5 @@
 a two Lorentzian functions.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 The scattering intensity I(q) is calculated by:
@@ -6504,5 +5924,5 @@
 Background(=B)
 
-cm-1
+|cm^-1|
 
 0.1
@@ -6525,5 +5945,5 @@
 two power laws.
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 
@@ -6570,5 +5990,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -6586,5 +6006,5 @@
 *3.25. UnifiedPower(Law and)Rg(Model)*
 
-The returned value is scaled to units of [cm-1sr-1], absolute scale.
+The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale.
 
 Note that the level 0 is an extra function that is the inverse
@@ -6643,5 +6063,5 @@
 G2
 
-cm-1sr-1
+|cm^-1|\ |sr^-1|
 
 3
@@ -6649,5 +6069,5 @@
 B2
 
-cm-1sr-1
+|cm^-1|\ |sr^-1|
 
 0.0006
@@ -6665,5 +6085,5 @@
 G1
 
-cm-1sr-1
+|cm^-1|\ |sr^-1|
 
 400
@@ -6671,5 +6091,5 @@
 B1
 
-cm-1sr-1
+|cm^-1|\ |sr^-1|
 
 4.5e-006
@@ -6677,5 +6097,5 @@
 background
 
-cm-1
+|cm^-1|
 
 0.0
@@ -6708,5 +6128,5 @@
 terms.
 
-*Note:* For 2D plot, I(q) = I(qx)*I(qy) which is defined differently
+*NB:* For 2D plot, I(q) = I(qx)*I(qy) which is defined differently
 from other shape independent models.
 
@@ -6719,5 +6139,5 @@
 A
 
-cm-1
+|cm^-1|
 
 1.0
@@ -6743,5 +6163,5 @@
 sigma=roughness).
 
-Note: This model was contributed by an interested user.
+NB: This model was contributed by an interested user.
 
 
@@ -6782,5 +6202,5 @@
 
 
-Note: This model was implemented by an interested user.
+NB: This model was implemented by an interested user.
 
 *3.29. GelFitModel*
@@ -6812,5 +6232,5 @@
 2.8.
 
-Note: This model was implemented by an interested user.
+NB: This model was implemented by an interested user.
 
 *Default input parameter values*
@@ -6824,5 +6244,5 @@
 Background
 
-cm-1
+|cm^-1|
 
 0.01
@@ -6830,5 +6250,5 @@
 Guinier scale
 
-cm-1
+|cm^-1|
 
 1.7
@@ -6836,5 +6256,5 @@
 Lorentzian scale
 
-cm-1
+|cm^-1|
 
 3.5
@@ -6863,5 +6283,5 @@
 
 *Figure. 1D plot using the default values (w/300 data points,
-qmin=0.001, and qmax=0.3).*
+*qmin*=0.001, and *qmax*=0.3).*
 
 
@@ -6877,5 +6297,5 @@
 
 
-*3.30.  Star Polymer with Gaussian Statistics *
+**3.30. Star Polymer with Gaussian Statistics**
 
 For a star with *f* arms:
@@ -6903,8 +6323,7 @@
 ------------------------------
 
-The information in this section is originated from NIST SANS IgorPro
-package.
-
-*5.1. HardSphere Structure *
+The information in this section is originated from NIST SANS IgorPro package.
+
+**2.3.1. HardSphereStructure Factor**
 
 This calculates the interparticle structure factor for monodisperse spherical particles interacting through hard sphere (excluded volume) interactions. The calculation uses the Percus-Yevick closure where the interparticle potential is:
@@ -6942,5 +6361,7 @@
 Percus, J. K.; Yevick, J. Phys. Rev. 110, 1. (1958).
 
-*5.2. SquareWell Structure *
+
+
+**2.3.2. SquareWellStructure Factor**
 
 This calculates the interparticle structure factor for a square well fluid spherical particles The mean spherical
@@ -7002,5 +6423,5 @@
 
 
-*5.3. HayterMSA Structure *
+**2.3.3. HayterMSAStructure Factor**
 
 This calculates the Structure factor (the Fourier transform of the pair correlation function g(r)) for a system of
@@ -7062,5 +6483,7 @@
 JB Hayter and J Penfold, Molecular Physics 42, 109-118 (1981).
 
-*5.4. StickyHS Structure *
+
+
+**2.3.4. StickyHSStructure Factor**
 
 This calculates the interparticle structure factor for a hard sphere
@@ -7149,53 +6572,85 @@
 
 
-
-
 2.4 Customised Functions
 ------------------------------
 
 
-Customized model functions can be redefined or added by users (See
-SansView tutorial for details).
-
-*4.1. testmodel*
-
-
+Customized model functions can be redefined or added to by users (See SansView tutorial for details).
+
+.. _testmodel:
+
+**2.4.1. testmodel**
 
 This function, as an example of a user defined function, calculates
-the intensity = A + Bcos(2q) + Csin(2q).
-
-*4.2. testmodel_2 *
+
+*I(q)* = *A* + *B* cos(2\ *q*\ ) + *C* sin(2\ *q*\ )
+
+
+
+.. _testmodel_2:
+
+**4.2. testmodel_2**
 
 This function, as an example of a user defined function, calculates
-the intensity = scale * sin(f)/f, where f = A + Bq + Cq2 + Dq3 + Eq4 +
-Fq5.
-
-*4.3. sum_p1_p2 *
+
+*I(q)* = *scale* * sin(*f*\ )/*f*
+
+where
+
+*f* = *A* + *Bq* + *Cq*\ :sup:`2` + *Dq*\ :sup:`3` + *Eq*\ :sup:`4` + *Fq*\ :sup:`5`
+
+
+
+.. _sum_p1_p2:
+
+**4.3. sum_p1_p2**
 
 This function, as an example of a user defined function, calculates
-the intensity = scale_factor * (CylinderModel + PolymerExclVolume
-model). To make your own sum(P1+P2) model, select 'Easy Custom Sum'
-from the Fitting menu, or modify and compile the file named
-'sum_p1_p2.py' from 'Edit Custom Model' in the 'Fitting' menu. It
-works only for single functional models.
-
-*4.4. sum_Ap1_1_Ap2 *
+
+*I(q)* = *scale_factor* \* (CylinderModel + PolymerExclVolumeModel)
+
+To make your own (*p1 + p2*) model, select 'Easy Custom Sum' from the Fitting menu, or modify and compile the file
+named 'sum_p1_p2.py' from 'Edit Custom Model' in the 'Fitting' menu.
+
+NB: Summing models only works only for single functional models (ie, single shell models, two-component RPA models, etc).
+
+
+
+.. _sum_Ap1_1_Ap2:
+
+**4.4. sum_Ap1_1_Ap2**
 
 This function, as an example of a user defined function, calculates
-the intensity = (scale_factor * CylinderModel + (1-scale_factor) *
-PolymerExclVolume model). To make your own A*p1+(1-A)*p2 model, modify
-and compile the file named 'sum_Ap1_1_Ap2.py' from 'Edit Custom Model'
-in the 'Fitting' menu. It works only for single functional models.
-
-*4.5. polynomial5 *
+
+*I(q)* = (*scale_factor* \* CylinderModel + (1 - *scale_factor*\ ) \* PolymerExclVolume model)
+
+To make your own (*A*\ * *p1* + (1-*A*) \* *p2*) model, modify and compile the file named 'sum_Ap1_1_Ap2.py' from
+'Edit Custom Model' in the 'Fitting' menu.
+
+NB: Summing models only works only for single functional models (ie, single shell models, two-component RPA models, etc).
+
+
+
+.. _polynomial5:
+
+**4.5. polynomial5**
 
 This function, as an example of a user defined function, calculates
-the intensity = A + Bq + Cq2 + Dq3 + Eq4 + Fq5. This model can be
-modified and compiled from 'Edit Custom Model' in the 'Fitting' menu.
-
-*4.6. sph_bessel_jn *
+
+*I(q)* = *A* + *Bq* + *Cq*\ :sup:`2` + *Dq*\ :sup:`3` + *Eq*\ :sup:`4` + *Fq*\ :sup:`5`
+
+This model can be modified and compiled from 'Edit Custom Model' in the 'Fitting' menu.
+
+
+
+.. _sph_bessel_jn:
+
+**4.6. sph_bessel_jn**
 
 This function, as an example of a user defined function, calculates
-the intensity = C*sph_jn(Ax+B)+D where the sph_jn is spherical Bessel
-function of the order n. This model can be modified and compiled from
-'Edit Custom Model' in the 'Fitting' menu.
+
+*I(q)* = *C* \* *sph_jn(Ax+B)+D*
+
+where *sph_jn* is a spherical Bessel function of order *n*.
+
+This model can be modified and compiled from 'Edit Custom Model' in the 'Fitting' menu.
