← 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.
physics · MIT License
Overview
Solve electric force, either charge magnitude, or separation distance using Coulomb's law and identify attraction or repulsion when charge signs are known.
Usage
Inputs
- Requested unknown: electric force, charge 1, charge 2, or distance
- Known charges in coulombs and distance in metres
Outputs
- Requested value and, when both charge signs are supplied, attractive or repulsive force type
Units: Charges use coulombs, distance uses metres, and force uses newtons.
Assumptions and limitations
Assumptions
- Charges are treated as point charges and ke is 8.988E9.
Constraints
- Distance and force magnitudes must be positive; divisor values cannot be zero.
Known failures
- Force magnitude alone cannot determine an unknown charge's sign.
- Inconsistent units produce an incorrect result.
Compatibility and review
- Review status
- Tested on a TI calculator
- Tested on
- TI-84 Plus CE Python; OS 5.8.3; Python App 5.8.3.0048; exact paginated .py transferred through TI Connect CE into RAM and tested individually
- What happened
- Passed: branded intro, paginated menu, Coulomb law workflow, force type output, and answer screen ran on the physical calculator
- Dependencies
- math
- Suggested calculator name
COULOMB— 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 reviewed program's real menu, prompts, validation, calculation, and result flow before downloading.
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.
TI-84 Plus CE Python · screen preview
JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.
Exact reviewed bytes
Source code
"""DuckieDai Coulomb's Law for TI-84 Plus CE Python."""from math import sqrtdef duckiedai_intro(program_name, wait=True):"""Show the reusable DuckieDai program opening."""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 number(prompt):"""Allow positive or negative finite numbers."""while True:try:value = float(input(prompt))if value > -1e100 and value < 1e100:return valueexcept ValueError:passprint("Enter a valid number.")def nonzero_number(prompt):"""Require a number other than zero."""while True:value = number(prompt)if value != 0:return valueprint("Value cannot be zero.")def positive_number(prompt):"""Require a number greater than zero."""while True:try:value = float(input(prompt))if value > 0 and value < 1e100:return valueexcept ValueError:passprint("Enter a number above 0.")def show_answer(name, value, unit):input("Press enter for answer ")print("\n" * 6)print("ANSWER")print(name + " = " + str(value))print(unit)def force_type(q1, q2):"""Tell whether two charges attract or repel."""if q1 * q2 < 0:return "ATTRACTIVE"else:return "REPULSIVE"def main():duckiedai_intro("COULOMBS LAW")ke = 8.988e9print("COULOMB'S LAW")print()print("Formula:")print("Fe = ke*|q1*q2|/r^2")print()print("ke = 8.988E9")input("Press enter for menu ")print("\n" * 6)print()print("What do you need?")print()print("1. Electric force")print("2. Charge 1")print("3. Charge 2")print("4. Distance")print()choice = input("Choose 1-4: ")print()# ==========================================# 1. SOLVE ELECTRIC FORCE## Fe = ke*|q1*q2|/r^2# ==========================================if choice == "1":q1 = nonzero_number("Charge 1 (C): ")q2 = nonzero_number("Charge 2 (C): ")r = positive_number("Distance (m): ")force = (ke * abs(q1 * q2) /(r ** 2))print()print("Using:")print("Fe = ke*|q1*q2|/r^2")show_answer("Fe",force,"newtons")print()print("Force type:")print(force_type(q1, q2))# ==========================================# 2. SOLVE MAGNITUDE OF CHARGE 1## |q1| = Fe*r^2 / (ke*|q2|)# ==========================================elif choice == "2":force = positive_number("Force (N): ")q2 = nonzero_number("Charge 2 (C): ")r = positive_number("Distance (m): ")q1 = (force * r ** 2 /(ke * abs(q2)))print()print("Using:")print("Fe = ke*|q1*q2|/r^2")print()print("Rearranged:")print("|q1| = Fe*r^2")print(" /(ke*|q2|)")show_answer("|q1|",q1,"coulombs")print()print("Note:")print("Force alone cannot")print("determine q1 sign.")# ==========================================# 3. SOLVE MAGNITUDE OF CHARGE 2## |q2| = Fe*r^2 / (ke*|q1|)# ==========================================elif choice == "3":force = positive_number("Force (N): ")q1 = nonzero_number("Charge 1 (C): ")r = positive_number("Distance (m): ")q2 = (force * r ** 2 /(ke * abs(q1)))print()print("Using:")print("Fe = ke*|q1*q2|/r^2")print()print("Rearranged:")print("|q2| = Fe*r^2")print(" /(ke*|q1|)")show_answer("|q2|",q2,"coulombs")print()print("Note:")print("Force alone cannot")print("determine q2 sign.")# ==========================================# 4. SOLVE DISTANCE## r = sqrt(ke*|q1*q2|/Fe)# ==========================================elif choice == "4":force = positive_number("Force (N): ")q1 = nonzero_number("Charge 1 (C): ")q2 = nonzero_number("Charge 2 (C): ")r = sqrt(ke * abs(q1 * q2) /force)print()print("Using:")print("Fe = ke*|q1*q2|/r^2")print()print("Rearranged:")print("r = sqrt(")print("ke*|q1*q2|/Fe)")show_answer("r",r,"meters")print()print("Force type:")print(force_type(q1, q2))else:print("Invalid choice.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
COULOMB.py- Size
- 5856 bytes
- SHA-256
b569e112c44626a91e96f49630b52a1821bb5f1f996fc577b7c7a3e76eb47c2c
Transfer and launch
- Confirm that your calculator is the Python-capable model named above. Check that its OS and Python App versions match the reviewed record.
- Download the
.pysource above and verify its SHA-256 digest if your computer provides that option. - Use TI Connect CE to send the Python file to a compatible calculator.
COULOMBis a suggested name; you may choose another valid, unique calculator name. - 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
- 1.0.0 — current version, published . Download this reviewed version
Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.