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
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
- 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.
TI-84 Plus CE Python · screen preview
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
- 1 Basic momentum: solve p, m, or v from the other two.
- 2 Collision solver: enter both masses, both starting velocities, and one final velocity to find the other.
- 3 Stick together: two objects collide and move off as one.
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
- Pick a positive direction and keep it. Anything moving the other way gets a negative velocity.
- Momentum is conserved in every collision. Kinetic energy is conserved only in elastic ones.
- Objects that stick together share one final velocity.
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
"""DuckieDai Momentum for TI-84 Plus CE Python."""def 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, negative, or zero values."""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):"""Require a value 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 basic_momentum():print("BASIC MOMENTUM")print()print("p = m*v")print()print("1. Solve momentum")print("2. Solve mass")print("3. Solve velocity")print()choice = input("Choose 1-3: ")print()# -------------------------# Momentum# -------------------------if choice == "1":mass = positive_number("Mass (kg): ")velocity = number("Velocity (m/s): ")momentum = mass * velocityprint()print("Using:")print("p = m*v")show_answer("p",momentum,"kg*m/s")# -------------------------# Mass# -------------------------elif choice == "2":momentum = number("Momentum: ")velocity = number("Velocity (m/s): ")if velocity == 0:print()print("Cannot divide by")print("zero velocity.")else:mass = momentum / velocityprint()print("Using:")print("p = m*v")print()print("Rearranged:")print("m = p/v")show_answer("m",mass,"kg")# -------------------------# Velocity# -------------------------elif choice == "3":momentum = number("Momentum: ")mass = positive_number("Mass (kg): ")velocity = momentum / massprint()print("Using:")print("p = m*v")print()print("Rearranged:")print("v = p/m")show_answer("v",velocity,"m/s")else:print("Invalid choice.")def collision_solver():print("2-OBJECT COLLISION")print()print("Momentum before")print("= momentum after")print()print("m1*v1i + m2*v2i")print("=")print("m1*v1f + m2*v2f")print()print("Direction matters!")print("+ right / - left")input("Press enter for menu ")print("\n" * 6)print()print("Which is unknown?")print()print("1. Object 1 final v")print("2. Object 2 final v")print()choice = input("Choose 1 or 2: ")print()m1 = positive_number("Mass 1 (kg): ")m2 = positive_number("Mass 2 (kg): ")v1i = number("Initial v1: ")v2i = number("Initial v2: ")print()# ===================================# Solve v1 final# ===================================if choice == "1":v2f = number("Final v2: ")initial_p = (m1 * v1i +m2 * v2i)v1f = (initial_p -m2 * v2f) / m1print()print("Using conservation:")print("Pi = Pf")print()print("m1*v1i + m2*v2i")print("= m1*v1f + m2*v2f")print()print("Rearranged:")print("v1f =")print("(Pi-m2*v2f)/m1")show_answer("v1 final",v1f,"m/s")# ===================================# Solve v2 final# ===================================elif choice == "2":v1f = number("Final v1: ")initial_p = (m1 * v1i +m2 * v2i)v2f = (initial_p -m1 * v1f) / m2print()print("Using conservation:")print("Pi = Pf")print()print("m1*v1i + m2*v2i")print("= m1*v1f + m2*v2f")print()print("Rearranged:")print("v2f =")print("(Pi-m1*v1f)/m2")show_answer("v2 final",v2f,"m/s")else:print("Invalid choice.")def stick_together():print("STICK TOGETHER")print("COLLISION")print()print("Objects share one")print("final velocity.")print()print("+ right / - left")print()m1 = positive_number("Mass 1 (kg): ")v1 = number("Velocity 1: ")m2 = positive_number("Mass 2 (kg): ")v2 = number("Velocity 2: ")final_v = (m1 * v1 +m2 * v2) / (m1 + m2)print()print("Using:")print("m1*v1 + m2*v2")print("=")print("(m1+m2)*vf")print()print("Rearranged:")print("vf =")print("(m1*v1+m2*v2)")print("/(m1+m2)")show_answer("Final velocity",final_v,"m/s")def main():duckiedai_intro("MOMENTUM")print("MOMENTUM TOOLKIT")print()print("1. Basic momentum")print("2. Collision solver")print("3. Stick together")print()choice = input("Choose 1-3: ")print()if choice == "1":basic_momentum()elif choice == "2":collision_solver()elif choice == "3":stick_together()else:print("Invalid choice.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.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
- 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.