calculate_rotational_kinetic_energy
Compute rotational kinetic energy (KE_rot = ½ I ω²) for spinning objects to analyze energy storage and rolling motion.
Instructions
Calculate rotational kinetic energy: KE_rot = (1/2) I ω².
Energy of rotation. A spinning object has kinetic energy even if
its center of mass is stationary.
Args:
moment_of_inertia: Moment of inertia in kg⋅m²
angular_velocity: Angular velocity magnitude in rad/s
Returns:
Dict containing:
- rotational_ke: Rotational kinetic energy in Joules
Tips for LLMs:
- Total KE = translational KE + rotational KE
- Rolling object has both types of kinetic energy
- Flywheel energy storage uses this principle
Example - Car wheel at highway speed:
result = await calculate_rotational_kinetic_energy(
moment_of_inertia=0.5, # kg⋅m²
angular_velocity=100.0 # rad/s (fast spinning)
)
# KE_rot = 2500 JInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| moment_of_inertia | Yes | ||
| angular_velocity | Yes |
Implementation Reference
- Core calculation function: KE_rot = 0.5 * I * ω². Computes rotational kinetic energy from moment of inertia and angular velocity.
def calculate_rotational_kinetic_energy( request: RotationalKineticEnergyRequest, ) -> RotationalKineticEnergyResponse: """Calculate rotational kinetic energy: KE_rot = (1/2) * I * ω². Args: request: Rotational KE request Returns: Rotational kinetic energy """ inertia = request.moment_of_inertia omega = request.angular_velocity KE_rot = 0.5 * inertia * omega * omega return RotationalKineticEnergyResponse(rotational_ke=KE_rot) - MCP tool endpoint decorated with @tool. Accepts float parameters, creates a pydantic request, delegates to core function, and returns a dict.
@tool # type: ignore[arg-type] async def calculate_rotational_kinetic_energy( moment_of_inertia: float, angular_velocity: float, ) -> dict: """Calculate rotational kinetic energy: KE_rot = (1/2) I ω². Energy of rotation. A spinning object has kinetic energy even if its center of mass is stationary. Args: moment_of_inertia: Moment of inertia in kg⋅m² angular_velocity: Angular velocity magnitude in rad/s Returns: Dict containing: - rotational_ke: Rotational kinetic energy in Joules Tips for LLMs: - Total KE = translational KE + rotational KE - Rolling object has both types of kinetic energy - Flywheel energy storage uses this principle Example - Car wheel at highway speed: result = await calculate_rotational_kinetic_energy( moment_of_inertia=0.5, # kg⋅m² angular_velocity=100.0 # rad/s (fast spinning) ) # KE_rot = 2500 J """ from ..rotational import ( RotationalKineticEnergyRequest, calculate_rotational_kinetic_energy as calc_ke_rot, ) request = RotationalKineticEnergyRequest( moment_of_inertia=moment_of_inertia, angular_velocity=angular_velocity, ) response = calc_ke_rot(request) return response.model_dump() - Pydantic request schema with moment_of_inertia (must be > 0) and angular_velocity fields.
class RotationalKineticEnergyRequest(BaseModel): """Request for rotational kinetic energy calculation.""" moment_of_inertia: float = Field(..., description="Moment of inertia in kg⋅m²", gt=0.0) angular_velocity: float = Field(..., description="Angular velocity magnitude in rad/s") - Pydantic response schema containing rotational_ke field in Joules.
class RotationalKineticEnergyResponse(BaseModel): """Response for rotational kinetic energy calculation.""" rotational_ke: float = Field(..., description="Rotational kinetic energy in Joules") - src/chuk_mcp_physics/tools/rotational.py:174-175 (registration)Tool registration via the @tool decorator from chuk_mcp_server, which registers the function as an MCP tool. Includes type: ignore for the decorator.
@tool # type: ignore[arg-type] async def calculate_rotational_kinetic_energy(