We present an original algorithm in the MAPLE system for solving the scattering problem in single-channel approximation of the coupled-channel method of the optical model (OM) described by a second-order ordinary differential equation (ODE) with a complex-valued potential and regular boundary conditions. The complex-valued potential consists of the known real part, which is a sum of the nuclear potential, the Coulomb potential, and the centrifugal potential, and the imaginary part, which is a product of the unknown coupling constant g(E), depending on the collision energy E of a pair of ions, and the derivative of the real part of the known nuclear potential with respect to the ODE independent variable. The presented algorithm implements the solution of the inverse problem, i.e., calculates the unknown coupling constant g(E) and scattering matrix S(g(E), E) from condition | S(g(E), E) |2= 1 - | T(E) |2 by means of the secant method. The required amplitudes of transmission T(E) and reflection R(E) subject also to the condition | R(E) |2= 1 - | T(E) |2 of the model with incoming wave boundary conditions (IWBCs) are previously calculated by the standard MAPLE implemented KANTBP 4M program. The algorithm provides a one-to-one correspondence between the OM with a complex-valued potential and the model of IWBCs with a real-valued potential. The efficiency of the proposed approach is shown by solving numerically the scattering problem and calculating the reference fusion cross section for a pair of heavy ions16 O+144 Sm in the single-channel approximation of the close-coupling method. © 2023, The Author(s), under exclusive license to Springer Nature Switzerland AG.