  The two-body scattering amplitude and energy spectrum of confined ultracold
atoms are of fundamental importance for studies of ultracold atom physics. For
many systems, one can efficiently calculate these quantities via the zero-range
Huang-Yang pseudopotential (HYP), in which the interatomic interaction is
characterized by the scattering length $a$. Furthermore, when the scattering
length is dependent on the kinetic energy $\varepsilon_{\rm r}$ of two-atom
relative motion, the results are applicable for a broad energy region. However,
when the free Hamiltonian of atomic internal state does not commute with the
inter-atomic interaction, or the center-of-mass (c.m.) motion is coupled to the
relative motion, the generalization of this technique is still lacking. We
solve this problem and construct a reasonable energy-dependent multi-channel
HYP, which is characterized by a "scattering length operator" ${\hat a}_{\rm
eff}$. Here ${\hat a}_{\rm eff}$ is an operator for atomic internal states and
c.m. motion, and depends on both the total two-atom energy and the external
field as well as the trapping parameter. The effects from the internal-state or
c.m.-relative motion coupling can be self-consistently taken into account by
${\hat a}_{\rm eff}$. We further show a method based on the quantum defect
theory, with which ${\hat a}_{\rm eff}$ can be analytically derived for systems
with van der Waals inter-atomic interaction. To demonstrate our method, we
calculate the spectrum of two ultracold fermionic alkaline-earth-like atoms
confined in an optical lattice. By comparing our results with the recent
experimental measurements for two Yb173 atoms and two Yb171 atoms, we calibrate
the scattering lengths $a_{\pm}$ with respect to anti-symmetric and symmetric
nuclear-spin states to be $a_{+}=2012(19)a_{0}$ and $a_{-}=193(4)a_{0}$ for
Yb173, and $a_{+}=232(3)a_{0}$ and $a_{-}=372(1)a_{0}$ for Yb171.
