physics · MIT License
Overview
Solve work, kinetic energy, speed changes from net work, force, distance, or force angle with guided formulas.
- Tested on a TI calculator
- Downloaded 39 times
- Version 1.0.0
- 8680 bytes
- Uses math
Tried it? Did this program work on your calculator?
Before you run it
- TI-84 Plus CE Python · tested on OS 5.8.3, Python App 5.8.3.0048
- TI Connect CE .py conversion to a Python AppVar in RAM; physically verified one program at a time
- Angles are entered in degrees and net work follows the work-energy theorem.
- Mass and distance inputs must be positive where required; inverse cosine inputs must remain in range.
- Some inputs yield no real speed.
Try the DuckieDai calculator screen
Follow the reviewed program's real menu, prompts, validation, calculation, and result flow before downloading.
TI-84 Plus CE Python · screen preview
Learn the math
How work and kinetic energy work
The idea
Work is done when a force moves something. Only the part of the force along the direction of motion counts, which is where the cosine comes from.
The work-energy theorem says the net work done on an object equals the change in its kinetic energy.
The formula
W = F*d*cos(theta)
KE = 0.5*m*v^2
Wnet = KEf - KEi
W- work in joules (J)
F- force (N)
d- distance moved (m)
theta- angle between the force and the motion, in degrees
KE- kinetic energy (J)
Using the program
- 1 Calculate work and 2 Kinetic energy use the first two formulas directly.
- 3 Final speed and 4 Initial speed use the work-energy theorem with a net work value.
- 5 Solve force, 6 Solve distance, and 7 Solve angle rearrange the work formula. The menu is two screens long.
Worked example
A 10 N force pushes a box 5 m in the direction of the force. Choose 1 and enter 10, 5, and an angle of 0.
W = 10.0 x 5.0 x cos(0.0)
The program shows W = 50.0 joules.
Tips and common mistakes
- Angles are entered in degrees.
- A force at 90 degrees to the motion does no work. A force opposing the motion does negative work.
- Some inputs have no real answer, for example a final speed when the net work removes more energy than the object has.
Where this comes up
It is the work and energy unit of high school and college physics. Once you know the work-energy theorem, many problems that look like kinematics become one-line energy calculations.
Exact reviewed bytes
Source code
"""DuckieDai Work and Energy for TI-84 Plus CE Python."""from math import cos, radians, sqrt, acos, degreesdef 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):"""Ask until a valid finite number is entered."""while True:try:value = float(input(prompt))if value > -1e100 and value < 1e100:return valueexcept ValueError:passprint("Enter a valid number.")def positive_number(prompt):"""Ask until a positive finite number is entered."""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 main():duckiedai_intro("WORK & ENERGY")print("WORK & ENERGY")print()print("1. Calculate Work")print("2. Kinetic Energy")print("3. Final speed")print(" from net work")print("4. Initial speed")print(" from net work")input("Press enter for more ")print("\n" * 6)print("5. Solve force")print("6. Solve distance")print("7. Solve angle")print()choice = input("Choose 1-7: ")print()# ==========================================# 1. WORK# W = F*d*cos(theta)# ==========================================if choice == "1":force = number("Force (N): ")distance = positive_number("Distance (m): ")angle = number("Angle (degrees): ")work = (force *distance *cos(radians(angle)))print()print("Using:")print("W = F*d*cos(theta)")print()print("W = " + str(force) +" x " + str(distance))print("x cos(" + str(angle) + ")")show_answer("W",work,"joules")# ==========================================# 2. KINETIC ENERGY# KE = 0.5*m*v^2# ==========================================elif choice == "2":mass = positive_number("Mass (kg): ")velocity = number("Velocity (m/s): ")ke = (0.5 *mass *velocity ** 2)print()print("Using:")print("KE = 0.5*m*v^2")print()print("KE = 0.5 x " +str(mass) + " x")print(str(velocity) + "^2")show_answer("KE",ke,"joules")# ==========================================# 3. FINAL SPEED FROM NET WORK## W = KEf - KEi## vf = sqrt(vi^2 + 2W/m)# ==========================================elif choice == "3":mass = positive_number("Mass (kg): ")vi = number("Initial speed: ")work = number("Net work (J): ")inside = (vi ** 2 +(2 * work / mass))if inside < 0:print()print("No real final speed.")print("Check the values.")print()print("Negative work may")print("stop the object.")else:vf = sqrt(inside)print()print("Using:")print("W = KEf - KEi")print()print("Rearranged:")print("vf=sqrt(vi^2+2W/m)")show_answer("Final speed",vf,"m/s")# ==========================================# 4. INITIAL SPEED FROM NET WORK## vi = sqrt(vf^2 - 2W/m)# ==========================================elif choice == "4":mass = positive_number("Mass (kg): ")vf = number("Final speed: ")work = number("Net work (J): ")inside = (vf ** 2 -(2 * work / mass))if inside < 0:print()print("No real initial speed.")print("Check the values.")else:vi = sqrt(inside)print()print("Using:")print("W = KEf - KEi")print()print("Rearranged:")print("vi=sqrt(vf^2-2W/m)")show_answer("Initial speed",vi,"m/s")# ==========================================# 5. SOLVE FORCE## F = W / (d*cos(theta))# ==========================================elif choice == "5":work = number("Work (J): ")distance = positive_number("Distance (m): ")angle = number("Angle (degrees): ")c = cos(radians(angle))if abs(c) < 0.0000001:print()print("Cannot solve force.")print("cos(angle) is zero.")else:force = (work /(distance * c))print()print("Using:")print("W = F*d*cos(theta)")print()print("Rearranged:")print("F=W/(d*cos(theta))")show_answer("F",force,"newtons")# ==========================================# 6. SOLVE DISTANCE## d = W / (F*cos(theta))# ==========================================elif choice == "6":work = number("Work (J): ")force = number("Force (N): ")angle = number("Angle (degrees): ")c = cos(radians(angle))denominator = force * cif abs(denominator) < 0.0000001:print()print("Cannot solve distance.")print("Check force/angle.")else:distance = (work /denominator)print()print("Using:")print("W = F*d*cos(theta)")print()print("Rearranged:")print("d=W/(F*cos(theta))")show_answer("d",distance,"meters")# ==========================================# 7. SOLVE ANGLE## theta = acos(W / (F*d))# ==========================================elif choice == "7":work = number("Work (J): ")force = number("Force (N): ")distance = positive_number("Distance (m): ")denominator = force * distanceif denominator == 0:print()print("Cannot solve angle.")else:ratio = work / denominatorif ratio < -1 or ratio > 1:print()print("No real angle.")print("Check the values.")else:angle = degrees(acos(ratio))print()print("Using:")print("W = F*d*cos(theta)")print()print("Rearranged:")print("theta=acos(W/(F*d))")show_answer("theta",angle,"degrees")else:print("Invalid choice.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
WORKNRG.py- Size
- 8680 bytes
- SHA-256
408f33e65e1ad0b1e800702a87b5119af000d89515b73dd24da948bf5b14bf33
Usage
Inputs
- Requested calculation mode
- Applicable force, distance, angle, mass, work, and velocity values
Outputs
- Requested work-energy quantity with derivation and labelled unit
Units: Use newtons, metres, degrees, kilograms, metres per second, and joules consistently.
Assumptions and limitations
Assumptions
- Angles are entered in degrees and net work follows the work-energy theorem.
Constraints
- Mass and distance inputs must be positive where required; inverse cosine inputs must remain in range.
Known failures
- Some inputs yield no real speed.
- Force or distance cannot be recovered when the relevant cosine or divisor is zero.
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, multi page work energy menu, selected calculation workflow, derivation, and answer screen ran on the physical calculator
- Dependencies
- math
- Suggested calculator name
WORKNRG— 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 WORKNRG or another name, then open the Python App and try the worked example on this page first.
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.