September 15, 2019, 06:10:32 AM
Forum Rules: Read This Before Posting


Topic: algorithm to calculate pH change in water using P2O5  (Read 519 times)

0 Members and 1 Guest are viewing this topic.

Offline david568

  • New Member
  • **
  • Posts: 3
  • Mole Snacks: +0/-0
algorithm to calculate pH change in water using P2O5
« on: May 31, 2019, 02:33:39 AM »
Hi everyone,
I'm trying to create a web application to calculate the amount of fertilizer needed to change the pH of irrigation water, however I'm not a chemist and even after few hours of studying the Hendersson equation I can not figure it out.

These are my input parameters:
- current water alkalinity (HCO3) in ppm
- current water pH
- target water pH

output should be:
- grams of P2O5
- target water alkalinity (HCO3) in ppm

I need to calculate how much fertilizer I need to add to get to the target pH. I would also like to know how much will the alkalinity drop. As an acid I am using a crystalline powder of water soluble P2O5.

Would you be so king and advise me on how to calculate it? I'm not a chemist but a programmer, so I understand a bit of math but not the chemistry behind it.

Thank you very much
Dave

Offline Borek

  • Mr. pH
  • Administrator
  • Deity Member
  • *
  • Posts: 25183
  • Mole Snacks: +1656/-397
  • Gender: Male
  • I am known to be occasionally wrong.
    • Chembuddy
Re: algorithm to calculate pH change in water using P2O5
« Reply #1 on: May 31, 2019, 03:03:44 AM »
I am not convinced knowing alkalinity is enough to solve the problem in the general case. Alkalinity tells us how much acid needs to be added to reach some predefined pH, but doesn't tell much about the solution behavior before and after that point, and as your target pH is different from this predefined pH we don't know what will happen when we add more acid.

Understanding how to do the general pH calculations (compare http://www.chembuddy.com/?left=pH-calculation&right=toc) will definitely help.
ChemBuddy chemical calculators - stoichiometry, pH, concentration, buffer preparation, titrations.info, pH-meter.info

Offline david568

  • New Member
  • **
  • Posts: 3
  • Mole Snacks: +0/-0
Re: algorithm to calculate pH change in water using P2O5
« Reply #2 on: May 31, 2019, 03:53:39 AM »
Thank you very much for your reply.
As I understand it, the primary solution is plain water and acts like a buffer solution. In the field, we measure the input parameters - pH with pH meter and CaCO3 with water hardness meter.

Also the fertilizer we are using as an acidifier transforms to H3PO4

I am not sure, which other parameters would be necessary?

Thanks for your patience with me:-)

Offline Borek

  • Mr. pH
  • Administrator
  • Deity Member
  • *
  • Posts: 25183
  • Mole Snacks: +1656/-397
  • Gender: Male
  • I am known to be occasionally wrong.
    • Chembuddy
Re: algorithm to calculate pH change in water using P2O5
« Reply #3 on: May 31, 2019, 06:03:18 AM »
the primary solution is plain water and acts like a buffer solution

Plain water is never a buffer - what makes solution a buffer is the presence of dissolved substances. Not knowing their exact composition you can't predict exact pH changes when the acid is added.

Alkalinity tells you how much acid needs to be added to neutralize most of the bases present. But the same alkalinity can mean infinitely many different compositions of the bases, and doesn't tell anything about what bases are left in the solution.

You can assume solution is dominated by carbonate alkalinity and ignore presence of other bases - that would give a reasonably accurate predictions of what will happen when you add more acid. But it will be still an approximation only.
ChemBuddy chemical calculators - stoichiometry, pH, concentration, buffer preparation, titrations.info, pH-meter.info

Offline david568

  • New Member
  • **
  • Posts: 3
  • Mole Snacks: +0/-0
Re: algorithm to calculate pH change in water using P2O5
« Reply #4 on: May 31, 2019, 08:29:09 AM »
Quote
You can assume solution is dominated by carbonate alkalinity and ignore presence of other bases

That is exactly what I was thinking - that is enough for me, because the water we are using  is mostly from wells - and that water is hard (caused by Ca‎(HCO3)2 ?) The calculations do not have to be too precise, it is meant for large agriculture - irrigated fields, vineyards etc.

My thougt process was like this:
original pH = 8
target pH = 6
original alkalinity 200 ppm HCO3 (I calculated the concentration to 0.0033 M)

having the Hendersson equation ph = pKa + log([A]/[HA]) I wanted to calculate the [HA] of the water and since there is CaCO3 as acid I used the pKa 9

8 = 9 + log(0.0033/[HA]) -> [HA]=0.033

So now I suppose  I have the concentration of the conjugate base.

If I use the same equation, but with my target pH, pKa of acidifier H3PO4 (7,21) and [HA] I just calculated, do I get the concentration of the acidifier I must add to get to the target pH?
Or am I getting it all wrong? :-)

Thanks

Offline Borek

  • Mr. pH
  • Administrator
  • Deity Member
  • *
  • Posts: 25183
  • Mole Snacks: +1656/-397
  • Gender: Male
  • I am known to be occasionally wrong.
    • Chembuddy
Re: algorithm to calculate pH change in water using P2O5
« Reply #5 on: June 01, 2019, 03:47:50 AM »
This is still not trivial, especially if the target is pH around 7.

You can safely assume first proton of the phosphoric acid is fully used to lower the pH. But pKa2 of phosphoric acid is 7.2, and pKa1 of carbonic acid is 6.4 - that means you will have an equilibrium involving H2PO4-, HPO42-, H2CO3 and HCO3-. This will be tricky to solve approximately, using just the Henderson-Hasselbach equation.

I am afraid you will need to dig deeper into the lectures I linked to earlier.
ChemBuddy chemical calculators - stoichiometry, pH, concentration, buffer preparation, titrations.info, pH-meter.info

Sponsored Links