Index: sasmodels/models/core_shell_bicelle_elliptical.py
===================================================================
--- sasmodels/models/core_shell_bicelle_elliptical.py	(revision 0b56f3871b1019e3bb99fb618e1342d5f26c8de4)
+++ sasmodels/models/core_shell_bicelle_elliptical.py	(revision 15a90c1aa6a67491d6170c2aa26907b5939da063)
@@ -80,8 +80,8 @@
 
 
-.. figure:: img/elliptical_cylinder_angle_definition.jpg
+.. figure:: img/elliptical_cylinder_angle_definition.png
 
-    Definition of the angles for the oriented core_shell_bicelle_elliptical model.
-    Note that *theta* and *phi* are currently defined differently to those for the core_shell_bicelle model.
+    Definition of the angles for the oriented core_shell_bicelle_elliptical particles.   
+
 
 
Index: sasmodels/models/core_shell_parallelepiped.py
===================================================================
--- sasmodels/models/core_shell_parallelepiped.py	(revision cb0dc22aeaff717fb8130fd48c3134fa935d7ceb)
+++ sasmodels/models/core_shell_parallelepiped.py	(revision 1916c5233063b68d94c979bea7935dfa475ffa95)
@@ -10,6 +10,6 @@
 
 .. note::
-   This model was originally ported from NIST IGOR macros. However,t is not
-   yet fully understood by the SasView developers and is currently review.
+   This model was originally ported from NIST IGOR macros. However, it is not
+   yet fully understood by the SasView developers and is currently under review.
 
 The form factor is normalized by the particle volume $V$ such that
@@ -51,13 +51,14 @@
 
     F_{a}(Q,\alpha,\beta)=
-    \left[\frac{\sin(Q(L_A+2t_A)/2\sin\alpha \sin\beta)}{Q(L_A+2t_A)/2\sin\alpha\sin\beta}
-    - \frac{\sin(QL_A/2\sin\alpha \sin\beta)}{QL_A/2\sin\alpha \sin\beta} \right]
-    \left[\frac{\sin(QL_B/2\sin\alpha \sin\beta)}{QL_B/2\sin\alpha \sin\beta} \right]
-    \left[\frac{\sin(QL_C/2\sin\alpha \sin\beta)}{QL_C/2\sin\alpha \sin\beta} \right]
+    \left[\frac{\sin(\tfrac{1}{2}Q(L_A+2t_A)\sin\alpha \sin\beta)}{\tfrac{1}{2}Q(L_A+2t_A)\sin\alpha\sin\beta}
+    - \frac{\sin(\tfrac{1}{2}QL_A\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_A\sin\alpha \sin\beta} \right]
+    \left[\frac{\sin(\tfrac{1}{2}QL_B\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_B\sin\alpha \sin\beta} \right]
+    \left[\frac{\sin(\tfrac{1}{2}QL_C\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_C\sin\alpha \sin\beta} \right]
 
 .. note::
 
+    Why does t_B not appear in the above equation?
     For the calculation of the form factor to be valid, the sides of the solid
-    MUST be chosen such that** $A < B < C$.
+    MUST (perhaps not any more?) be chosen such that** $A < B < C$.
     If this inequality is not satisfied, the model will not report an error,
     but the calculation will not be correct and thus the result wrong.
@@ -80,6 +81,7 @@
 NB: The 2nd virial coefficient of the core_shell_parallelepiped is calculated
 based on the the averaged effective radius $(=\sqrt{(A+2t_A)(B+2t_B)/\pi})$
-and length $(C+2t_C)$ values, and used as the effective radius
-for $S(Q)$ when $P(Q) * S(Q)$ is applied.
+and length $(C+2t_C)$ values, after appropriately
+sorting the three dimensions to give an oblate or prolate particle, to give an 
+effective radius, for $S(Q)$ when $P(Q) * S(Q)$ is applied.
 
 To provide easy access to the orientation of the parallelepiped, we define the
@@ -90,9 +92,9 @@
 *x*-axis of the detector.
 
-.. figure:: img/parallelepiped_angle_definition.jpg
+.. figure:: img/parallelepiped_angle_definition.png
 
     Definition of the angles for oriented core-shell parallelepipeds.
 
-.. figure:: img/parallelepiped_angle_projection.jpg
+.. figure:: img/parallelepiped_angle_projection.png
 
     Examples of the angles for oriented core-shell parallelepipeds against the
@@ -119,5 +121,5 @@
 
 import numpy as np
-from numpy import pi, inf, sqrt
+from numpy import pi, inf, sqrt, cos, sin
 
 name = "core_shell_parallelepiped"
@@ -193,9 +195,10 @@
             psi_pd=10, psi_pd_n=1)
 
-qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5)
+# rkh 7/4/17 add random unit test for 2d, note make all params different, 2d values not tested against other codes or models
+qx, qy = 0.2 * cos(pi/6.), 0.2 * sin(pi/6.)
 tests = [[{}, 0.2, 0.533149288477],
          [{}, [0.2], [0.533149288477]],
-         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.032102135569],
-         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.032102135569]],
+         [{'theta':10.0, 'phi':20.0}, (qx, qy), 0.0853299803222],
+         [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0853299803222]],
         ]
 del qx, qy  # not necessary to delete, but cleaner
