Let's build the best (and free) mobile aquarium fertilizer calculator ever. - The Planted Tank Forum
 
LinkBack Thread Tools Display Modes
post #1 of 10 (permalink) Old 05-12-2011, 05:04 AM Thread Starter
wet
Algae Grower
 
PTrader: (2/100%)
Join Date: Dec 2008
Location: US
Posts: 113
Let's build the best (and free) mobile aquarium fertilizer calculator ever.

Want to help build the best mobile (and free) aquarium calculator, like, ever?

A proof of concept:

http://calc.petalphile.com/mobile

Try it out: Your suggestions are appreciated and any input here will go straight into development.

Nerds:

1) This uses the calc.petalphile.com REST API, which is not yet properly documented but opensourced here: https://github.com/flores/yet-anothe...ent-calculator In other words, feel free to make your own UI and I will support it!

2) It also uses JQuery-Mobile, which a coworker turned me onto yesterday. http://jquerymobile.com

3) If your like it, this will be pushed to ei.petalphile.com and dropcheck.petalphile.com

Thanks!
wet is offline  
Sponsored Links
Advertisement
 
post #2 of 10 (permalink) Old 05-12-2011, 11:14 AM
Algae Grower
 
PTrader: (0/0%)
Join Date: Sep 2008
Location: Rochester, NY
Posts: 34
Neat tool. Thanks for sharing. I like that you give the ranges on the result page for the different types of dosing.

Two suggestions:
1. It would be nice if everything wasn't spanning the entire screen
2. Maybe improve the error handling a little if you miss a field and hit "gimmie", you don't just see a "" with no explanation of what went wrong.

Signature
themainer is offline  
post #3 of 10 (permalink) Old 05-12-2011, 11:18 PM Thread Starter
wet
Algae Grower
 
PTrader: (2/100%)
Join Date: Dec 2008
Location: US
Posts: 113
Thanks themainer!

For 1, I actually do want the mobile site to span the entire screen because this is much more usable on iPhone, Android, Blackberry and so on.

However, I did add a link to the regular non-mobile-styled calculator, which you can also browse to here: http://calc.petalphile.com

For 2, added a simple error page. Will add specific errors and issues as I move forward with the API.

As suggestions are implemented and this calculator moves out of the current testing/mess-around with/initial learning stage, there will also be logic to send folks from mobile devices to the mobile site, standard browsers to the non-mobile site, as well as a mechanism for those folks to switch to whatever site they prefer.
wet is offline  
 
post #4 of 10 (permalink) Old 05-13-2011, 11:14 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
cool man,
as you know, I'm making an iphone fert app. I'm almost there
It's harder than you think.
I'm running into a calculation issue though with yours and the one over at aquaticplantcentral.

From your app:
Quote:
To reach your target of 5.0ppm PO4, you'll need to add 1.4916grams of KH2PO4 to 55.0 gal for:

Element ppm/degrees
K 2.06
P 1.63
PO4 5.00
According to my math (which could be wrong ), you're adding 1.4916 grams of PO4 not KH2PO4. I'm getting 2.105grams of KH2PO4.

here's my math.
Quote:
//target ppm is of PO4, targetMol is PO4's atomic weight ratio
mG = targetPPM * liter / targetMol;
This gives you 1.49grams ( or 1491.5 milligram) . You should add 'K' to this number which is .614 grams and I'm not accounting the H2..

Makes sense?

I might have to add the total mol to your data to make this accurate.

I'm looking to charge $.99 for my app to recover all of the costs making this
It looks pretty good and has a little photo gallery too. Oh, and you're mentioned in the credits.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #5 of 10 (permalink) Old 05-14-2011, 12:48 AM
Planted Tank Guru
 
plantbrain's Avatar
 
PTrader: (267/100%)
Join Date: Dec 2003
Location: The swamp
Posts: 13,609
For the aquarist that likes to drive and dose at the same time.




Regards,
Tom Barr
plantbrain is offline  
post #6 of 10 (permalink) Old 05-14-2011, 12:59 AM Thread Starter
wet
Algae Grower
 
PTrader: (2/100%)
Join Date: Dec 2008
Location: US
Posts: 113
mistergreen!

I actually didn't realize you were still developing your iphone app. I'll be one of your first customers! And thanks for the props! I'm excited to see what you've done.

I've some appreciation for the difficulty -- I work at a technology shop with a couple of applications, all of which were prototyped with Test Flight and PhoneGap before going native -- but you're right, I am no UI developer and find things like styling and design very challenging and unnatural to me. I hope you know that my testing these calculators on a mobile-friendly interface is simply for my personal/professional growth and curiosity while contributing back to our hobby for any device, and that my offer to collaborate with whatever I can on backend stuff stands! I will be making PhoneGap'd apps at some point in the future but will move forward with my other calcs so as not to compete with yours -- I really hope the best for your app and think you could charge a lot more than 0.99 for such a specialized application.

