Binary stars constitute a significant portion of the stars of a globular cluster.
I would like to verify that this is true in my $N$-body simulation, but I don't know how to decide whether a star in the system is a binary.
Visually this is easy to do, as binaries are identified as two stars at very close distance orbiting about their center of mass, but I need a mathematical condition which I can then translate to code.