Sub topic 3
Work as a dot product of force and displacement
This chapter assumes you know vector components, basic sine and cosine, and the idea of a definite integral.
Work is the energy a force transfers to an object as the object moves. For a constant force F that moves an object by a displacement d, work is the dot product:
W = F · d = |F||d| cos θ
Here θ is the angle between the force and the displacement. In components, W = Fₓdₓ + Fydᵧ + Fzd_z.
import math
def work_dot(force, displacement):
"""Work (J) as the dot product of two 2D vectors given as (x, y) tuples."""
return force[0] * displacement[0] + force[1] * displacement[1]
# 50 N at 30 degrees above horizontal, moving 10 m horizontally
F = (50 * math.cos(math.radians(30)), 50 * math.sin(math.radians(30)))
d = (10.0, 0.0)
print(round(work_dot(F, d), 1)) # 433.0Work done by a variable force
When the force changes with position, the work equals the area under a force-versus-position graph, or the integral W = ∫F(x) dx. You can approximate this area with small slices, as a computer does.
Work done by a spring
An ideal spring exerts a force F = −kx, where k is the spring constant and x is the stretch from rest. The work done by an applied force that slowly stretches the spring from 0 to x is W = ½kx². The spring itself does the negative of this work.
k = 200.0 # N/m
x = 0.10 # m
print(0.5 * k * x**2) # 1.0 JPower: the rate of doing work
Average power is P = W/Δt. Instantaneous power is P = F · v, where v is velocity. For example, 1000 J done in 4 s gives 250 W.
Exercise
A 20 N force acts at 60 degrees to a 5 m displacement. How much work does it do?
Show answer
W = 20 × 5 × cos 60° = 20 × 5 × 0.5 = 50 J.