Hidden WordScanner
Private scans · No account required

DuckieDai Momentum Toolkit

Solve basic momentum, a missing final collision velocity, or the shared velocity of two objects that stick together.

physics · MIT License

Overview

Solve basic momentum, a missing final collision velocity, or the shared velocity of two objects that stick together.

  • Tested on a TI calculator
  • Downloaded 41 times
  • Version 1.0.0
  • 6961 bytes
  • No imports

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
  • The selected collision is an isolated one-dimensional system and velocity signs encode direction.
  • Masses must be positive and divisor velocities cannot be zero when solving mass.
  • External impulse invalidates momentum conservation.

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 momentum and collisions work

The idea

Momentum is mass times velocity. It has a direction, so an object moving the other way has negative momentum.

In a collision with no outside force, the total momentum before equals the total momentum after. That one fact solves most collision problems.

The formula

p = m*v

m1*v1i + m2*v2i = m1*v1f + m2*v2f

vf = (m1*v1 + m2*v2)/(m1 + m2)

p
momentum (kg*m/s)
m
mass (kg)
v
velocity (m/s), with a sign for direction

Using the program

Worked example

A 2 kg cart moving at 3 m/s hits a 4 kg cart at rest and they stick. Choose 3 and enter 2, 3, 4, and 0.

vf = (2*3 + 4*0)/(2 + 4)

The program shows Final velocity = 1.0 m/s. For the basic mode, a 2 kg object at 3 m/s gives p = 6.0 kg*m/s.

Tips and common mistakes

Where this comes up

It covers the momentum and collisions unit of high school and college physics: carts on a track, a ball and a bat, objects that couple together, and recoil problems.

Exact reviewed bytes

Source code

