Skip to content

Commit

Permalink
πŸ”‹ improved Galvanic Cells
Browse files Browse the repository at this point in the history
  • Loading branch information
harirakul committed Dec 18, 2020
1 parent ee7e935 commit 5ff1ad8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chemlib/electrochemistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
REDUCTION_POTENTIALS = REDPOTS = {
"Ba": (-2.90, 2),
"Ca": (-2.87, 2),
"Na": (-2.71, 2),
"Mg": (-2.37, 2),
"Al": (-1.66, 3),
"Mn": (-1.18, 2),
"Zn": (-0.76, 2),
"Fe": (-0.44, 2),
"Cd": (-0.403, 2),
Expand Down Expand Up @@ -43,7 +45,7 @@ def __init__(self, electrode1: str, electrode2: str) -> None:
self.cathode = (e2, REDPOTS[e2])

self.electrodes = (self.anode, self.cathode)
self.cell_potential = self.E0 = self.cathode[1][0] - self.anode[1][0]
self.cell_potential = self.E0 = round(self.cathode[1][0] - self.anode[1][0], 3)
self.line_notation = f"{self.anode[0]} | {self.anode[0]}{self.anode[1][1]}+ || {self.cathode[0]}{self.cathode[1][1]}+ | {self.cathode[0]}".replace("1", '')
endings = ["2SO4", "SO4", "2(SO4)3"]
self.anode_soln = f"{self.anode[0]}{endings[self.anode[1][1] - 1]}"
Expand Down

0 comments on commit 5ff1ad8

Please sign in to comment.