An inverse P-Cygni profile of H 13 CO + (1 → 0) in G31.41+0.31 was recently observed, which indicates the presence of an infalling gas envelope. Also, an outflow tracer, SiO, was observed. Here, exclusive radiative transfer modelings have been implemented to generate synthetic spectra of some key species (H 13 CO + , HCN, SiO, NH 3 , CH 3 CN, CH 3 OH, CH 3 SH, and CH 3 NCO) and extract the physical features to infer the excitation conditions of the surroundings where they observed. The gas envelope is assumed to be accreting in a spherically symmetric system towards the central hot core region. Our principal intention was to reproduce the observed line profiles toward G31.41+0.31 and extract various physical parameters. The LTE calculation with CASSIS and non-LTE analysis with the RATRAN radiative transfer codes are considered for the modeling purpose. The best-fitted line parameters are derived, which represents the prevailing physical condition of the gas envelope. Our results suggest that an infalling gas could explain the observed line profiles of all the species mentioned above except SiO. An additional outflow component is required to confer the SiO line profile. Additionally, an astrochemical model is implemented to explain the observed abundances of various species in this source.