Index: sasmodels/models/cylinder.py
===================================================================
--- sasmodels/models/cylinder.py	(revision b7e8b94b477e6d9a7e4e2666bb218d3568ee66d2)
+++ sasmodels/models/cylinder.py	(revision 15a90c1aa6a67491d6170c2aa26907b5939da063)
@@ -64,4 +64,8 @@
 
     Definition of the angles for oriented cylinders.
+
+.. figure:: img/cylinder_angle_projection.png
+
+    Examples for oriented cylinders.
 
 The $\theta$ and $\phi$ parameters only appear in the model when fitting 2d data.
Index: sasmodels/models/elliptical_cylinder.py
===================================================================
--- sasmodels/models/elliptical_cylinder.py	(revision 0b56f3871b1019e3bb99fb618e1342d5f26c8de4)
+++ sasmodels/models/elliptical_cylinder.py	(revision 15a90c1aa6a67491d6170c2aa26907b5939da063)
@@ -64,12 +64,13 @@
 oriented system.
 
-.. figure:: img/elliptical_cylinder_angle_definition.jpg
+.. figure:: img/elliptical_cylinder_angle_definition.png
 
-    Definition of angles for 2D
+    Definition of angles for oriented elliptical cylinder, where axis_ratio >1,
+    and angle $\Psi$ is a rotation around the axis of the cylinder.
 
-.. figure:: img/cylinder_angle_projection.jpg
+.. figure:: img/elliptical_cylinder_angle_projection.png
 
     Examples of the angles for oriented elliptical cylinders against the
-    detector plane.
+    detector plane, with $\Psi$ = 0.
 
 NB: The 2nd virial coefficient of the cylinder is calculated based on the
Index: sasmodels/models/parallelepiped.py
===================================================================
--- sasmodels/models/parallelepiped.py	(revision 8e68ea06a7246c4bd95ce82c755719ced6fa5a60)
+++ sasmodels/models/parallelepiped.py	(revision 1916c5233063b68d94c979bea7935dfa475ffa95)
@@ -15,4 +15,5 @@
 .. _parallelepiped-image:
 
+
 .. figure:: img/parallelepiped_geometry.jpg
 
@@ -21,7 +22,7 @@
 .. note::
 
-   The edge of the solid must satisfy the condition that $A < B < C$.
-   This requirement is not enforced in the model, so it is up to the
-   user to check this during the analysis.
+   The edge of the solid used to have to satisfy the condition that $A < B < C$.
+   After some improvements to the effective radius calculation, used with an S(Q),
+   it is beleived that this is no longer the case. 
 
 The 1D scattering intensity $I(q)$ is calculated as:
