def equilibrium_ionization(self, rate_matrix=None):
"""
Calculate the ionization equilibrium for all ions of the element.
Brief explanation and equations about how these equations are solved.
"""
if rate_matrix is None:
rate_matrix = self._rate_matrix()
# Solve system of equations using SVD and normalize
_, _, V = np.linalg.svd(rate_matrix.value)
# Select columns of V with smallest eigenvalues (returned in descending order)
ioneq = np.fabs(V[:, -1, :])
ioneq /= np.sum(ioneq, axis=1)[:, np.newaxis]
return u.Quantity(ioneq)
评论列表
文章目录