Aquarium nitrogen cycle/Tank cycle

Aster Kubo

This is a basic simulation of the nitrogen cycle as it happens in a fish tank, of approximately ten gallons. 
You can control water changes by changing the percentage of water that is exchanged during each water change as well as the time interval of days between water changes.
You can change the feeding rate per fish to control how much food goes into the tank per day for each fish that is in the tank.
The max fish determines the maximum number of fish that you can have in the tank. The begin fish add value determines how many days to wait before adding fish.
Before fish are added, a fixed amount of fish food is added to the tank each day. Fish food and waste produced by any fish present degrade into ammonia. Nitrosomonas feed off of the ammonia and grow, and the nitrosomonas then oxidize the ammonia into nitrite. Nitrobacter feed of the nitrite and then oxidize it into nitrate. Ammonia, nitrite, and nitrate all reduce water quality. Water changes reduce all the chemicals in the tank by the percentage of water which is exchanged and increase the water quality by the same percentage. Once the time specified by begin fish add is reached, fish are added to the tank every 7 days. If the water quality drops enough, fish begin to die.
There are certain aspects that have not been included in this simulation due to the complexity they would involve. For instance, when cycling a tank you would typically not add fish food to the tank each day, or you might use a different source of ammonia entirely, such as a dead shrimp. In addition to this, if you do very large water changes this will shock the fish and can harm them. It is not advised to do very large water changes normally because of this, although it would keep the water quality higher.
Except for the fish, there are no real units for the values in the graphs. The values for chemicals represent about how much of each chemical there is respective to each other. Water quality is an abstract concept that we have no units for. The number of bacteria represents approximately how much the bacteria grows over time.