Calculator: Vampire GrowthPreamble
If Buffy kills vampires, at what rate would she need to kill them to preserve the balance?
Would vampires go extinct? Would Buffy prevail? Does she even have a chance?!
You can check "Activate Buffy!" to include Buffy slaying vampires in the calculation.
The case where there is an equilibrium between the number of vampires created, and the number destroyed.
The balance between good and evil is preserved!
Final population of vampires = StartingPopulation * eGrowthFactor * Time
However, we calculate the results per day, in incremental steps, so using the exponential function makes no sense. Instead, we break it apart:
For each day, we check whether we reached the timeframe for either vampires siring others, buffy eliminates vampires, or vampires are immigrating in.
If we reach the timeframe for either, we add or remove accordingly:
- For vampire growth, when the number of days is reached, we add a multiplication of the population growth: population = population + ( population * vampiresEachSires )
- For Buffy's slaying, when the number of days is reached, we remove however many vampires she's slain: population = population - slainVampires
- For vampire immigration, when the number of days is reaced, we add the number of arriving vampires: population = population + newVampires
The combined result, per day, is the stored and presented in the graph.
Thanks, Credits, and Corrections
It's super exciting to see the awesome reception for this tool!
A number of people have pointed out some bugs and errors in the code or calculations that resulted in changes:
- The initial calculation was ovredoing the exponentiation, and the results appeared exaggerated. This was fixed.
Thanks a bunch to Lee Biernbaum for noticing! - Inputs had a bad way of falling-back if there was no data, which basically made choosing 0 impossible. This was fixed.
Huge thank you to Jeffrey Lovitz for finding this and submitting a pull request! - Added a string representation of numbers of ten to make big numbers understandable. Thanks to @krainboltgreene for the idea! (Also, to Joe Matazzoni and Alex Ezell who suggested a similar feature)
Did you spot an issue? A problem with the code, or the calculation? Do you have an idea I should add in to this calculator, or create any other calculators?
You can submit an "issue" on Github, contact me directly by sending me a note, or say hi on twitter (@mooeypoo)