th_nrj_cinetique.py

Created by teivaetienne

Created on December 19, 2024

1.04 KB


# Python code to apply the theorem of kinetic energy

# Function to calculate work and kinetic energy
# Work-Energy theorem: W = delta_Ek
def apply_kinetic_energy_theorem(mass, initial_velocity, final_velocity):
    # Initial kinetic energy
    initial_kinetic_energy = 0.5 * mass * initial_velocity ** 2

    # Final kinetic energy
    final_kinetic_energy = 0.5 * mass * final_velocity ** 2

    # Work done (change in kinetic energy)
    work_done = final_kinetic_energy - initial_kinetic_energy

    return initial_kinetic_energy, final_kinetic_energy, work_done

# Example usage
# Inputs
mass = 1.5  # mass in kg
initial_velocity = 2.0  # initial velocity in m/s
final_velocity = 5.0  # final velocity in m/s

# Apply the theorem
initial_kinetic_energy, final_kinetic_energy, work_done = apply_kinetic_energy_theorem(mass, initial_velocity, final_velocity)

# Output results
print("Initial kinetic energy:", initial_kinetic_energy, "J")
print("Final kinetic energy:", final_kinetic_energy, "J")
print("Work done:", work_done, "J")

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.