gas of thickness d$r$ (Figure \[bate.model\]), surrounding the sphere from which the binary was formed, dividing the shell into small elements of gas, and calculating the effect that each element of gas has on the protobinary when it is accreted (using the results of Bate & Bonnell [@BatBon97]). The binary’s parameters (masses and separation) are updated, and the next shell of gas is considered until the whole cloud is accreted on to the binary. The amount of gas which settles into a circumbinary disc is also recorded. In this way, the code calculates the evolution of the binary from its initial to its final state when all of the original cloud’s gas is contained either in one of the two stars or their surrounding discs.

Testing the Protobinary Evolution Code
--------------------------------------

To test how accurately the PBE code describes the evolution of a ‘seed’ binary as it accretes from its initial to its final mass, the PBE results were compared to those from full SPH calculations. Two test cases were performed. The first followed the formation of a binary system from the collapse of an initially uniform-density, spherical molecular cloud core in solid-body rotation. The ‘seed’ binary was assumed to 