I'm trying to find a function that finds the net profit gain over multiple iterations. For example, if I produce a unit for 5 dollars , and can sell it for 8 dollars, I would have a net gain of 3 dollars per unit. However, let's say I have 50,000 dollars as a loan (for theory sake I don't have to repay it) - I can produce 10,000 units at a total profit of 30,000 dollars, which then means I have 80,000 dollars. I would then re-invest this ENTIRE quantity into producing far more units than originally (I would then be creating 16,000 units which would result in a re-investment of 128,000 dollars) and so on and so forth.
I'm assuming a perfect system where there's no price fluctuations on the sell price as well as no additional costs.
So far I can calculate the total profit of one cycle of the system, but other than that I have absolutely no idea where to start.