ForHosting KIT · Engineering & construction

Pendulum energy calculator

Pick any point of the swing and see where the energy sits: a 0.5 kg bob on a 1 m string released at 30 degrees already carries most of it as motion by 15 degrees. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Length
1
Mass
0.5
Amplitude deg
30
Angle deg
15
G
9.81
You get
Length m
1
Mass kg
0.5
G m s2
9.81
Height m
0.0340741737

A simple pendulum stores a fixed total mechanical energy once you fix length, mass, gravity, and the amplitude at which the bob is released from rest. At every later angle that total splits between gravitational potential energy relative to the lowest point and kinetic energy of the moving bob. Students, teachers, and lab scripts need both parts at an arbitrary swing angle without re-deriving the cosine height formula by hand. This pendulum energy calculator accepts length in metres, mass in kilograms, amplitude and current angle in degrees from the vertical, and optional gravity, then returns potential energy, kinetic energy, total energy, height above the bottom, speed, and the PE/KE fractions. Negative length is rejected as invalid input.

How pendulum mechanical energy splits at a swing angle

Picture a bob of mass m on a massless string or rod of length L hanging under constant gravitational acceleration g. Measure angle from the downward vertical. At the lowest point the height of the bob above that reference is zero; at angle θ the geometric rise is L times one minus the cosine of θ, so the gravitational potential energy is m g L (1 − cos θ) when PE is taken to be zero at the bottom.

If the pendulum is released from rest at amplitude θ_amp, every bit of energy is potential at that instant and the conserved total is m g L (1 − cos θ_amp). At a smaller angle θ inside the free swing, potential has fallen to m g L (1 − cos θ) and the difference appears as kinetic energy: KE equals m g L (cos θ − cos θ_amp).

Speed follows from KE equals one half m v squared, giving v equals the square root of two g L times (cos θ − cos θ_amp). These identities assume no friction, no air drag, and a fixed pivot; they remain exact for large angles because they never use the small-angle approximation that linearises period.

What you enter, what you get, and what is refused

Zero length is also rejected. Mass must be non-negative; zero mass yields zero energies and zero speed, which is useful for smoke tests. Absolute amplitude and absolute angle must each stay within one hundred eighty degrees of the vertical, and the absolute current angle must not exceed the absolute amplitude—otherwise the bob would be outside the free-swing energy range and kinetic energy would go negative.

Gravity must be positive and finite. Numeric fields are rounded to twelve decimal places for stable goldens across runtimes. Invalid requests are not billed.

Pair the numbers with your own plot of PE and KE versus angle if you need a graph; this capability solves the energy split only and does not emit images or step-by-step prose beyond the formula field.

Where a pendulum energy calculator earns its keep

Physics classrooms and tutoring platforms use a pendulum energy calculator so learners can check PE and KE at mid-swing without algebra mistakes on the cosine height. Exam generators and LMS plugins need a deterministic oracle that rejects negative length and over-amplitude angles instead of inventing a negative kinetic energy that a buggy grader might treat as success. Laboratory notebooks recording photogate angles or video-tracked θ(t) can call the same pure function on every frame to annotate energy fractions without pulling a full multibody dynamics package.

Failed validation does not consume balance.

Classroom PE/KE checks at mid-swing

Let students enter length, mass, amplitude, and a mid-swing angle and verify potential, kinetic, and total energy against textbook cosine-height methods.

Lab tracking and notebook automation

Map measured swing angles to PE and KE fractions in photogate or video-analysis scripts without a full dynamics library.

How does the pendulum energy calculator split KE and PE?

With PE zero at the bottom, PE = m g L (1 − cos θ) and total energy E = m g L (1 − cos θ_amp) for release from rest at amplitude. Kinetic energy is KE = E − PE = m g L (cos θ − cos θ_amp).

What happens if length is negative?

Length is a physical distance and cannot be negative; invalid input is not billed.

Can the current angle be larger than the amplitude?

No. The current angle must not exceed the release amplitude, because the bob never swings past the point where it started from rest; beyond it the kinetic energy would turn negative. Both angles must also stay within 180 degrees of the vertical.

Does this work for large swings?

Yes. The energy formulas use the full cosine of the angle and never rely on the small-angle shortcut used for the period, so they stay exact for wide swings of an ideal pendulum.

What gravity value is used if I leave it blank?

It uses 9.81 m/s², the usual classroom value for Earth. You can enter any other positive value instead, for example a more precise local figure for a lab.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/mech/pendulum-energy

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/mech/pendulum-energy \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"length":1,"mass":0.5,"amplitude_deg":30,"angle_deg":15}'
{
  "length": 1,
  "mass": 0.5,
  "amplitude_deg": 30,
  "angle_deg": 15
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "mech.pendulum_energy",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How pendulum mechanical energy splits at a swing angle

This endpoint implements exactly that closed form: you supply L, m, θ_amp, θ, and optional g (default 9.81 m/s²), and you receive the energy parts in joules when SI units are used, plus height, maximum height, speed, and the fractions of total energy that are potential and kinetic so dashboards can plot a clean PE/KE bar without recomputing totals.

Input contract, response fields, and when validation fails

POST a JSON body with required finite numbers length (or L, length_m), mass (or m, mass_kg), amplitude_deg (or amplitude, theta_max_deg, amp_deg), and angle_deg (or angle, theta_deg, swing_angle_deg). Optional g (or gravity, gravity_accel, gravitational_acceleration) defaults to 9.81 when omitted. Length must be strictly positive: a negative length is not a physical distance and fails with invalid_input and a message that names length and the word negative so clients can match the error in tests. On success the body echoes length_m, mass_kg, amplitude_deg, angle_deg, and g_m_s2; reports height_m and height_max_m above the bottom; returns potential_j, kinetic_j, and total_j; gives speed_m_s; pe_fraction and ke_fraction (zero when total is zero); a short formula string; and unit_energy equal to J.

Exam and LMS auto-grading

Mark pendulum energy items with a deterministic oracle that rejects negative length and angles beyond amplitude as invalid_input, never inventing negative KE.

Can the current angle exceed the amplitude?

No. Absolute angle_deg must not exceed absolute amplitude_deg. Outside that range the free-swing model would require negative kinetic energy, so the request is rejected.

What units does the API use?

SI by default: length in metres, mass in kilograms, angles in degrees from vertical, g in m/s² (default 9.81). Energies are in joules and speed in m/s when those units are used.

What does the pendulum energy calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →