A comet is little more than a "dirty snowball" of ice and dust until sunlight starts sublimating its surface. This simulation follows a comet nucleus on a real Keplerian orbit, venting jets of gas and dust that build a coma and split into a curved dust tail and a straight ion tail.
Solar heating sublimates ice directly from solid to gas, following a sublimation-rate curve that rises sharply inside a few AU for water ice but stays active much farther out for supervolatiles like CO and CO2. Escaping gas drags dust off the nucleus, and radiation pressure versus the solar wind sort that material into two physically distinct tails.
Adjust perihelion distance and eccentricity to reshape the orbit, and slide the ice-composition control between a volatile-rich and a water-ice-dominated nucleus. Watch the outgassing rate, coma, and both tails grow near perihelion and fade near aphelion; drag to orbit the camera and scroll to zoom.
ESA's Rosetta mission orbited comet 67P/Churyumov-Gerasimenko for two years and watched its jets switch on and sweep around as the nucleus rotated — exactly the sunward-vent behaviour modelled here.