A stable and reliable algorithm is constructed for computing the internal field of a two—layer spherical particle with homogeneous core and radially inhomogeneous shell whose inhomogeneity profile is described by a power—law function. This model is intended for calculating the interaction of the electromagnetic wave with fractal clusters in the framework of the asymptotic cluster model.