| THEORY & FORMULAE |
In chemistry and manufacturing, electrolysis is a method of separating bonded elements and compounds by passing an electric current through them. Faraday's laws state that a) The amount of any substance dissolved or deposited in electrolysis is proportional to the total electric charge passed, and b) The amounts of different substances dissolved or desposited by the passage of the same electric charge are proportional to their equivalent weights.
For example, in the electrolysis of molten sodium chloride, NaCl, one faraday, or one mole, of electrons is transferred at the cathode to one mole of sodium ions, Na+, to form one mole of sodium atoms, Na (valence number = 1), while in the electrolysis of molten magnesium chloride, MgCl2, two faradays of electrons must be transferred at the cathode to reduce one mole of magnesium ions, Mg2+, to one mole of magnesium atoms, Mg (valence number = 2). Valence number of silver is 1, zinc is 2 and iron is 3.
Mathematically, the laws can be expressed as:
   m = [QM]/[Fn] = [ItM]/[Fn]
where
     m = mass of the substance produced at the electrode (in grams)
     n = valence number of the substance as an ion in solution (electrons per ion)
     M = molar mass of the substance (in grams per mole)
     F = Faraday's constant = 96,485 coulombs
     Q = total electric charge that passed through the solution (in coulombs)
     t = time interval of current flow
     I = average of electrical current flow, amp
◊ Use link
EXAMPLE Of Input/Output
to demo data entry expectations and results; you may edit & use it as starting point