Windfall Oil
Posted: Sun May 01, 2016 8:39 am
So I got curious about the math behind how pumpjacks and oil field yield work. Decided to math it out, based on the information on the wiki.
Information:
-Oil Fields have a yield value given as a percentage (e.g. 162% yield).
-Pumpjacks supply oil equal to that percentage in decimal form once each cycle, which unmodified by modules or less than full power, is 1 cycle/second. (e.g. the 162% oil field would supply 1.62 oil each cycle, which would be 1.62 oil/sec by default)
-Yield decreases by 1% every 75 cycles, but can never go below 10%, no matter how much oil has been produced from a given oil field, this works out to a minimum of 0.1 oil/cycle, which is 0.1 oil/sec at default rate.
That last bit is important, essentially, we can think of each oil field as supplying a fixed constant rate, at all times there is a pumpjack on it, which I will call the depleted rate. The depleted rate can be modified by modules or lack of full power. When first build on an oil field with greater yield, the pumpjack will be supplying additional oil until it has dropped the yield to the 10% minimum. The additional oil generated before depletion of the oil field is what I am calling windfall oil (it's a 'one time' boon from that oil field). One thing to note is that the amount of windfall oil is not affected by speed modules or lack of power because those change the rate by modifying the cycle time, hence the actual windfall oil production versus yield depletion ratio is unchanged. The question I got interested in is: What is the relationship between yield and windfall oil?
Assumptions:
For simplicity, we will assume that the decrease happens only once every 75 cycles, and not each cycle by a 1/75th a percent (this would change the numbers only slightly, but significantly complicate the math; and I am not sure how the game actually handles that internally).
Notation:
Let y denote the yield in percent form.
Let w denote the total windfall oil available.
How do we find w from knowing y? Consider as an example, an oil field with 11% yield (y=11). Then for the first 75 cycles, it will produce 0.11 oil/cycle, after which it will hit the minimum rate of 0.1/cycle. Subtracting the depleted rate from the total during those 75 cycles givens a windfall oil per cycle of 0.01 oil, which occurred 75 times (75 cycles), hence the windfall oil for an oil field with a yield of 11% is 0.75 oil.
What about a 12% yield oil field?
Here the first 75 cycles we are getting 0.02/cycle windfall oil, after that, another 75 cycles of 0.01/cycle windfall oil. Writing this as an equation, and simplifying, we obtain:
75*0.01+75*0.02=0.75*1+0.75*2=0.75*(1+2)
This hints at the general pattern.
Now consider an oil field of 15% yield. Here the equation looks like:
75*0.01+75*0.02+75*0.03+75*0.04+75*0.05=0.75*1+0.75*2+0.75*3+0.75*4+0.75*5=0.75*(1+2+3+4+5)
Now the pattern should be becoming clear: the factor of 0.75 is a constant, the part that changes is the the sum, which is the sum of the first y-10 natural numbers (15-10=5). Using the formula for the sum of the first n integers:
sum(1 to n)=n(n+1)/2
..and rewriting by substituting y-10 for n gives
sum=(y-10)((y-9)+1)/2=(y-9)(y-10)/2
Putting that in place of the sum part, and simplifying gives the formula for windfall oil:
Formula:
w=0.375(y-9)(y-10)=0.375y^2-7.125y+33.75
I recommend for simplicity, using the factored form, 0.375(y-9)(y-10)
Observations:
The first thing I found interesting about this formula is that windfall oil scales quadratically with yield value, this means that doubling the yield quadruples the amount of windfall oil available (technically it's doubling the yield minus 10 that does that, but close enough for practical purposes). Similarly quadrupling the yield increases the windfall oil by a factor of 16 (!) Also the time it takes to mine the windfall oil scales only linearly with yield value, so you get that quadruple windfall in only twice the time etc. The other interesting thing to do is actually calculate the windfall oil values for some benchmark yield values:
Some example yield to windfall oil conversions:
50% yield=615 windfall oil
100% yield=3071.25 windfall oil
150% yield=7402.5 winfall oil
200% yield=13,608.75 windfall oil
250% yield=21,690 windfall oil
300% yield=31,646.25 windfall oil
400% yield=57,183.75 windfall oil
500% yield=90,221.25 windfall oil
600% yield=130,758.75 windfall oil
700% yield=178,796.25 windfall oil
800% yield=234,333.75 windfall oil
900% yield=297,371.25 windfall oil
999% yield=367,166.25 windfall oil
Addendum:
In light of XKnight's comment pointing out that the decrease is per cycle afterall, here is the exact formula, where yield needs to be the exact value (not just the rounded value shown by the in-game tooltip; would probably need to use the console to get this more accurate value).
w=(75y-750)(75y-749)/15000
This gives exact windfall oil values (assuming the yield % stated is exactly accurate) of:
50% yield=600.2 windfall oil
75% yield=1584.7 windfall oil
100% yield=3037.95 windfall oil
125% yield=4959.95 windfall oil
150% yield=7350.7 windfall oil
175% yield=10210.2 windfall oil
200% yield=13538.45 windfall oil
250% yield=21,601.2 winfall oil
300% yield=31,538.95 windfall oil
350% yield=43,351.7 windfall oil
400% yield=57,039.45 windfall oil
450% yield=72,602.2 windfall oil
500% yield=90,039.95 windfall oil
600% yield=130,540.45 windfall oil
700% yield=178,540.95 windfall oil
800% yield=234,041.45 windfall oil
900% yield=297,041.95 windfall oil
999% yield=366,800.32 windfall oil
(1000% yield=367,542.45 windfall oil)
For values beyond 1000% yield, the pumpjack's oil generation is capped at 10 oil/cycle, hence the formula changes.
If y>1000, then
w=750(y-1000)+367,542.45
Which is linear growth in w as well as time to extract.
Information:
-Oil Fields have a yield value given as a percentage (e.g. 162% yield).
-Pumpjacks supply oil equal to that percentage in decimal form once each cycle, which unmodified by modules or less than full power, is 1 cycle/second. (e.g. the 162% oil field would supply 1.62 oil each cycle, which would be 1.62 oil/sec by default)
-Yield decreases by 1% every 75 cycles, but can never go below 10%, no matter how much oil has been produced from a given oil field, this works out to a minimum of 0.1 oil/cycle, which is 0.1 oil/sec at default rate.
That last bit is important, essentially, we can think of each oil field as supplying a fixed constant rate, at all times there is a pumpjack on it, which I will call the depleted rate. The depleted rate can be modified by modules or lack of full power. When first build on an oil field with greater yield, the pumpjack will be supplying additional oil until it has dropped the yield to the 10% minimum. The additional oil generated before depletion of the oil field is what I am calling windfall oil (it's a 'one time' boon from that oil field). One thing to note is that the amount of windfall oil is not affected by speed modules or lack of power because those change the rate by modifying the cycle time, hence the actual windfall oil production versus yield depletion ratio is unchanged. The question I got interested in is: What is the relationship between yield and windfall oil?
Assumptions:
For simplicity, we will assume that the decrease happens only once every 75 cycles, and not each cycle by a 1/75th a percent (this would change the numbers only slightly, but significantly complicate the math; and I am not sure how the game actually handles that internally).
Notation:
Let y denote the yield in percent form.
Let w denote the total windfall oil available.
How do we find w from knowing y? Consider as an example, an oil field with 11% yield (y=11). Then for the first 75 cycles, it will produce 0.11 oil/cycle, after which it will hit the minimum rate of 0.1/cycle. Subtracting the depleted rate from the total during those 75 cycles givens a windfall oil per cycle of 0.01 oil, which occurred 75 times (75 cycles), hence the windfall oil for an oil field with a yield of 11% is 0.75 oil.
What about a 12% yield oil field?
Here the first 75 cycles we are getting 0.02/cycle windfall oil, after that, another 75 cycles of 0.01/cycle windfall oil. Writing this as an equation, and simplifying, we obtain:
75*0.01+75*0.02=0.75*1+0.75*2=0.75*(1+2)
This hints at the general pattern.
Now consider an oil field of 15% yield. Here the equation looks like:
75*0.01+75*0.02+75*0.03+75*0.04+75*0.05=0.75*1+0.75*2+0.75*3+0.75*4+0.75*5=0.75*(1+2+3+4+5)
Now the pattern should be becoming clear: the factor of 0.75 is a constant, the part that changes is the the sum, which is the sum of the first y-10 natural numbers (15-10=5). Using the formula for the sum of the first n integers:
sum(1 to n)=n(n+1)/2
..and rewriting by substituting y-10 for n gives
sum=(y-10)((y-9)+1)/2=(y-9)(y-10)/2
Putting that in place of the sum part, and simplifying gives the formula for windfall oil:
Formula:
w=0.375(y-9)(y-10)=0.375y^2-7.125y+33.75
I recommend for simplicity, using the factored form, 0.375(y-9)(y-10)
Observations:
The first thing I found interesting about this formula is that windfall oil scales quadratically with yield value, this means that doubling the yield quadruples the amount of windfall oil available (technically it's doubling the yield minus 10 that does that, but close enough for practical purposes). Similarly quadrupling the yield increases the windfall oil by a factor of 16 (!) Also the time it takes to mine the windfall oil scales only linearly with yield value, so you get that quadruple windfall in only twice the time etc. The other interesting thing to do is actually calculate the windfall oil values for some benchmark yield values:
Some example yield to windfall oil conversions:
50% yield=615 windfall oil
100% yield=3071.25 windfall oil
150% yield=7402.5 winfall oil
200% yield=13,608.75 windfall oil
250% yield=21,690 windfall oil
300% yield=31,646.25 windfall oil
400% yield=57,183.75 windfall oil
500% yield=90,221.25 windfall oil
600% yield=130,758.75 windfall oil
700% yield=178,796.25 windfall oil
800% yield=234,333.75 windfall oil
900% yield=297,371.25 windfall oil
999% yield=367,166.25 windfall oil
Addendum:
In light of XKnight's comment pointing out that the decrease is per cycle afterall, here is the exact formula, where yield needs to be the exact value (not just the rounded value shown by the in-game tooltip; would probably need to use the console to get this more accurate value).
w=(75y-750)(75y-749)/15000
This gives exact windfall oil values (assuming the yield % stated is exactly accurate) of:
50% yield=600.2 windfall oil
75% yield=1584.7 windfall oil
100% yield=3037.95 windfall oil
125% yield=4959.95 windfall oil
150% yield=7350.7 windfall oil
175% yield=10210.2 windfall oil
200% yield=13538.45 windfall oil
250% yield=21,601.2 winfall oil
300% yield=31,538.95 windfall oil
350% yield=43,351.7 windfall oil
400% yield=57,039.45 windfall oil
450% yield=72,602.2 windfall oil
500% yield=90,039.95 windfall oil
600% yield=130,540.45 windfall oil
700% yield=178,540.95 windfall oil
800% yield=234,041.45 windfall oil
900% yield=297,041.95 windfall oil
999% yield=366,800.32 windfall oil
(1000% yield=367,542.45 windfall oil)
For values beyond 1000% yield, the pumpjack's oil generation is capped at 10 oil/cycle, hence the formula changes.
If y>1000, then
w=750(y-1000)+367,542.45
Which is linear growth in w as well as time to extract.