Math theory is fine, but I prefer experimental data.
My little homemade keg doesn't take a line and regulator, I use a sodastream cyclinder and car tyre valves to get the gas in and keep it in. Check the pressure with a car tyre pressure gauge. So here's what I do.
connect the valve up, couple of squirts from the sodatream = 30 - 40 psi
shake keg. Measure pressure again if down to lets say 8-10 psi, couple more squirts and repeat. When it wont drop below 10 psi anymore, I know that roughly the right amount of CO2 is dissolved into solution and I can taste test to see if I want it up or down from there.
4-5 repeats usually does the trick, maybe one more after a night in the fridge to settle in.
Repeat every now and again to keep it constant after I serve beer.

