once a star produces enough heat from friction, it switches to this type of energy production: