Solution (source code)

= Solution

A cold, self-gravitating region in a <molecular cloud> can collapse when <gravity> overcomes thermal, turbulent and magnetic support. Increasing central <density> produces a <protostar>, while radiation removes part of the released <gravitational energy>. The cloud initially carries <angular momentum>; material that cannot fall radially to the centre settles into a rotating <protoplanetary disk>. Collisions and cooling reduce random vertical motion, while angular-momentum transport allows some material to accrete and some to move outwards. Bipolar outflows and magnetic stresses can remove additional angular <momentum>.

The schematic sequence is $\text{rotating cloud}\to\text{protostar plus disk}\to\text{accreting solids and gas}\to\text{planetary system plus cleared disk}$. In the cool disk, grains condense and collide; settling and concentration can produce <planetesimals>, whose gravitational growth leads to planetary embryos. Massive cores may capture gas before the disk disperses; sufficiently massive unstable disks can also form bound condensations. Migration and interactions modify the final <orbits>. Radiation, accretion and outflows eventually disperse the remaining gas. Thus planet formation uses the same rotating reservoir produced by ordinary <star formation>, although the efficiency and final architecture are not universal and individual growth stages remain active research topics.