Hidden WordScanner
Private scans · No account required

DuckieDai Work and Energy

Solve work, kinetic energy, speed changes from net work, force, distance, or force angle with guided formulas.

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

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.

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

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.

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

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

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

Download .py

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

  1. """DuckieDai Work and Energy for TI-84 Plus CE Python."""
  2. from math import cos, radians, sqrt, acos, degrees
  3. def duckiedai_intro(program_name, wait=True):
  4. """Show the reusable DuckieDai program opening."""
  5. title = program_name[:16]
  6. empty = 16 - len(title)
  7. left = empty // 2
  8. right = empty - left
  9. print("+----------------------+")
  10. print("| " + " " * left + title + " " * right + " |")
  11. print("| |")
  12. print("| __ |")
  13. print("| ___(o )> quack! |")
  14. print("| \\ <_. ) |")
  15. print("| `---' |")
  16. print("| by DuckieDai |")
  17. print("+----------------------+")
  18. print("Loading...")
  19. if wait:
  20. input("Press enter to start ")
  21. print("\n" * 6)
  22. def number(prompt):
  23. """Ask until a valid finite number is entered."""
  24. while True:
  25. try:
  26. value = float(input(prompt))
  27. if value > -1e100 and value < 1e100:
  28. return value
  29. except ValueError:
  30. pass
  31. print("Enter a valid number.")
  32. def positive_number(prompt):
  33. """Ask until a positive finite number is entered."""
  34. while True:
  35. try:
  36. value = float(input(prompt))
  37. if value > 0 and value < 1e100:
  38. return value
  39. except ValueError:
  40. pass
  41. print("Enter a number above 0.")
  42. def show_answer(name, value, unit):
  43. input("Press enter for answer ")
  44. print("\n" * 6)
  45. print("ANSWER")
  46. print(name + " = " + str(value))
  47. print(unit)
  48. def main():
  49. duckiedai_intro("WORK & ENERGY")
  50. print("WORK & ENERGY")
  51. print()
  52. print("1. Calculate Work")
  53. print("2. Kinetic Energy")
  54. print("3. Final speed")
  55. print(" from net work")
  56. print("4. Initial speed")
  57. print(" from net work")
  58. input("Press enter for more ")
  59. print("\n" * 6)
  60. print("5. Solve force")
  61. print("6. Solve distance")
  62. print("7. Solve angle")
  63. print()
  64. choice = input("Choose 1-7: ")
  65. print()
  66. # ==========================================
  67. # 1. WORK
  68. # W = F*d*cos(theta)
  69. # ==========================================
  70. if choice == "1":
  71. force = number("Force (N): ")
  72. distance = positive_number("Distance (m): ")
  73. angle = number("Angle (degrees): ")
  74. work = (
  75. force *
  76. distance *
  77. cos(radians(angle))
  78. )
  79. print()
  80. print("Using:")
  81. print("W = F*d*cos(theta)")
  82. print()
  83. print("W = " + str(force) +
  84. " x " + str(distance))
  85. print("x cos(" + str(angle) + ")")
  86. show_answer(
  87. "W",
  88. work,
  89. "joules"
  90. )
  91. # ==========================================
  92. # 2. KINETIC ENERGY
  93. # KE = 0.5*m*v^2
  94. # ==========================================
  95. elif choice == "2":
  96. mass = positive_number("Mass (kg): ")
  97. velocity = number("Velocity (m/s): ")
  98. ke = (
  99. 0.5 *
  100. mass *
  101. velocity ** 2
  102. )
  103. print()
  104. print("Using:")
  105. print("KE = 0.5*m*v^2")
  106. print()
  107. print("KE = 0.5 x " +
  108. str(mass) + " x")
  109. print(str(velocity) + "^2")
  110. show_answer(
  111. "KE",
  112. ke,
  113. "joules"
  114. )
  115. # ==========================================
  116. # 3. FINAL SPEED FROM NET WORK
  117. #
  118. # W = KEf - KEi
  119. #
  120. # vf = sqrt(vi^2 + 2W/m)
  121. # ==========================================
  122. elif choice == "3":
  123. mass = positive_number("Mass (kg): ")
  124. vi = number("Initial speed: ")
  125. work = number("Net work (J): ")
  126. inside = (
  127. vi ** 2 +
  128. (2 * work / mass)
  129. )
  130. if inside < 0:
  131. print()
  132. print("No real final speed.")
  133. print("Check the values.")
  134. print()
  135. print("Negative work may")
  136. print("stop the object.")
  137. else:
  138. vf = sqrt(inside)
  139. print()
  140. print("Using:")
  141. print("W = KEf - KEi")
  142. print()
  143. print("Rearranged:")
  144. print("vf=sqrt(vi^2+2W/m)")
  145. show_answer(
  146. "Final speed",
  147. vf,
  148. "m/s"
  149. )
  150. # ==========================================
  151. # 4. INITIAL SPEED FROM NET WORK
  152. #
  153. # vi = sqrt(vf^2 - 2W/m)
  154. # ==========================================
  155. elif choice == "4":
  156. mass = positive_number("Mass (kg): ")
  157. vf = number("Final speed: ")
  158. work = number("Net work (J): ")
  159. inside = (
  160. vf ** 2 -
  161. (2 * work / mass)
  162. )
  163. if inside < 0:
  164. print()
  165. print("No real initial speed.")
  166. print("Check the values.")
  167. else:
  168. vi = sqrt(inside)
  169. print()
  170. print("Using:")
  171. print("W = KEf - KEi")
  172. print()
  173. print("Rearranged:")
  174. print("vi=sqrt(vf^2-2W/m)")
  175. show_answer(
  176. "Initial speed",
  177. vi,
  178. "m/s"
  179. )
  180. # ==========================================
  181. # 5. SOLVE FORCE
  182. #
  183. # F = W / (d*cos(theta))
  184. # ==========================================
  185. elif choice == "5":
  186. work = number("Work (J): ")
  187. distance = positive_number("Distance (m): ")
  188. angle = number("Angle (degrees): ")
  189. c = cos(radians(angle))
  190. if abs(c) < 0.0000001:
  191. print()
  192. print("Cannot solve force.")
  193. print("cos(angle) is zero.")
  194. else:
  195. force = (
  196. work /
  197. (distance * c)
  198. )
  199. print()
  200. print("Using:")
  201. print("W = F*d*cos(theta)")
  202. print()
  203. print("Rearranged:")
  204. print("F=W/(d*cos(theta))")
  205. show_answer(
  206. "F",
  207. force,
  208. "newtons"
  209. )
  210. # ==========================================
  211. # 6. SOLVE DISTANCE
  212. #
  213. # d = W / (F*cos(theta))
  214. # ==========================================
  215. elif choice == "6":
  216. work = number("Work (J): ")
  217. force = number("Force (N): ")
  218. angle = number("Angle (degrees): ")
  219. c = cos(radians(angle))
  220. denominator = force * c
  221. if abs(denominator) < 0.0000001:
  222. print()
  223. print("Cannot solve distance.")
  224. print("Check force/angle.")
  225. else:
  226. distance = (
  227. work /
  228. denominator
  229. )
  230. print()
  231. print("Using:")
  232. print("W = F*d*cos(theta)")
  233. print()
  234. print("Rearranged:")
  235. print("d=W/(F*cos(theta))")
  236. show_answer(
  237. "d",
  238. distance,
  239. "meters"
  240. )
  241. # ==========================================
  242. # 7. SOLVE ANGLE
  243. #
  244. # theta = acos(W / (F*d))
  245. # ==========================================
  246. elif choice == "7":
  247. work = number("Work (J): ")
  248. force = number("Force (N): ")
  249. distance = positive_number("Distance (m): ")
  250. denominator = force * distance
  251. if denominator == 0:
  252. print()
  253. print("Cannot solve angle.")
  254. else:
  255. ratio = work / denominator
  256. if ratio < -1 or ratio > 1:
  257. print()
  258. print("No real angle.")
  259. print("Check the values.")
  260. else:
  261. angle = degrees(
  262. acos(ratio)
  263. )
  264. print()
  265. print("Using:")
  266. print("W = F*d*cos(theta)")
  267. print()
  268. print("Rearranged:")
  269. print("theta=acos(W/(F*d))")
  270. show_answer(
  271. "theta",
  272. angle,
  273. "degrees"
  274. )
  275. else:
  276. print("Invalid choice.")
  277. print()
  278. print("DuckieDai says: done!")
  279. # TI-Python imports the selected AppVar rather than
  280. # setting __name__ to main.
  281. 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

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.