Not my formula and can't take the credit.
There was a shooter named Davenport who came up with it.
If you search "davenport formula" with the search function on this site you will read more than you would ever want to both for/against the formula :rotf:
I believe it works, others think it's non-sense.
It's based on calculating the available volume of the barrel and the consumption rate of black powder when ignited.
So the theory goes if you use every bit of available barrel space at the same exact time as you exhaust all the black powder, you achieve 100% efficiency - of course, in practical terms that will never happen - temperature, humidity, type and batch of powder etc will change things "a little".
Using less powder means the ball is trying to overcome friction (barrel) while it is no longer under accelerating power - more powder = some to a lot getting ejected from the end of the barrel somewhat after the ball has exited.
The formula has a few variables, but for quick reference with 45 cal it's 1.88 gr/inch. For a 50 cal it would be 2.25 gr/inch since the barrel has more "volume" (bigger hole), all else being equal.