chemistry · MIT License
Overview
Solve A = epsilon*c*l and convert between absorbance and transmittance while keeping units and model limits visible.
- Not calculator tested
- Downloaded 34 times
- Version 1.0.0
- 2111 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
- The sample is homogeneous and follows a linear Beer-Lambert response at the selected wavelength.
- Scattering, stray light, chemical equilibria, and instrument effects are negligible.
- Divisors and intensity values must be positive; A, epsilon, and concentration are nonnegative in the primary solve modes.
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 Beer-Lambert law works
The idea
A colored solution absorbs more light when it is more concentrated or when the light travels further through it. Absorbance is directly proportional to both.
That straight-line relationship is how a spectrophotometer turns a light reading into a concentration.
The formula
A = epsilon*c*l
A = -log10(I/I0)
A- absorbance (no units)
epsilon- molar absorptivity (L/mol cm)
c- concentration (mol/L)
l- path length (cm)
I/I0- fraction of light transmitted
Using the program
- 1 finds absorbance. 2 finds concentration. 3 finds epsilon. 4 finds path length.
- 5 converts transmitted light to absorbance. 6 converts absorbance back to transmitted light.
Worked example
NADH has epsilon = 6220 L/mol cm at 340 nm. For a 0.0001 mol/L solution in a 1 cm cuvette, choose 1 and enter 6220, 0.0001, and 1.
A = 6220 x 0.0001 x 1
The program shows A = 0.622.
Tips and common mistakes
- Path length is in centimeters. A standard cuvette is 1 cm.
- The law holds for dilute solutions. Above an absorbance of about 1 to 2, readings stop being linear.
- An absorbance of 1 means 10% of the light gets through; 2 means 1%.
Where this comes up
It is used in every spectrophotometry lab, from general chemistry to biochemistry and analytical chemistry, to turn an absorbance reading into a concentration or to build a calibration line.
Exact reviewed bytes
Source code
from math import logdef duckiedai_intro(program_name,wait=True):title=program_name[:16]empty=16-len(title)left=empty//2right=empty-leftprint("+----------------------+")print("| "+" "*left+title+" "*right+" |")print("| |")print("| __ |")print("| ___(o )> quack! |")print("| \\ <_. ) |")print("| `---' |")print("| by DuckieDai |")print("+----------------------+")print("Loading...")if wait:input("Press enter to start ")print("\n"*6)def num(s,zero=0):while 1:try:x=float(input(s))if x>0 or zero and x>=0:return xexcept:passprint("Enter a valid #")def ratio():while 1:x=num("I/I0: ")if x<=1:return xprint("I/I0 must be <=1")duckiedai_intro("BEER LAMBERT")print("BEER-LAMBERT LAW")print("1 Find A")print("2 Find conc")print("3 Find epsilon")print("4 Find path")print("5 A from I/I0")print("6 Light from A")c=""while c not in ("1","2","3","4","5","6"):c=input("Choose 1-6: ")if c=="1":e=num("epsilon: ",1)x=num("Conc mol/L: ",1)l=num("Path cm: ")a=e*x*lprint("A =",a)elif c=="2":a=num("Absorbance A: ",1)e=num("epsilon: ")l=num("Path cm: ")print("Conc mol/L =",a/(e*l))elif c=="3":a=num("Absorbance A: ",1)x=num("Conc mol/L: ")l=num("Path cm: ")print("epsilon =",a/(x*l))print("L/(mol*cm)")elif c=="4":a=num("Absorbance A: ",1)e=num("epsilon: ")x=num("Conc mol/L: ")print("Path cm =",a/(e*x))elif c=="5":print("1 Enter I and I0")print("2 Enter I/I0")q=""while q not in ("1","2"):q=input("Choose 1 or 2: ")if q=="1":i0=num("I0: ")i=num("I: ")r=i/i0else:r=ratio()print("A =",-log(r,10))print("I/I0 =",r)print("%T =",r*100)else:a=num("Absorbance A: ",1)r=10**(-a)print("I/I0 =",r)print("%T =",r*100)q=input("Find I? 1=yes: ")if q=="1":print("I =",num("I0: ")*r)input("ENTER for guide: ")print("QUICK GUIDE")print("A=epsilon*c*l")print("A=-log(I/I0)")print("Higher A: less light")print("A has no units")print("DuckieDai: done!")input("ENTER to exit: ")
- Filename
beer.py- Size
- 2111 bytes
- SHA-256
f83924f329db3a636204ccf0d19041002cb6e5d0a4b25a420d766df22c4596cf
Usage
Inputs
- Solve mode and the required absorbance, molar absorptivity, concentration, or path length
- Incident and transmitted intensity, or their dimensionless ratio
Outputs
- Absorbance, concentration, molar absorptivity, path length, transmittance ratio, or percent transmittance
Units: A is dimensionless; epsilon uses L/(mol*cm), c uses mol/L, and l uses cm. I and I0 must use the same intensity unit.
Assumptions and limitations
Assumptions
- The sample is homogeneous and follows a linear Beer-Lambert response at the selected wavelength.
- Scattering, stray light, chemical equilibria, and instrument effects are negligible.
Constraints
- Divisors and intensity values must be positive; A, epsilon, and concentration are nonnegative in the primary solve modes.
Known failures
- I greater than I0 gives negative absorbance and usually indicates a baseline, reference, or measurement issue.
- High concentration or high absorbance can depart from linear behavior.
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
BEER— 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 BEER 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.