@@ -71,5 +72,6 @@
 
 NB: The 2nd virial coefficient of the parallelepiped is calculated based on
-the averaged effective radius $(=\sqrt{A B / \pi})$ and
+the averaged effective radius, after appropriately
+sorting the three dimensions, to give an oblate or prolate particle, $(=\sqrt{A B / \pi})$ and
 length $(= C)$ values, and used as the effective radius for
 $S(q)$ when $P(q) \cdot S(q)$ is applied.
@@ -102,11 +104,11 @@
 .. _parallelepiped-orientation:
 
-.. figure:: img/parallelepiped_angle_definition.jpg
-
-    Definition of the angles for oriented parallelepipeds.
-
-.. figure:: img/parallelepiped_angle_projection.jpg
-
-    Examples of the angles for oriented parallelepipeds against the
+.. figure:: img/parallelepiped_angle_definition.png
+
+    Definition of the angles for oriented parallelepiped, shown with $A < B < C$.
+
+.. figure:: img/parallelepiped_angle_projection.png
+
+    Examples of the angles for an oriented parallelepiped against the
     detector plane.
 
@@ -116,7 +118,7 @@
 .. math::
 
-    P(q_x, q_y) = \left[\frac{\sin(qA\cos\alpha/2)}{(qA\cos\alpha/2)}\right]^2
-                  \left[\frac{\sin(qB\cos\beta/2)}{(qB\cos\beta/2)}\right]^2
-                  \left[\frac{\sin(qC\cos\gamma/2)}{(qC\cos\gamma/2)}\right]^2
+    P(q_x, q_y) = \left[\frac{\sin(\tfrac{1}{2}qA\cos\alpha)}{(\tfrac{1}{2}qA\cos\alpha)}\right]^2
+                  \left[\frac{\sin(\tfrac{1}{2}qB\cos\beta)}{(\tfrac{1}{2}qB\cos\beta)}\right]^2
+                  \left[\frac{\sin(\tfrac{1}{2}qC\cos\gamma)}{(\tfrac{1}{2}qC\cos\gamma)}\right]^2
 
 with
@@ -154,6 +156,4 @@
 angles.
 
-This model is based on form factor calculations implemented in a c-library
-provided by the NIST Center for Neutron Research (Kline, 2006).
 
 References
@@ -163,8 +163,17 @@
 
 R Nayuk and K Huber, *Z. Phys. Chem.*, 226 (2012) 837-854
+
+Authorship and Verification
+----------------------------
+
+* **Author:** This model is based on form factor calculations implemented in a c-library
+provided by the NIST Center for Neutron Research (Kline, 2006).
+* **Last Modified by:**  Paul Kienzle **Date:** April 05, 2017
+* **Last Reviewed by:**  Richard Heenan **Date:** April 06, 2017
+
 """
 
 import numpy as np
-from numpy import pi, inf, sqrt
+from numpy import pi, inf, sqrt, sin, cos
 
 name = "parallelepiped"
@@ -208,11 +217,16 @@
 def ER(length_a, length_b, length_c):
     """
