of the disk. In the case of the Solar System, Uranus and Neptune may have been gravitationally scattered onto larger orbits by close encounters with Jupiter and/or Saturn. Systems of exoplanets can undergo similar dynamical instabilities following the dissipation of the gas disk that alter their orbits and in some cases result in planets being ejected or colliding with the star. Planets scattered gravitationally can end on highly eccentric orbits with perihelia close to the star, enabling their orbits to be altered by the tides they raise on the star. The eccentricities and inclinations of these planets are also excited during these encounters, providing one possible explanation for the observed eccentricity distribution of the closely orbiting exoplanets. The resulting systems are often near the limits of stability. As in the Nice model, systems of exoplanets with an outer disk of planetesimals can also undergo dynamical instabilities following resonance crossings during planetesimal-driven migration. The eccentricities and inclinations of the planets on distant orbits can be damped by dynamical friction with the planetesimals with the final values depending on the relative masses of the disk and the planets that had gravitational encounters. Tidal migration Tides between the star and planet modify the semi-major axis and orbital eccentricity of the planet. If the planet is orbiting very near to its star, the tide of the planet raises a bulge on the star. If the star's rotational period is longer than the planet's orbital period the location of the bulge lags behind a line between the planet and the center of the star creating a torque between the planet and the star. As a result, the planet loses angular momentum and its semi-major axis decreases with time. If the planet is in an eccentric orbit the strength of the tide is stronger when it is near perihelion. The planet is slowed the most when near perihelion, causing its aphelion to decrease faster than its perihelion, reducing its eccentricity. Unlike disk migration – which lasts a few million years until the gas dissipates – tidal migration continues for billions of years. Tidal evolution of close-in planets produces semi-major axes typically half as large as they were at the time that the gas nebula cleared. Kozai cycles and tidal friction A planetary orbit that is inclined relative to the plane of a binary star can shrink due to a combination of Kozai cycles and tidal friction.