chemistry · MIT License
Overview
Calculate reaction or cell potential from E0, temperature, electron count, and reaction quotient using the general or 298 K Nernst form.
- Not calculator tested
- Downloaded 36 times
- Version 1.0.0
- 944 bytes
- Uses math
Tried it? Did this program work on your calculator?
Before you run it
- TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
- TI Connect CE .py transfer is the intended path; calculator OS, Python App, transfer, and execution have not yet been tested for this release
- E0, Q, and n refer to the same balanced reaction and electron-transfer convention.
- Concentrations or partial pressures approximate activities only when that course approximation is appropriate.
- T, n, and Q are positive; the 0.0592 V shortcut is fixed to approximately 298 K.
Try the DuckieDai calculator screen
Follow the same opening, solve menu, prompts, validation, and result flow as the downloadable program.
TI-84 Plus CE Python · screen preview
Learn the math
How the Nernst equation works
The idea
A cell's voltage depends on the concentrations of what is reacting. The Nernst equation corrects the standard cell potential for conditions that are not standard.
When the reaction quotient Q is less than 1 the voltage is higher than standard; when Q is greater than 1 it is lower.
The formula
E = E0 - (R*T/(n*F))*ln(Q)
E = E0 - (0.0592/n)*log10(Q) at 298 K
E- cell potential under the stated conditions (V)
E0- standard cell potential (V)
n- moles of electrons transferred
Q- reaction quotient
T- temperature in kelvin
Using the program
- Choose 1 to enter any temperature, or 2 to use 298 K.
- Enter E0, the number of electrons, and Q.
- The program shows E, the size of the correction, and whether the cell is spontaneous.
Worked example
A zinc-copper cell has E0 = 1.10 V and transfers 2 electrons. With Q = 0.01 at 298 K, choose 2 and enter 1.10, 2, and 0.01.
E = 1.10 - (0.0592/2) x log10(0.01)
The program shows E volts = 1.1592 and Spontaneous cell.
Tips and common mistakes
- Q uses the same form as the equilibrium expression: products over reactants, leaving out solids and pure liquids.
- n comes from the balanced half-reactions, not from the coefficients alone.
- At equilibrium E is 0 and Q equals K.
Where this comes up
It appears in the electrochemistry unit of general chemistry, usually second semester, and in analytical chemistry. Biology and physiology courses use the same equation for membrane potentials.
Exact reviewed bytes
Source code
from math import logdef intro(n):print("+----------------------+");print("| "+n+" |");print("| ___(o )> quack! |");print("| by DuckieDai |");print("+----------------------+");input("ENTER to start: ")def num(s):while 1:try:return float(input(s))except:print("Enter a number")def pos(s):while 1:x=num(s)if x>0:return xprint("Must be positive")def pick():while 1:q=input("1 Any temp 2 298K: ")if q=="1" or q=="2":return qprint("Choose 1 or 2")intro("NERNST EQUATION")q=pick();e0=num("E0 volts: ");n=pos("Electrons n: ");Q=pos("Q: ")if q=="1":t=pos("Temp K: ");cor=8.314*t*log(Q)/(n*96485)else:cor=.0592*log(Q,10)/ne=e0-cor;print("E volts =",e);print("Correction =",cor)if e>0:print("Spontaneous cell")elif e<0:print("Nonspontaneous as written")else:print("At equilibrium")input("ENTER for guide: ");print("Q<1 raises E; Q>1 lowers E");print("DuckieDai: done!");input("ENTER to exit: ")
- Filename
nerns.py- Size
- 944 bytes
- SHA-256
57028fdd4585b6c2ba7bab533ea95c8d990a15e5b7dac74eaf37cbdea5504d1b
Usage
Inputs
- Standard potential E0 in volts
- Positive absolute temperature and positive integer electron count
- Positive dimensionless reaction quotient Q
Outputs
- Potential and logarithmic correction in volts
- Conditional cell-voltage interpretation
Units: Potential is volts, temperature is kelvin, Q is dimensionless and activity-based, R is 8.314 J/(mol*K), and F is 96485 C/mol.
Assumptions and limitations
Assumptions
- E0, Q, and n refer to the same balanced reaction and electron-transfer convention.
- Concentrations or partial pressures approximate activities only when that course approximation is appropriate.
Constraints
- T, n, and Q are positive; the 0.0592 V shortcut is fixed to approximately 298 K.
Known failures
- A half-cell potential alone does not establish overall cell spontaneity without a complete reaction convention.
- Using dimensional concentrations directly in Q or inconsistent reaction scaling changes the result.
Compatibility and review
- Review status
- Not calculator tested
- Tested on
- The owner reports personally testing the supplied archive programs on a calculator; exact model, OS, and Python App versions were not recorded
- What happened
- Owner reported interactive testing is disclosed, but the published bytes are not labeled independently calculator tested because the environment is unrecorded and Arrhenius received a narrow intake correction
- Dependencies
- math
- Suggested calculator name
NERNS— you can give it another valid, unique name when you transfer it- Desktop test cases
- Not available for this interactive-only source
This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.
Transfer and launch
Download the .py file, send it to your calculator with TI Connect CE as NERNS or another name, then open the Python App and try the worked example on this page first. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.
Version history
- 1.0.0 — current version, published . Download this reviewed version
Related learning
Did a DuckieDai program help with your homework? Every program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.
Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.
Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.