stars on the main sequence produce energy by fusing hydrogen into
Main sequence After condensation of mass and ignition of a star, it generates thermal energy in the dense core region through nuclear fusion of hydrogen atoms into helium. During this stage of the star's lifetime, it is located along the main sequence at a position determined primarily by its mass, but also based upon its chemical composition and other factors. All main-sequence stars are in hydrostatic equilibrium, where outward thermal pressure from the hot core is balanced by the inward pressure of gravitational collapse from the overlying layers. The strong dependence of the rate of energy generation in the core on the temperature and pressure helps to sustain this balance. Energy generated at the core makes its way to the surface and is radiated away at the photosphere. The energy is carried by either radiation or convection, with the latter occurring in regions with steeper temperature gradients, higher opacity or both.
Pre-main-sequence star The energy source of PMS objects is gravitational contraction, as opposed to hydrogen burning in main-sequence stars. In the Hertzsprung–Russell diagram, pre-main-sequence stars with more than 0.5 M☉ first move vertically downward along Hayashi tracks, then leftward and horizontally along Henyey tracks, until they finally halt at the main sequence. Pre-main-sequence stars with less than 0.5 M☉ contract vertically along the Hayashi track for their entire evolution.