# A Nitrate/Water Change Calculator...



## tonyh67 (Jul 19, 2008)

I've been wanting to learn some Javascript, so I decided to write something that would be useful in my aquarium hobby. The result is a "Nitrate/Water Change Calculator". Basically, it shows some water change schedule options to maintain a given nitrate target. It also gives you an idea of how long it will take to get from your current nitrate value to a target nitrate value. Try it out and let me know what you think. You can find it here: http://www.fewpb.net/~ajhenderson/. Be sure to click "help/info" for further details about the calculator. If there's interest, I may add some features and additional reports. It's also very plain right now. I may spruce it up soon.

I haven't tested it extensively, so there may be some bugs. Please let me know if you find any. Thanks.


----------



## smellsfishy1 (May 29, 2008)

Is this a legit calculator? If so, it is absolutely amazing! It just so happens for my tank it is on point. Has anyone else tried this or find it accurate?


----------



## Cruiser (Aug 1, 2008)

It's fairly simple math when you think about it. If you have nitrates at 40ppm and you change 50% of the water your nitrates should drop by half if you have 0ppm water going back in. It changes a bit if you have nitrates in your tap water but still fairly easy math.

I'm getting an error saying "source nitrate must be less than target nitrate" when I use 40 as my target and 5 as the source water value (just to test). I don't see anything glaringly obvious in the javascript so it might just be me. :lol:

Nice little calculator for the less math inclined. :thumb:


----------



## tonyh67 (Jul 19, 2008)

Cruiser - You found a bug. Thanks for your input. Oddly enough, if you tried 4 or 6 for source nitrate it works fine, but flakes out with a 5. It has to do with the way javascript treats values in the text boxes as text, not numbers. It's fixed now.

The math involved isn't advanced calculus by any means, but it can get a little more complex than your example. If my formula is correct, you can figure your "nitrate equilibrium" for any water change schedule, if you know your rate of nitrate rise. What I'm calling "nitrate equilibrium" is the point at which your nitrate values remain steady as you continue your water changes. At equalibrium, there's a minimum nitrate value (just after water changes), and a maximum nitrate value (just before water changes). The formula to find the equilibrium is:

MaxNitrates = (NitrateRiseBetweenWaterChanges / WaterChgPercentage) + SourceNitrates

MinNitrates = MaxNitrates - NitrateRiseBetweenWaterChanges

If you know your weekly nitrate rise, you have to convert it to "NitrateRiseBetweenChanges" with some multiplication and division if your schedule is anything other than once a week. Your current nitrate value will rise or fall over time until it reaches the equilibrium point, then it will stay within the min and max. It's a matter of how long it will take to reach equilibrium and how high or low will that equilibrium be. Those are the questions that this calculator hopefully answers. This of course assumes that you continue with the same water change schedule and that your nitrate rise rate remains the same. However, your nitrate rise rate is likely to change as changes occur in your aquarium, which is one of the reasons we are constantly testing our nitrates.


----------



## Cruiser (Aug 1, 2008)

Yeah, I didn't mean it as any kind of complete explanation, just a quick example for smellsfishy (who I thought may have found it useful). I dabble with a bit of web design on the side (I'm a college student by day) but my javascript is rather lacking.

Thanks for the broader explanation.


----------



## smellsfishy1 (May 29, 2008)

I guess I need to word this better. The fact that it gives an exact percentage is what I really liked about it. I figured my nitrates long ago and figured roughly how much needed to be changed. Maybe not exact but close enough and this calculator was right where I do my water changes. I wish something like this was available to me years ago when I didn't understand nitrates and water changes and how they build up. This should be given to anyone trying to manage nitrates.


----------



## tonyh67 (Jul 19, 2008)

Thanks for the complements. I hope others find it useful as well. Just keep in mind that this shows the amount of water that needs to be changed just to meet a specific nitrate target. Many people have good reasons to change more water than this calculator will suggest.


----------



## smellsfishy1 (May 29, 2008)

Much props tony


----------



## dreday (Oct 12, 2007)

yes very nice. although i dont know my rise in nitrates per week. i dont test them anymore. i just do 2x 40-50% a week. i only test for new tank setups which i have one going now so i will see how accurate it is. :thumb:

gj :fish:


----------



## riffraffxl (Aug 2, 2007)

Seems to work. The numbers agree with my own calculations and experiences with my show tank...great tool you've made!


----------



## jcushing (Apr 6, 2008)

nice tool, it gets confusing like in my case when i have 5ppm in my tap water and i try to keep nitrates in the 20 range...


----------



## smellsfishy1 (May 29, 2008)

Hey dreday, how long have you been doing those 40-50% water changes 2x/week and are you treating the water and letting it bubble over night or do you just add treatment with straight from the tap water?


----------



## tonyh67 (Jul 19, 2008)

smellsfishy1 said:


> Hey dreday, how long have you been doing those 40-50% water changes 2x/week and are you treating the water and letting it bubble over night or do you just add treatment with straight from the tap water?


I'm curious about this too. I'm adding some baking soda and marine salt to raise/maintain pH, GH and KH for an African rift tank. The tank has only been going for about 5 weeks. Last night I did a 30% water change. I mixed the amount of baking soda, marine salt, and dechlorinator I would need with water in a styrofoam cup. I slowly poured the cup in as I added new water with my python. Anybody else do it this way? Any other way to do it, other than premixing everything in buckets?


----------



## smellsfishy1 (May 29, 2008)

Hey Tony I hate to burst your bubble but I don't think adding that mix is cost effective anymore. I used to add that same buffer mix but since I started doing w/c's every other day at 25% I used all my supplies in a month. I just let my fish gradually get used to the way the water is out the tap(add dechlor) which isn't too bad( 7.4 pH and 5 GH). If I don't my nitrates are through the roof.They sit at 30-40 ppm.


----------



## tonyh67 (Jul 19, 2008)

Really? I just don't see how it could get that expensive. Baking soda is dirt cheap. Marine salt is a bit more expensive, but I'm using between 1/2 and 1 tsp per gal while saltwater keepers use many times that much. Besides, if I decide I want to cut costs I could switch from marine salt to non-iodized table salt. Either way I'm not worried about cost, I'm just curius if the way I add it while I'm filling the tank with a python is safe.


----------



## dreday (Oct 12, 2007)

well i have a sump so i just add it there when it is off. then do WC and when i turn it back on most of the stuff is already dissolved.

when i didnt have sump i used the cup method. added the baking soda, and salt and stirring to let dissolve. then add it in with new water.

i am only on my second box of baking soda too. it has been 1 year since i had a malawi tank running. i only add about 1 teaspoon for about 30g. my tap water is pretty hard(have not tested exactly) and the ph is 7.5-7.6. so i add just a little to bump it to around 7.9-8.0. i add mostly Epsom and aquarium salt.

but i do like smellyfish which is try to use as close to tap water as you can. the fish will be ok with slightly lower ph, as long as you can keep it stable. so long run of 7.6 is better than fluctuating 8.2- 7.8. :thumb:


----------



## smellsfishy1 (May 29, 2008)

Yeah that's how I used to do it. It doesn't matter how you do it as long as the pH doesn't change too much right away. The best thing about what you're doing is it buffers the water so you wouldn't change the chemistry too much after the water change.


----------



## vfc (Feb 13, 2007)

I did a similar nitrate calculator using Excel.








[/URL][/img]


----------

