Normality Calculator for Standard Acids
๐งช Normality Calculator for Standard Acids — in JavaScript
This JavaScript snippet helps calculate the normality of standard acid and base solutions and also computes the weight of acid required for a specific volume and normality. Useful for students and lab chemists!
JavaScript Code:
(() => {
const avogadro = 6.02214076e23;
const standardAcids = [
{ name: "Hydrochloric Acid", symbol: "HCl", molwt: 36.45384, basicity: 1 },
{ name: "Sulfuric Acid", symbol: "H2SO4", molwt: 98.079, basicity: 2 },
{ name: "Nitric Acid", symbol: "HNO3", molwt: 63.01, basicity: 1 },
{ name: "Potassium Hydrogen Phthalate", symbol: "KHP", molwt: 204.22, basicity: 1 },
];
function normality(molwt, eq, wtgm, volcc) {
return (wtgm / molwt) * eq * 1000 / volcc;
}
function wtReqdNormalityAcid(molwt, basicity, norm, volreqd) {
const equiWt = molwt / basicity;
return equiWt * norm * volreqd / 1000;
}
const baseSymbol = "NaOH";
const molwtBase = 39.99663928;
const weightBaseTaken = 2; // g
const volumeSolBase = 500; // mL
const equiVBase = 1;
const normBase = normality(molwtBase, equiVBase, weightBaseTaken, volumeSolBase);
const volBaseTaken = 20; // mL
console.log(`๐ฌ Alkali: ${baseSymbol} | Amount Taken: ${weightBaseTaken} g | Volume Prepared: ${volumeSolBase} mL`);
console.log(`๐งช Normality of ${baseSymbol} solution: ${normBase.toFixed(2)} N\n`);
const reqNormality = 0.1; // N
const reqVolMls = 1000; // mL
console.log(`๐ Acids required to make ${reqNormality} N solutions (1L):\n`);
for (const acid of standardAcids) {
const { name, symbol, molwt, basicity } = acid;
const amtAcid = wtReqdNormalityAcid(molwt, basicity, reqNormality, reqVolMls);
console.log(`๐น Acid: ${name} (${symbol})`);
console.log(` ➤ Amount Required: ${amtAcid.toFixed(5)} g\n`);
}
console.log(`\n๐งช๐ Example: Using Functions Independently\n`);
const nNaOH = normality(40, 1, 2, 500);
const nHNO3 = normality(63.01, 1, 6.3, 1000);
console.log(`✅ Normality of NaOH: ${nNaOH.toFixed(2)} N`);
console.log(`✅ Normality of HNO3: ${nHNO3.toFixed(2)} N`);
const wtH2SO4 = wtReqdNormalityAcid(98.079, 2, 0.2, 500);
console.log(`✅ H2SO4 required for 0.2 N, 500 mL: ${wtH2SO4.toFixed(3)} g`);
})();
๐ง Key Takeaway: This script helps you quickly calculate either the normality of a solution or the weight of an acid needed for a desired volume and strength. Great for lab preparations and titrations!
Comments
Post a Comment
Dear Readers, feel free to give your opinion but in a nice way.