Shape a comet orbit with perihelion distance, eccentricity and angles, then watch it swing round the Sun: speed, surface temperature and ice sublimation change with distance, and the coma and two tails grow near perihelion. Optionally let Jupiter and the giant planets tug on it.
Blue: log₁₀ of gas production in kg/s for this nucleus (the orange marker is the comet now); the surface temperature is in the readouts. The ice turns on steeply inside about 3 AU.
The science
Kepler orbit. Under the Sun's gravity (μ = k² = 2.959×10⁻⁴ AU³/day², k the Gaussian constant) an orbit with perihelion q and eccentricity e has semi-major axis a = q/(1−e) and period T = 2π √(a³/μ), i.e. T ≈ a3/2 years. Position follows from Kepler's equation M = E − e sin E (solved by Newton iteration) with r = a(1 − e cos E). The speed obeys v² = μ (2/r − 1/a) (vis-viva), so a comet at perihelion is faster than at aphelion by the factor (1+e)/(1−e), and the line to the Sun sweeps equal areas in equal times.
Numerical orbit. The comet is integrated with fourth-order Runge-Kutta and a step h = 0.02 √(r³/μ) that shrinks near the Sun; the check table compares it with the exact Kepler solution after a full period. Planet positions come from approximate J2000 mean elements.
Why a comet glows. At the sub-solar point the absorbed sunlight balances thermal emission and sublimation: (1−A) S₀/r² = ε σ T⁴ + L Z(T), with the vapour-pressure fit p(T) = 3.56×10¹² e−6142/T Pa, Z = p √(m/2πkT) and L = 2.83 MJ/kg. The surface temperature stays near 200 K at 1 AU while the sublimation rate rises by orders of magnitude from 5 AU to 1 AU. Gas production is Z times half the cross-section πR² of the nucleus (model value).
Tails. The ion (gas) tail is pushed straight away from the Sun by the solar wind. Dust grains feel radiation pressure, a fraction β of the Sun's gravity pointing outward, so they follow orbits with effective μ(1−β) and spread into a curved fan behind the comet (Finson-Probstein picture). Grain size, number and β range are illustrative.
Simplifications. Sun fixed (no barycentre motion), planets on fixed Kepler ellipses (their mutual pull ignored), planet pull applied to the comet only for Jupiter to Neptune, no non-gravitational jet forces, no fragmentation, uniform spherical nucleus, no rotation. Tail lengths and planet sizes are exaggerated and distances can be drawn compressed. Not an ephemeris. Models built with Blender, scene by Three.js.