PROJECT 03 · BUILD · 15–18 min

Build a physics app

Go from a prompt to a working investigation

Leave with
A working Swing Lab with controls you can test.

Authored example for Build a physics app

Finished example for comparison. Make your own version.

START HERE

Five steps to your first result

  1. Open Build mode

    Go to AI Studio and choose Build. Start a fresh web app in your existing eligible account.

  2. Paste the build prompt

    Request a deterministic app. The generated runtime should need no AI service or login.

  3. Use the preview

    Move length and gravity. Change mass. Pause, resume and reset. Try a keyboard control.

  4. Check three values

    At L=1 m, g=9.81 expect 2.006 s. At L=4 m expect 4.012 s. Changing mass leaves T unchanged.

  5. Make one real revision

    Add comparison mode with the follow-up prompt, or improve one explanation. Recheck affected controls.

Your starting prompt

Build a browser app called Swing Lab for a teacher-led pendulum investigation. Use deterministic physics, with no runtime AI calls, login or database. Use T = 2*pi*sqrt(L/g), with length in metres and gravity in m/s². Add length 0.25–4.00 m, gravity 1.62–20.00 m/s² and bob mass 0.10–2.00 kg sliders with visible units. Keep the small-angle amplitude at 8 degrees. Animate the bob with the calculated period. Changing mass must change the drawn bob size but not the period. Show period to three decimals, Pause/Resume and Reset. Ask learners to predict before changing a control, then record one observation. Include a keyboard-accessible text equivalent and a reduced-motion option. Explain the ideal small-angle model and its limits. Use teal, coral and plenty of white space. Show the working preview.
Download this prompt as TXT ↓

Make one revision

Keep the current physics correct. Add a comparison mode with two pendulums. Lock gravity to one shared value, give each pendulum its own length and mass, and show each period. Explain why quadrupling length doubles the period. Test the model at L=1 m and g=9.81, at L=4 m with the same gravity, and at two different masses. Report the values you checked. Do not add runtime AI calls.
Download this prompt as TXT ↓

YOUR QUALITY CHECK

Does the result hold up?

The animation and numeric period agree. Units remain visible. Four times the length gives twice the period. Mass changes size only.

Before you call it finished

Take it a little further

Swap the context: gear ratios, a resistor circuit or a projectile. Supply the governing equations and acceptance checks first.

If your tool is slow or cannot export

Open examples/swing_lab.html. It runs locally. Inspect it, then ask your tool to make one change rather than start from scratch.