Elaboration of collisional–radiative models for flows related to planetary entries into the Earth and Mars atmospheres