Widgets

How to Add a Double Pendulum Simulator to Your Website

LK Forge · 4 min read · Updated September 2026

You can add a full double pendulum simulator to any website, blog, or classroom page with a single line of code — free, with no sign-up, no plugin, and no script to install. Visitors press play and watch two coupled rods spin into intricate, unpredictable motion, then launch a "chaos twin" to see how a microscopic change in the start leads to a completely different path. This guide covers the fastest way to embed the Double Pendulum, what it demonstrates, and where it works.

The quickest way: paste one embed snippet

An embed is just an <iframe> that loads the simulator from lkforge.com, plus a small credit line. Copy this into your page’s HTML where you want the widget to appear:

<iframe src="https://lkforge.com/embed/double-pendulum/"
        width="100%" height="860" loading="lazy"
        style="border:0;max-width:560px"
        title="Double Pendulum by LK Forge"></iframe>
<p><a href="https://lkforge.com/tools/physics/double-pendulum/">Double Pendulum</a>
   by <a href="https://lkforge.com/">LK Forge</a></p>

The <iframe> is the live simulator; the <p> underneath is a plain credit link. Keep that line — the visible link is what keeps the widget free to embed. You can also copy this exact code straight from the LK Forge widget gallery.

What the widget shows

The simulator opens already swinging, so a visitor sees the chaotic motion immediately and can then take control:

  • Coupled motion: a rod swings from a fixed pivot and a second rod swings freely from its tip, producing the intricate, never-quite-repeating motion the double pendulum is famous for.
  • Drag to set the pose: grab either bob and release the pendulum from any starting configuration.
  • Chaos twin: launch a second pendulum a tiny angle apart and watch the tip-to-tip separation grow — a live demonstration of sensitive dependence on initial conditions.
  • Trail, gravity, damping, speed: turn on a fading trail to trace the path, and use the sliders to change the physics and how fast time runs.

Pick the right height

The snippet uses height="860", which fits the canvas, the controls and the readouts without clipping even on a narrow phone, where they stack into one column. On a wider page the widget centres within its max-width:560px. That single height works across screen sizes, so there is nothing to tweak for mobile.

Where it works

Because it is a standard iframe, the embed works anywhere you can add HTML:

  • WordPress: add a Custom HTML block and paste the snippet.
  • Squarespace: use a Code / Embed block.
  • Wix: add an Embed HTML / iframe element.
  • Ghost: insert an HTML card.
  • Notion: paste the /embed/double-pendulum/ URL and choose "Create embed".
  • Plain HTML, an intranet, or a lesson page: paste the snippet straight into the markup.

That’s the whole job. Copy the embed code from the widget gallery and paste it wherever a physics lesson or a blog post on chaos, nonlinear dynamics or the butterfly effect needs a system readers can actually set swinging.

Grab the embed code from the LK Forge widget gallery — free, no sign-up.

Open the Double Pendulum Simulator

Frequently asked questions

Is embedding the double pendulum free?
Yes. It is free to embed on any site, with no account, no API key and no usage limits. The whole simulation runs in your visitor’s own browser, so there is no server cost — we only ask that you keep the small "Double Pendulum by LK Forge" credit line that comes with the embed code.
What can visitors do with the embedded double pendulum?
They can press play to set two coupled rods swinging into intricate, unpredictable motion, drag either bob to choose a starting pose, and turn on a fading trail to see the path the tip carves out. Sliders change the gravity, damping and simulation speed, and a "chaos twin" toggle launches a second pendulum a tiny angle apart so its runaway divergence is visible.
What is the chaos twin?
The chaos twin is a second pendulum that starts from an angle offset by the tiny amount you set with the "twin offset" slider. Both obey identical rules, yet the gap between their tips — shown in the readout — grows exponentially, so within seconds they swing completely differently. That is deterministic chaos: sensitive dependence on initial conditions, the reason the double pendulum is a textbook chaos demonstration.
What iframe height should I use, especially on mobile?
The snippet ships with height="860", which is tall enough that the canvas, the play/reset/twin/trail controls, the sliders and the readouts all fit without clipping even on a narrow phone where everything stacks into a single column. On a wider page the widget simply centres within its max-width of 560px. If you want it shorter you can lower the height, but 860 is the safe default across screen sizes.
Where can I embed it — WordPress, Wix, Squarespace, Notion?
Anywhere you can add HTML, because it is a standard iframe. In WordPress use a Custom HTML block; in Squarespace a Code/Embed block; in Wix an Embed HTML element; in Ghost an HTML card; in Notion paste the /embed/double-pendulum/ URL as an embed. On a plain HTML page or an intranet, paste the snippet straight into the markup.
Does the embedded pendulum track visitors or set cookies?
No. Everything runs locally in the visitor’s browser — nothing is uploaded. The embed sets no tracking cookies and sends no analytics, so it is safe to place on a privacy-sensitive site, an intranet, or a page for students.