def mu(X,Z,A):
if not isinstance(Z,np.ndarray):<EOL><INDENT>Z = np.array(Z)<EOL><DEDENT>if not isinstance(A,np.ndarray):<EOL><INDENT>A = np.array(A)<EOL><DEDENT>if not isinstance(X,np.ndarray):<EOL><INDENT>X = np.array(X)<EOL><DEDENT>try:<EOL><INDENT>mu = old_div(<NUM_LIT:1.>,sum(X*(<NUM_LIT:1.>+Z)/A))<EOL><DEDENT>except TypeError:<EOL><INDENT>X=np.array([X])<EOL>A=np.array([A])<EOL>Z=np.array([Z])<EOL>mu = old_div(<NUM_LIT:1.>,sum(X*(<NUM_LIT:1.>+Z)/A))<EOL><DEDENT>return mu<EOL>
mean molecular weight assuming full ionisation.

(Kippenhahn & Weigert, Ch 13.1, Eq. 13.6)

Parameters
----------
X : float
    Mass fraction vector.
Z : float
    Charge number vector.
A : float
    Mass number vector.