Hidden WordScanner
Private scans · No account required

DuckieDai Henderson-Hasselbalch Equation

Solve pH = pKa + log10([A-]/[HA]) and its pKa, ratio, conjugate-base, and weak-acid rearrangements.

Version 1.0.0 · Not calculator tested

← Back to Calculator Program Library

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. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.

chemistry · MIT License

Overview

Solve pH = pKa + log10([A-]/[HA]) and its pKa, ratio, conjugate-base, and weak-acid rearrangements.

Usage

Inputs

  • pH and pKa as required
  • Positive conjugate-base and weak-acid concentrations in matching units

Outputs

  • Requested pH, pKa, concentration ratio, or component concentration

Units: pH, pKa, and [A-]/[HA] are dimensionless; component concentrations must use the same unit.

Assumptions and limitations

Assumptions

  • The solution behaves as a weak-acid/conjugate-base buffer and concentration ratio approximates the activity ratio.
  • Temperature and ionic-strength effects are outside the calculation.

Constraints

  • Both buffer component concentrations must be positive where used as logarithm arguments or divisors.

Known failures

  • The equation is unreliable when a buffer component is exhausted or the solution is too concentrated/nonideal.
  • Extreme pH-pKa differences can overflow or underflow the displayed ratio.

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
HHEQ — 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.

Browser preview

Try the DuckieDai calculator screen

Follow the same opening, solve menu, prompts, validation, and result flow as the downloadable program.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. from math import log
  2. def intro(n):
  3. t=n[:16];l=(16-len(t))//2;r=16-len(t)-l
  4. print("+----------------------+");print("| "+" "*l+t+" "*r+" |");print("| __ |");print("| ___(o )> quack! |");print("| \\ <_. ) |");print("| `---' |");print("| by DuckieDai |");print("+----------------------+");input("ENTER to start: ")
  5. def num(s):
  6. while 1:
  7. try:return float(input(s))
  8. except:print("Enter a number")
  9. def pos(s):
  10. while 1:
  11. x=num(s)
  12. if x>0:return x
  13. print("Must be positive")
  14. def pick(s,m):
  15. while 1:
  16. try:
  17. x=int(input(s))
  18. if x>0 and x<=m:return x
  19. except:pass
  20. print("Invalid choice")
  21. intro("BUFFER PH")
  22. print("HENDERSON-HASSELBALCH");print("1 pH 2 pKa");print("3 A-/HA 4 find A or HA")
  23. c=pick("Choose 1-4: ",4)
  24. if c==1:
  25. p=num("pKa: ");r=pos("[A-]: ")/pos("[HA]: ");print("pH =",p+log(r,10))
  26. elif c==2:
  27. p=num("pH: ");r=pos("[A-]: ")/pos("[HA]: ");pk=p-log(r,10);print("pKa =",pk);print("Ka =",10**(-pk))
  28. elif c==3:
  29. r=10**(num("pH: ")-num("pKa: "));print("A-/HA =",r)
  30. else:
  31. r=10**(num("pH: ")-num("pKa: "));q=pick("1 A- 2 HA: ",2)
  32. if q==1:print("[A-] =",pos("[HA]: ")*r)
  33. else:print("[HA] =",pos("[A-]: ")/r)
  34. if r==1:print("pH=pKa")
  35. elif r>1:print("Base form dominates")
  36. else:print("Acid form dominates")
  37. input("ENTER for guide: ");print("Best buffer: pH near pKa");print("DuckieDai: done!");input("ENTER to exit: ")
Filename
hhEQ.py
Size
1396 bytes
SHA-256
9ce6e66ef66245a6c12613b38a6f4bebb684e0f42bc77045715c7d58500b41ad

Transfer and launch

  1. Confirm that your calculator is the Python-capable model named above. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
  2. Download the .py source above and verify its SHA-256 digest if your computer provides that option.
  3. Use TI Connect CE to send the Python file to a compatible calculator. HHEQ is a suggested name; you may choose another valid, unique calculator name.
  4. Open the Python App, select the program, and check sample inputs before relying on other results.

Read the complete installation, launch, troubleshooting, and removal guide.

Availability does not mean a teacher, school, or exam permits this program. Follow the applicable rules.

Version history

Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.