Understanding the evolution of galaxies is a fundamental but extremely complex topic in astrophysics. Cosmological hydrodynamical simulations have become powerful tools in this quest. Unfortunately, these simulations cannot resolve the physical processes at all scales, and important processes such as star formation feedback and AGN feedback are incorporated as sub-grid recipes. Molecular gas offers an excellent opportunity to observationally test the accuracy of these sub-grid physics recipes. Indeed, the molecular gas is directly affected by the feedback processes, and it can be traced observationally in different physical states through a variety of emission and absorption lines of the CO molecule. In this project, we will develop a novel and unique radiative transfer code that can generate synthetic CO observations for simulated galaxies. We will use this code to generate mock CO rotational emission line and rovibrational absorption line observations for a large suite of galaxies from the state-of-the-art TNG50 cosmological simulation. Comparing these mock data to observational data from Herschel, ALMA, AKARI, and Subaru, we will test the sub-grid recipes in TNG50, and determine the origin of CO excitation in different galaxies and different galactic regions.