Hidden WordScanner
Private scans · No account required

DuckieDai Gravitational Potential Energy

Solve near-Earth gravitational potential energy, mass, or height from PE = m*g*h using g = 9.8 m/s^2.

Version 1.0.0 · Tested on a TI calculator

← 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 near-Earth gravitational potential energy, mass, or height from PE = m*g*h using g = 9.8 m/s^2.

Usage

Inputs

  • Requested unknown: potential energy, mass, or height
  • Two known values using kilograms, metres, and joules

Outputs

  • Requested quantity using PE = m*g*h

Units: Mass uses kilograms, height uses metres, and energy uses joules.

Assumptions and limitations

Assumptions

  • Gravitational field strength is fixed at 9.8 m/s^2 and height is measured from the chosen zero level.

Constraints

  • Mass and divisors must be positive; height and potential energy may be zero where offered.

Known failures

  • The fixed value of g is not suitable when local gravitational field strength differs materially.

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 potential energy menu, calculation workflow, and answer screen ran on the physical calculator
Dependencies
No imports
Suggested calculator name
GRAVPE — 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.

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

Exact reviewed bytes

Source code

Download .py

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

  1. """DuckieDai Potential Energy 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 positive_number(prompt):
  22. """Ask until a positive finite number is entered."""
  23. while True:
  24. try:
  25. value = float(input(prompt))
  26. if value > 0 and value < 1e100:
  27. return value
  28. except ValueError:
  29. pass
  30. print("Enter a number above 0.")
  31. def nonnegative_number(prompt):
  32. """Allow zero or positive values."""
  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 0 or greater.")
  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 main():
  48. duckiedai_intro("POTENTIAL ENERGY")
  49. g = 9.8
  50. print("GRAVITATIONAL PE")
  51. print()
  52. print("Formula: PE = m*g*h")
  53. print("Using g = 9.8 m/s^2")
  54. input("Press enter for menu ")
  55. print("\n" * 6)
  56. print()
  57. print("What do you need?")
  58. print()
  59. print("1. Potential Energy")
  60. print("2. Mass")
  61. print("3. Height")
  62. print()
  63. choice = input("Choose 1-3: ")
  64. print()
  65. # ==========================================
  66. # 1. SOLVE POTENTIAL ENERGY
  67. # PE = m*g*h
  68. # ==========================================
  69. if choice == "1":
  70. mass = positive_number("Mass (kg): ")
  71. height = nonnegative_number("Height (m): ")
  72. pe = mass * g * height
  73. print()
  74. print("Using:")
  75. print("PE = m*g*h")
  76. print()
  77. print("PE = " + str(mass))
  78. print("x " + str(g))
  79. print("x " + str(height))
  80. show_answer(
  81. "PE",
  82. pe,
  83. "joules"
  84. )
  85. # ==========================================
  86. # 2. SOLVE MASS
  87. # m = PE / (g*h)
  88. # ==========================================
  89. elif choice == "2":
  90. pe = nonnegative_number("PE (J): ")
  91. height = positive_number("Height (m): ")
  92. mass = pe / (g * height)
  93. print()
  94. print("Using:")
  95. print("PE = m*g*h")
  96. print()
  97. print("Rearranged:")
  98. print("m = PE/(g*h)")
  99. show_answer(
  100. "m",
  101. mass,
  102. "kg"
  103. )
  104. # ==========================================
  105. # 3. SOLVE HEIGHT
  106. # h = PE / (m*g)
  107. # ==========================================
  108. elif choice == "3":
  109. pe = nonnegative_number("PE (J): ")
  110. mass = positive_number("Mass (kg): ")
  111. height = pe / (mass * g)
  112. print()
  113. print("Using:")
  114. print("PE = m*g*h")
  115. print()
  116. print("Rearranged:")
  117. print("h = PE/(m*g)")
  118. show_answer(
  119. "h",
  120. height,
  121. "meters"
  122. )
  123. else:
  124. print("Invalid choice.")
  125. print()
  126. print("DuckieDai says: done!")
  127. # TI-Python imports the selected AppVar rather than
  128. # setting __name__ to main.
  129. main()
Filename
GRAVPE.py
Size
3916 bytes
SHA-256
ae1c282439e58780c9af76733d080f0e862b09e898755dfb0311fd3022518ba6

Transfer and launch

  1. Confirm that your calculator is the Python-capable model named above. Check that its OS and Python App versions match the reviewed record.
  2. Download the .py source above and verify its SHA-256 digest if your computer provides that option.
  3. Use TI Connect CE to send the Python file to a compatible calculator. GRAVPE is a suggested name; you may choose another valid, unique calculator name.
  4. 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

Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.