def matching_point(en, rot, V, R, mu):
""" estimate matching point for inward and outward solutions position
based on the determinant of the R-matrix.
Parameters
----------
en : float
potential energy of the solution
rot : int
rotational quantum number J
V : numpy 3d array
potential curve and couplings matrix
R : numpy 1d array
internuclear distance grid
mu : float
reduced mass in kg
Returns
-------
mx : int
matching point grid index
"""
oo, n, m = V.shape
Vm = min([V[-1][j][j].min() for j in range(n)]) # lowest dissociation energy
if en > Vm:
return oo-1
else:
Vnn = np.transpose(V)[-1][-1] # -1 -1 highest PEC?
mx = np.abs(Vnn - en).argmin()
WI = WImat(en, rot, V, R, mu)
Rm = RImat(WI, mx)
while linalg.det(Rm[mx]) > 1:
mx -= 1
return mx
评论列表
文章目录