Embody


Metrics Module

Functions and values

Function or value Description

calculateTotalEnergy preset step G

Full Usage: calculateTotalEnergy preset step G

Parameters:
Returns: float<MeasureProduct<MeasureInverse<MeasureProduct<'t, MeasureProduct<'t, MeasureProduct<'t, 't>>>>, MeasureProduct<MeasureProduct<'l, MeasureProduct<'l, MeasureProduct<'l, MeasureProduct<'l, 'l>>>>, MeasureProduct<MeasureInverse<'m>, MeasureOne>>>>

Calculate total energy (TE) of an n-body system. TE is the sum of kinetic energy (KE) and potential energy (PE). On its own, system's energy doesn't say much. However, difference between current TE and initial TE can serve as a metric of simulation's quality. TE should stay constant in a closed system, and any deviation could be considered an error.

preset : SimulationPreset<'l, 't>
step : IntegratorStep<'l, 't>
G : float<'m>
Returns: float<MeasureProduct<MeasureInverse<MeasureProduct<'t, MeasureProduct<'t, MeasureProduct<'t, 't>>>>, MeasureProduct<MeasureProduct<'l, MeasureProduct<'l, MeasureProduct<'l, MeasureProduct<'l, 'l>>>>, MeasureProduct<MeasureInverse<'m>, MeasureOne>>>>