Posts

Showing posts with the label Jsconsole

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 * v...

Electron Motion in a Electric Field

⚛️ Electron Motion in an Electric Field — Simulated in JavaScript What happens when an electron is fired horizontally across an electric field? This JavaScript code simulates that motion and shows how acceleration, velocity, and field strength interact — all calculated step by step! JavaScript Code: (() => { // ⚛️ Electron Properties const masselectron = 9.10938e-28; // g const chargeElectron = 4.8032e-10; // statC // ๐Ÿš€ Initial Conditions const horizVel = 1e09; // cm/s const horizDist = 2.0; // cm const downwardAcc = -1e17; // cm/s² // ⏱️ Time to travel horizontal distance const timeReqd = horizDist / horizVel; console.log(`⏱️ Time taken by electron to travel ${horizDist} cm: ${timeReqd.toExponential(2)} s`); // ๐Ÿ“‰ Vertical motion due to electric field const vertDist = 0.5 * downwardAcc * timeReqd ** 2; const vertVel = downwardAcc * timeReqd; // ⚡ Electric field calculation const electricField = Math.abs(downwardAcc) * masselectron / chargeE...