Computing the spectra of supernovae at the photospheric phase requires detailed modeling of nonequilibrium atomic level populations in a rapidly expanding envelope. We consider the fundamental problem of interpreting the observed spectra through the solution of a highly stiff system of time-dependent kinetic equations in an expanding envelope, where the characteristic time scales of atomic processes differ from the hydrodynamic time scale by many orders of magnitude. Based on the analysis of a singularly perturbed system, we introduce a heuristic rule for the selective deactivation of sparsely populated levels, reducing the dimension of the system and the computational cost without any loss of accuracy. An extremely large scatter of characteristic process time scales leads to a numerical instability that manifests itself as nonphysical negative populations and a ‘‘jump’’ to a false solution. We present a modified fourth-order Rosenbrock method supplemented by a correction procedure that guarantees the positivity of the solutions based on the works of Goldin and Kalitkin. This correction acts as a specialized step controller, automatically preventing the choice of too large integration steps that lead to an instability. The method is implemented in the LEVELS code and has been tested on the type II-P supernova SN 2018aoq. We show that the hybrid approach stably integrates a system of more than 1500 equations and allows the observed optical spectra to be satisfactorily reproduced, making it possible to refine the hydrodynamic explosion parameters based on spectroscopic data.
M. Sh. Potashov (Wed,) studied this question.