How does a diatomic molecule vibrate in response to heat?

Do you know of any applet/animation that shows how a diatomic molecule like $\ce{O2}$ or $\ce{N2}$ vibrate in response to/ to produce heat?

Can it vibrate only on one axis, the one joining the two atoms? What happens to the electrons during the vibration?

• That's the only degree of freedom available. Otherwise, you're probably coupling rotation with the vibration.
– Zhe
Dec 1, 2016 at 14:47
• It can vibrate only by extending and contracting the bond. The more energy that is added the bigger the bond excursion. (More vibrational levels are excited). The bond only extends by a few % of its length in lower vib levels so its pretty hard to see. If heaps & heaps of energy are added (temp say $1000$ K) then the bond can break as it is actually anharmonic in its motion. When this happens the atoms fly apart. Additionally the molecule can also rotate while it is vibrating. Rotation is slower than vibration so many vibrational periods occur within a $360$ degree rotation. Dec 1, 2016 at 19:05
• This post actually contains three questions, each of which would probably have benefited from being asked in individual posts. Dec 2, 2016 at 14:59

The diatomic can vibrate only by extending and contracting the bond. The more energy that is added the bigger the bond excursion. (More vibrational levels are excited and have bigger excursions). The bond only extends by a few % of its length in lower vibrational levels so its pretty hard to see. If heaps & heaps of energy are added (temp say $1000$ K) then in a real molecule the bond can break as it is actually anharmonic in its motion. When this happens the atoms fly apart.
Additionally the molecule can also rotate while it is vibrating. Rotation is a slower motion than vibration so many vibrational periods occur within a $360$ degree rotation.
Some of the energy can also be transferred as radiation, in the infra-red (for vibrations hundreds to a few thousand $\pu{cm^{-1}}$) and microwave region ( in the range few $\pu{cm^{-1}}$) for rotational transitions but only if the diatomic molecule has a permanent dipole, i.e. is not homonuclear. If these molecules are in equilibrium with surrounding then these surroundings must also emit/absorb radiation to keep the total energy constant. If you were to suddenly isolate your block of (heteronuclear diatomic) molecules, say in space, then the radiation emitted would over a few hours remove energy so that the molecules will end up in their zero point levels.
The figure shows the potential energy profile of HI. The the average length for the for the lowest level (quantum number $0$) is approx $106.4$ pm and the chnage due to vibration is about $\pm 10$ pm and clearly greater for higher vibrational levels. The vibrational period is $\approx 14$ fs.