Page 1 of 1

Explanation required for 'AmmoniaConcentration' package in 'R'

Posted: Sat Apr 16, 2022 5:24 am
by Dhamnekar Winod
Description of 'AmmoniaConcentration' package in 'R'.

The total ammonia in aqueous solution is present in two chemical species: un-ionized ammonia,
NH3 , and the ionized form, NH4 +. The NH3 species is the one more toxic for aquatic organisms,
but current analytical methods do not permit measurement of NH3, and NH4 + separately. The
concentration of each chemical species in the total ammonia is dependent of a number of factors,
with the pH and the temperature being the most important.
The equation presented by Emerson et al. (1975) permits the calculation of the NH3 fraction from
the total ammonia measured in freshwater, as long as you also have the pH and temperature data
from the sample. The calculus first calculates the pKa, which is the ionization constant of the
ammonium ion. To calculate the pKa value of the sample, we use the equation:
pKa = 0.09018 + 2729.92/T
where T is the temperature in Kelvin.
To calculate the fraction of NH3 , we use the equation:
f = 1/(10(pKa − pH) + 1)
Note: the equation for pKa is invalid outside the temperature range of 0-50 C (273-323 Kelvin),
because is the range where the pKa values used to make the equation were obtained empirically.

Usage
ammonia(total_ammonia, temperature, ph, type_of_temperature)
Arguments
total_ammonia:- Total ammonia (NH3 + NH4) in the aqueous solution
temperature:- Temperature of the aqueous solution
ph:- pH of the aqueous solution
type_of_temperature:-Unit of measure of temperature, "K" for Kelvin, "C" for Celsius and "F" for Fahrenheit
Value
The function returns a list with all steps of the calculation. pka: the immunization constant; pka_ph:
the difference between pka and the informed pH; ten_pka_ph: 10 to the power of pka_ph; nh3: the
fraction of NH3; nh3_mgL: the concentration of un-ionized ammonia in the acqueous solution



We know that,

pKa = -logKa, pH = pKa + log (A-)/HA, Ka= (H+)(A-)/HA

Then,


How did the author derive the highlighted equations in the above description?

How to interpret the following answers using "AmmoniaConcentration" package in 'R' ?

> library("AmmoniaConcentration")
> ammonia(5.14, 294.4, 6.9, "K")
$pka
[1] 9.363006

$pka_ph
[1] 2.463006

$ten_pka_ph
[1] 290.4063

$nh3
[1] 0.003431634

$nh3_mgL
[1] 0.0176386

> ammonia(0.98, 27.7, 8.05, "C")
$pka
[1] 9.16873

$pka_ph
[1] 1.11873

$ten_pka_ph
[1] 13.14408

$nh3
[1] 0.07070098

$nh3_mgL
[1] 0.06928696