Download .py

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

  1. """DuckieDai Momentum for TI-84 Plus CE Python."""
  2. def duckiedai_intro(program_name, wait=True):
  3. """Show the reusable DuckieDai program opening."""
  4. title = program_name[:16]
  5. empty = 16 - len(title)
  6. left = empty // 2
  7. right = empty - left
  8. print("+----------------------+")
  9. print("| " + " " * left + title + " " * right + " |")
  10. print("| |")
  11. print("| __ |")
  12. print("| ___(o )> quack! |")
  13. print("| \\ <_. ) |")
  14. print("| `---' |")
  15. print("| by DuckieDai |")
  16. print("+----------------------+")
  17. print("Loading...")
  18. if wait:
  19. input("Press enter to start ")
  20. print("\n" * 6)
  21. def number(prompt):
  22. """Allow positive, negative, or zero values."""
  23. while True:
  24. try:
  25. value = float(input(prompt))
  26. if value > -1e100 and value < 1e100:
  27. return value
  28. except ValueError:
  29. pass
  30. print("Enter a valid number.")
  31. def positive_number(prompt):
  32. """Require a value greater than zero."""
  33. while True:
  34. try:
  35. value = float(input(prompt))
  36. if value > 0 and value < 1e100:
  37. return value
  38. except ValueError:
  39. pass
  40. print("Enter a number above 0.")
  41. def show_answer(name, value, unit):
  42. input("Press enter for answer ")
  43. print("\n" * 6)
  44. print("ANSWER")
  45. print(name + " = " + str(value))
  46. print(unit)
  47. def basic_momentum():
  48. print("BASIC MOMENTUM")
  49. print()
  50. print("p = m*v")
  51. print()
  52. print("1. Solve momentum")
  53. print("2. Solve mass")
  54. print("3. Solve velocity")
  55. print()
  56. choice = input("Choose 1-3: ")
  57. print()
  58. # -------------------------
  59. # Momentum
  60. # -------------------------
  61. if choice == "1":
  62. mass = positive_number("Mass (kg): ")
  63. velocity = number("Velocity (m/s): ")
  64. momentum = mass * velocity
  65. print()
  66. print("Using:")
  67. print("p = m*v")
  68. show_answer(
  69. "p",
  70. momentum,
  71. "kg*m/s"
  72. )
  73. # -------------------------
  74. # Mass
  75. # -------------------------
  76. elif choice == "2":
  77. momentum = number("Momentum: ")
  78. velocity = number("Velocity (m/s): ")
  79. if velocity == 0:
  80. print()
  81. print("Cannot divide by")
  82. print("zero velocity.")
  83. else:
  84. mass = momentum / velocity
  85. print()
  86. print("Using:")
  87. print("p = m*v")
  88. print()
  89. print("Rearranged:")
  90. print("m = p/v")
  91. show_answer(
  92. "m",
  93. mass,
  94. "kg"
  95. )
  96. # -------------------------
  97. # Velocity
  98. # -------------------------
  99. elif choice == "3":
  100. momentum = number("Momentum: ")
  101. mass = positive_number("Mass (kg): ")
  102. velocity = momentum / mass
  103. print()
  104. print("Using:")
  105. print("p = m*v")
  106. print()
  107. print("Rearranged:")
  108. print("v = p/m")
  109. show_answer(
  110. "v",
  111. velocity,
  112. "m/s"
  113. )
  114. else:
  115. print("Invalid choice.")
  116. def collision_solver():
  117. print("2-OBJECT COLLISION")
  118. print()
  119. print("Momentum before")
  120. print("= momentum after")
  121. print()
  122. print("m1*v1i + m2*v2i")
  123. print("=")
  124. print("m1*v1f + m2*v2f")
  125. print()
  126. print("Direction matters!")
  127. print("+ right / - left")
  128. input("Press enter for menu ")
  129. print("\n" * 6)
  130. print()
  131. print("Which is unknown?")
  132. print()
  133. print("1. Object 1 final v")
  134. print("2. Object 2 final v")
  135. print()
  136. choice = input("Choose 1 or 2: ")
  137. print()
  138. m1 = positive_number("Mass 1 (kg): ")
  139. m2 = positive_number("Mass 2 (kg): ")
  140. v1i = number("Initial v1: ")
  141. v2i = number("Initial v2: ")
  142. print()
  143. # ===================================
  144. # Solve v1 final
  145. # ===================================
  146. if choice == "1":
  147. v2f = number("Final v2: ")
  148. initial_p = (
  149. m1 * v1i +
  150. m2 * v2i
  151. )
  152. v1f = (
  153. initial_p -
  154. m2 * v2f
  155. ) / m1
  156. print()
  157. print("Using conservation:")
  158. print("Pi = Pf")
  159. print()
  160. print("m1*v1i + m2*v2i")
  161. print("= m1*v1f + m2*v2f")
  162. print()
  163. print("Rearranged:")
  164. print("v1f =")
  165. print("(Pi-m2*v2f)/m1")
  166. show_answer(
  167. "v1 final",
  168. v1f,
  169. "m/s"
  170. )
  171. # ===================================
  172. # Solve v2 final
  173. # ===================================
  174. elif choice == "2":
  175. v1f = number("Final v1: ")
  176. initial_p = (
  177. m1 * v1i +
  178. m2 * v2i
  179. )
  180. v2f = (
  181. initial_p -
  182. m1 * v1f
  183. ) / m2
  184. print()
  185. print("Using conservation:")
  186. print("Pi = Pf")
  187. print()
  188. print("m1*v1i + m2*v2i")
  189. print("= m1*v1f + m2*v2f")
  190. print()
  191. print("Rearranged:")
  192. print("v2f =")
  193. print("(Pi-m1*v1f)/m2")
  194. show_answer(
  195. "v2 final",
  196. v2f,
  197. "m/s"
  198. )
  199. else:
  200. print("Invalid choice.")
  201. def stick_together():
  202. print("STICK TOGETHER")
  203. print("COLLISION")
  204. print()
  205. print("Objects share one")
  206. print("final velocity.")
  207. print()
  208. print("+ right / - left")
  209. print()
  210. m1 = positive_number("Mass 1 (kg): ")
  211. v1 = number("Velocity 1: ")
  212. m2 = positive_number("Mass 2 (kg): ")
  213. v2 = number("Velocity 2: ")
  214. final_v = (
  215. m1 * v1 +
  216. m2 * v2
  217. ) / (m1 + m2)
  218. print()
  219. print("Using:")
  220. print("m1*v1 + m2*v2")
  221. print("=")
  222. print("(m1+m2)*vf")
  223. print()
  224. print("Rearranged:")
  225. print("vf =")
  226. print("(m1*v1+m2*v2)")
  227. print("/(m1+m2)")
  228. show_answer(
  229. "Final velocity",
  230. final_v,
  231. "m/s"
  232. )
  233. def main():
  234. duckiedai_intro("MOMENTUM")
  235. print("MOMENTUM TOOLKIT")
  236. print()
  237. print("1. Basic momentum")
  238. print("2. Collision solver")
  239. print("3. Stick together")
  240. print()
  241. choice = input("Choose 1-3: ")
  242. print()
  243. if choice == "1":
  244. basic_momentum()
  245. elif choice == "2":
  246. collision_solver()
  247. elif choice == "3":
  248. stick_together()
  249. else:
  250. print("Invalid choice.")
  251. print()
  252. print("DuckieDai says: done!")
  253. # TI-Python imports the selected AppVar rather than
  254. # setting __name__ to main.
  255. main()
Filename
MOMENTUM.py
Size
6961 bytes
SHA-256
0614e495056cecb9cdfaa84c4d8b50a8645e78cf4e6bc4e203edf3d21f2ef0fc

Usage

Inputs

  • Tool mode and requested unknown
  • Masses and signed velocities for the selected calculation

Outputs

  • Momentum, velocity, or mass with the applicable formula and unit

Units: Mass uses kilograms, velocity uses metres per second, and momentum uses kilogram metres per second.

Assumptions and limitations

Assumptions

  • The selected collision is an isolated one-dimensional system and velocity signs encode direction.

Constraints

  • Masses must be positive and divisor velocities cannot be zero when solving mass.

Known failures

  • External impulse invalidates momentum conservation.
  • A one-dimensional model does not resolve multi-axis collisions.

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, momentum toolkit menu, basic and collision workflows, direction guidance, and answer screen ran on the physical calculator
Dependencies
No imports
Suggested calculator name
MOMENTUM — 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 MOMENTUM 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.