-        Return effective radius (ER) for P(q)*S(q)
+    Return effective radius (ER) for P(q)*S(q)
     """
-
+    # now that axes can be in any size order, need to sort a,b,c where a~b and c is either much smaller 
+    # or much larger
+    abc = np.vstack((length_a, length_b, length_c))
+    abc = np.sort(abc, axis=0)
+    selector = (abc[1] - abc[0]) > (abc[2] - abc[1])
+    length = np.where(selector, abc[0], abc[2])
     # surface average radius (rough approximation)
-    surf_rad = sqrt(length_a * length_b / pi)
-
-    ddd = 0.75 * surf_rad * (2 * surf_rad * length_c + (length_c + surf_rad) * (length_c + pi * surf_rad))
+    radius = np.sqrt(np.where(~selector, abc[0]*abc[1], abc[1]*abc[2]) / pi)
+
+    ddd = 0.75 * radius * (2*radius*length + (length + radius)*(length + pi*radius))
     return 0.5 * (ddd) ** (1. / 3.)
 
@@ -230,10 +244,10 @@
             phi_pd=10, phi_pd_n=1,
             psi_pd=10, psi_pd_n=10)
-
-qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5)
+# rkh 7/4/17 add random unit test for 2d, note make all params different, 2d values not tested against other codes or models
+qx, qy = 0.2 * cos(pi/6.), 0.2 * sin(pi/6.)
 tests = [[{}, 0.2, 0.17758004974],
          [{}, [0.2], [0.17758004974]],
-         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.00560296014],
-         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.00560296014]],
+         [{'theta':10.0, 'phi':20.0}, (qx, qy), 0.0089517140475],
+         [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0089517140475]],
         ]
 del qx, qy  # not necessary to delete, but cleaner
Index: sasmodels/models/triaxial_ellipsoid.py
===================================================================
--- sasmodels/models/triaxial_ellipsoid.py	(revision 0b56f3871b1019e3bb99fb618e1342d5f26c8de4)
+++ sasmodels/models/triaxial_ellipsoid.py	(revision 15a90c1aa6a67491d6170c2aa26907b5939da063)
@@ -65,6 +65,11 @@
 To provide easy access to the orientation of the triaxial ellipsoid,
 we define the axis of the cylinder using the angles $\theta$, $\phi$
-and $\psi$. These angles are defined on
-:numref:`triaxial-ellipsoid-angles` .
+and $\psi$. These angles are defined analogously to the elliptical_cylinder below
+
+.. figure:: img/elliptical_cylinder_angle_definition.png
+
+    Definition of angles for oriented triaxial ellipsoid, where radii shown here are $a < b << c$
+    and angle $\Psi$ is a rotation around the axis of the particle.
+
 The angle $\psi$ is the rotational angle around its own $c$ axis
 against the $q$ plane. For example, $\psi = 0$ when the
@@ -73,7 +78,7 @@
 .. _triaxial-ellipsoid-angles:
 
-.. figure:: img/triaxial_ellipsoid_angle_projection.jpg
+.. figure:: img/triaxial_ellipsoid_angle_projection.png
 
-    The angles for oriented ellipsoid.
+    Some example angles for oriented ellipsoid.
 
 The radius-of-gyration for this system is  $R_g^2 = (R_a R_b R_c)^2/5$.
@@ -147,12 +152,17 @@
 def ER(radius_equat_minor, radius_equat_major, radius_polar):
     """
-        Returns the effective radius used in the S*P calculation
+    Returns the effective radius used in the S*P calculation
     """
     import numpy as np
     from .ellipsoid import ER as ellipsoid_ER
-     # now that radii can be in any size order, radii need sorting a,b,c where a~b and c is either much smaller or much larger
-     # also need some unit tests!
-    
-    return ellipsoid_ER(radius_polar, np.sqrt(radius_equat_minor * radius_equat_major))
+
+    # now that radii can be in any size order, radii need sorting a,b,c where a~b and c is either much smaller
+    # or much larger
+    radii = np.vstack((radius_equat_major, radius_equat_minor, radius_polar))
+    radii = np.sort(radii, axis=0)
+    selector = (radii[1] - radii[0]) > (radii[2] - radii[1])
+    polar = np.where(selector, radii[0], radii[2])
+    equatorial = np.sqrt(np.where(~selector, radii[0]*radii[1], radii[1]*radii[2]))
+    return ellipsoid_ER(polar, equatorial)
 
 demo = dict(scale=1, background=0,
@@ -166,4 +176,5 @@
             phi_pd=15, phi_pd_n=1,
             psi_pd=15, psi_pd_n=1)
+
 q = 0.1
 # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct!
