The Capture Theory for the origin of planetary systems, proposes that planets are formed following the fragmentation, and subsequent direct collapse, of a filament of material captured from a passing protostar. This thesis is concerned with developing existing numerical methods, to the point that this hypothesis may be tested with more confidence than previously possible. It is concluded that the original hypothesis of a quasi-statically contracting protostar is not conducive to planetary formation. A new type of encounter, ``tidal induced fragmentation followed by capture'', in which the protostar is collapsing more freely is suggested. In this new type of encounter, the whole of the approaching protostar is tidally drawn into a long thin filament, with properties such that it is Jeans critical, but within the Roche limit, at perihelion. As the filament leaves perihelion, its orbit takes it outside of the Roche limit, and it is able to fragment into several protoplanets, of which around a half are captured.
Several new advances in smoothed particle hydrodynamics (SPH) are presented: A fast method of enclosing an exactly constant number of particles within twice the smoothing length; a method of including a more physically realistic equation of state, which is also suitable for changes of state; and the development of an efficient second order integration scheme, with automatic time-step control. The major computational achievement of this thesis is the development of a robust radiation transport algorithm, ``tree radiation''. This algorithm is based on a Barnes-Hut tree, and uses a Monte-Carlo approach for transporting energy throughout the tree structure: The properties of SPH particles are interpolated onto the tree; energy is transported within the tree via a novel constrained random walk sampling scheme; the resultant change in energy is returned to the SPH particles.