my previous gravity sim was in real world SI/metric units and all that, but this time around, i decided to work in "simulation units", which i call ud, ut, and um (unit distance, unit time, unit mass). so every object in my simulation has mass 1 um, each time step is 1 ut, and the entire simulation fits in a box of size 1 ud by 1 ud.

then (in theory, haven't tested this yet), the only thing i have to change about my sim is to convert the gravitational constant from metric units to sim units.

` ud_over_m = size `

ut_over_s = timestep

um_over_kg = (density*size**2) / nbodies

gravity_u = gravity * (um_over_kg * ut_over_s**2) / ud_over_m**3

which comes out to roughly 4e-16 right now

high school "dimensional analysis" practice really came in handy here

the only tricky point is that i'm trying to simulate cosmological expansion as well, which means that the size of my universe is NOT constant, but since the size of my sim world is constant, this means ud_over_m and therefore the gravitational constant itself is... not constant