calculate_work_power
Calculate work done by a force and power using vector dot product. Input force and displacement vectors, optionally include time for power calculation.
Instructions
Calculate work done by a force and optionally power.
Work is the dot product: W = F ยท d
Power (if time given): P = W / t
Args:
force: Force vector [x, y, z] in Newtons (or JSON string)
displacement: Displacement vector [x, y, z] in meters (or JSON string)
time: Time taken in seconds (optional, for power calculation)
Returns:
Dict containing:
- work: Work done in Joules
- power: Power in Watts (if time provided, else None)
Example - Pushing box 5m with 100N force:
result = await calculate_work_power(
force=[100, 0, 0],
displacement=[5, 0, 0],
time=10.0
)
# Work = 500 J, Power = 50 W
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | Yes | ||
| displacement | Yes | ||
| time | No |