In regards to the calculation, I think my calc and APCs is right. Let's do it together (and for others doing this same thing manually):

Here's KH2PO4 broken down by atomic mass:
Code:
Stuff	Friendly name	Mass		Total in Stuff
K	Potassium	39.09831	1	 
H	Hydrogen	1.007947	2	
P	Phosphorus	30.9737622	1
O	Oxygen		15.99943	4
If we sum that up we get 136.0857 g/mol for KH2PO4.
If we sum up the PO4 bit we get 94.9715 g/mol

So, let's look at that data another way:
Code:
Stuff	Friendly name	Mass		% in KH2PO4
PO4	Phosphorus	94.9715 	0.6978801
K	Potassium	39.09831	0.2873065
H	The rest	2.015894	0.0148134
And focus on PO4 using your handy formula retitled a bit for folks following along:

mg KH2PO4 = target PPM of PO4 * tank liters / (g/mols of PO4 / g/mols of KH2PO4)
//target ppm is of PO4, targetMol is PO4's atomic weight ratio
mg = targetPPM * liter / targetMol

Target ppm is 5ppm. Each ppm is mg/L
We'll call a 55gallon tank 208.2 Liters.
PO4's atomic weight ratio to KH2PO4 is 0.698 (rounded):1

mg KH2PO4 = 5 * 208.2L / 0.698
1491.4mg of KH2PO4

But when you figure out how much K you're adding with that dose, it's not as if you're adding more KH2PO4. You're figuring out the K in that 1491 mg.

So:

resultingPPM = mg dose * targetMolRatio / L

the mg dose is the 1491.4 we just figured out.
The targetMolRatio this time for K:KH2PO4 is 0.287:1
resultingPPM is how much K we'll end up with.
and our tank's Liters have not changed.

resultingPPM = 1491.4mg * 0.287 / 208.2L
resultingPPM = 2.056 ppm K

Does that help?

If you're curious, my calc ends up holding what you call targetMolRatio by compound in memory (hashes of hashes by compound then element). I think you have this already, but you're welcome to the list. There's plenty of stuff in there that's UK or AS specific that's been contributed by request from other forums, for example, and I suspect will help with distribution of your app once it hits the apple store.
wet is offline  
post #7 of 10 (permalink) Old 05-14-2011, 01:36 AM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Thanks.
I rechecked the numbers in my half completed calculator. Looks like the numbers check out. If I plug in 1491.4 milligram of KH2PO4 into a 55G tank, I get K-> 2.058041ppm and PO4-> 4.9999327ppm

ok. looks like I'm on my way.

yeah, all of the ratios go into an array and what iOS calls a NSDictionary... It's basically an associative array.

My calculator is a bit different. You start out with a volume. This volume can be your tank or your solution.. Then when you find your target for the volume, you have the option to add this solution into another volume like a solution into a tank. The math should be easy.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #8 of 10 (permalink) Old 05-14-2011, 06:03 PM
Planted Tank Guru
 
Gatekeeper's Avatar
 
PTrader: (96/100%)
Join Date: Feb 2007
Location: Earth
Posts: 6,628
I just pm'd you Wet, but figure I would post it here too.

Could be me, but I found either an error with your calculator, or an error with the "Fertilator" on APC.

For Plantex, CSB+B

900 ml container
Dosing 30 ml
to achieve target goal of 0.1ppm in a 75 gallon tank

Your sheet says to add 3.4455grams to the 900 ml stock.


If you go to the Fertilator, and work backwards, they say with 3.4455 grams in 900 ml solution, you would need to dose 113.57ml to achieve 0.1 ppm in 75 gallon tank.

I may have screwed something up along the way, but just recheck your coding.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gatekeeper is offline  
post #9 of 10 (permalink) Old 05-14-2011, 06:43 PM
Planted Tank Guru
 
happi's Avatar
 
PTrader: (21/100%)
Join Date: Dec 2009
Location: Salt Lake City, UT
Posts: 3,139
Send a message via Yahoo to happi
Quote:
Originally Posted by plantbrain View Post
For the aquarist that likes to drive and dose at the same time.
gota use my car filter to keep the water clean if i ever add a fish tank in my car.

DIY Trace/Micro/Macro Recipe
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


DIY Trace/Micro/Calculation Etc
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
happi is offline  
post #10 of 10 (permalink) Old 05-17-2011, 11:47 PM Thread Starter
wet
Algae Grower
 
PTrader: (2/100%)
Join Date: Dec 2008
Location: US
Posts: 113
Hey Gatekeeper. I do believe something must have messed up along the way, because your results should have been about 13 grams of CSM+B into your stock solution.

There's been no changes to this calculation recently. So here's a couple of screenshots of the (non-mobile) calculator to ensure you're inputing what the calculator expects.

The input should look something like this:


And the output like this:


(the mobile interface is too long to capture on one screen. Something to consider for the next redesign...)
wet is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome