code: def calculate_energy(self):
          
          clibrebound.reb_tools_energy.restype = c_double
          return clibrebound.reb_tools_energy(byref(self))
docs: Returns the sum of potential and kinetic energy of all particles in the simulation.