Vai al contenuto
Hub Nexus

Ancora senza autorePrendila in carico

Versione 2Aggiornato 3 min di lettura

Sostegno

Physics teachers and students can now get a working simulation by describing it to a chatbot, then check it against the physics. Yossi Ben-Zion, Roi Einhorn Zarzecki and Joshua Glazer of Bar-Ilan University and Noah D. Finkelstein of the University of Colorado Boulder describe how, using three classic systems.

Why bother

Simulations help students because they are interactive, simplify a phenomenon, let learners change parameters (even stop time) and invite reflection. But building them has needed programming skill and software platforms, and the developer decides the content in advance. The authors say AI-generated simulations complement, rather than replace, polished tools such as PhET: they can fill gaps, explore edge cases and serve as a comparison.

The method

A prompt tells the model to act as a web developer and write one HTML file with a real-time animation, sliders for the system's parameters, start, pause and reset buttons, and graphs of quantities over time, working on different screen sizes. The authors ran their prompts through OpenAI's o1 and Anthropic's Claude 3.5 Sonnet. To use the result, you paste the generated code into a text editor, save it as an .html file and open it in a browser. Then you refine it by talking to the model.

Because language models give different answers to the same prompt, every simulation needs checking. The authors separate technical validation (do the controls and graphs behave?) from physical validation (does it match known analytic solutions and laws?). Students who do this check learn physics, since they compare results with theory, and the cycle of re-prompting and fixing resembles scientific inquiry. All checking can be done in plain conversation with the model.

Three examples

Basic pendulum simulation interface with the swinging pendulum, parameter sliders and graphs of angle and angular velocity over time

Basic pendulum simulation: the pendulum, sliders and graphs of angle and angular velocity.

Simple pendulum. The prompt asks for sliders for mass, length, initial angle and initial angular velocity, and an angle-versus-time graph on which the small-angle analytic solution is drawn over the numerical one, which uses Runge-Kutta methods on the full nonlinear equation. Tests: the period should match the analytic one for small angles, and the two curves should diverge as the initial angle grows, showing where the approximation fails. A debugging session with Claude fixed several problems; in one, the analytic curve showed half the right period, and the authors told the model to check the time in the function they had given. Effective prompts name the problem clearly and say exactly what to correct. An enhanced version added full rotations, a friction slider, a tension graph and energy bars.

Enhanced pendulum simulation with large-angle motion, friction, a tension graph and an energy distribution display

Enhanced pendulum simulation with large-angle dynamics, friction, tension and energy.

Ising model. A 2D lattice of spins that can point up or down, in which aligned neighbors lower the energy, used to study ferromagnetism and phase transitions. The simulation uses Metropolis Monte Carlo methods with sliders for temperature, interaction strength, magnetic field and lattice size, a heat map of spins, and live graphs of magnetization and energy. The physical tests: near the critical temperature of 2.269 (for interaction strength 1 and no field), magnetization should drop sharply; far below it, spins should align spontaneously; and an applied field should push spins to follow it.

Ising model simulation with a heat map of spins, parameter controls and graphs of magnetization and energy

2D Ising model simulation with heat map and live graphs.

Random walker. Walkers take unit steps on a 2D lattice, tracing their paths, while a graph compares the average distance from the origin with the theoretical square root of pi times n over 4 after n steps. In 3D the expected value is the square root of 8n over 3 pi. The 3D prompt in one go gave inconsistent results, so the authors built it in stages: one sphere walking, then many particles, then trails, then controls, then the statistics graph, testing each before adding the next.

Multiple random walkers on a 2D lattice with a graph comparing average distance from the origin with the theoretical prediction

2D random walkers and the average-distance graph.

3D random walk simulation with an adjustable particle count and a graph of average distance from the origin against the theoretical curve

3D random walk simulation.

The authors' conclusion

The approach lets educators build simulations matched to their course without advanced programming, and students learn both physics and the strengths and limits of language models, including the need for careful prompts. As models improve, they expect more complex simulations and less prompt engineering, and they see the method working in chemistry, biology and other fields.

Sources

Commenti

Spinner Logo

Altro su Istruzione

Di Abdul Ariwoola
Random article
Di Hub Nexus editorsLetture: 282
A demo for the Hub Nexus content editor, showing what could be created, and at the same time teaching how to create them with each syntax. It follows general markdown syntax, gfm, and more advanced like various charts and graphs code syntax.
CC BY 4.0
The second uses a matrix representation of bipartite states, in which the tensor-product structure is expressed in terms of ${}2\times 2$ complex matrices. This representation keeps the calculation close to the familiar Pauli-matrix algebra and makes the independent action of operators on each subsy
CC BY-SA 4.0
This program demonstrates how XForms can validate a data set based on the facets within and XML Schema. ## Warnings Note: This program does not run under the FireFox 0.6 extension. The X-Smiles browser was used to demonstrate this program. ## Screen Image This screen image was taken from the [X-Smil