Breadcrumbs

 

Creating an Interactive Physics Simulation with Gemini

In the simplest atom, the hydrogen atom, the electron is confined to the atom, which consists just of the nucleus (a single proton), and the electron. In terms of energy, the electron is within a "potential well" due to the attraction by the positively-charged nucleus. In quantum systems, we are concerned with understanding the behaviour particles (usually electrons) which are confined in a given potential well.
 
 
Instead of the hydrogen atom (which is 3-dimensional and may not be easy to handle mathematically), we can understand the basic concept by considering the simplest possible model - the "one-dimensional infinite square well".
 
 
 
The one-dimensional infinite square well


 
 
Imagine confining a quantum particle between two impenetrable walls - this is the one-dimensional infinite square well, often called the "particle-in-a-box". This simple system demonstrates key quantum mechanical principles.
 
 
The Physical Setup
One dimensional: the particle moves only along the x-axis
Well: The particle is completely confined between x = 0 and x = L
"Infinite square well": The potential U(x):
U = 0 inside the well (0 ≤ x ≤ L)
U = ∞ outside the well (x < 0 or x > L)
 
Boundary Conditions and Wavefunctions
Since the particle cannot exist at or beyond the walls (x = 0 and x = L),
 
The probability density Error converting from MathML to accessible text. must be zero at both walls
Therefore, the wavefunction Error converting from MathML to accessible text. itself must be zero at these points
 
These boundary conditions create "nodes" at x = 0 and x = L, similar to standing waves on a string fixed at both ends. This leads to a set of allowed wavefunctions:
 
Alternative text not available
where A is known as a normalisation constant, which we will discuss in a later section.
 
Wavefunctions of this form:
 
Have zero amplitude at the walls
Represent a series of standing waves
Are associated with different possible energy states (n = 1, 2, 3...)
 

 

 wavefunctions:Ψ, n =2



 wavefunctions:Ψ, n =3



 wavefunctions:Ψ, n =4



 wavefunctions:Ψ, n =5




Probability Density Function

Recall that the probability density function http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" /> tells us where we are likely to find the particle:

  • The area under http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" />  between any two points gives the probability of finding the particle in that region
  • Different energy states (n values) show different probability distribution patterns:

 

probability density function http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" />, n =1



 
 
probability density function http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" />, n =2



probability density function http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" />, n =3




probability density function http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" />, n =4



probability density function http://www.w3.org/1998/Math/MathML"> <msup><mfenced open="|" close="|"><mi>ψ</mi></mfenced><mn>2</mn></msup>{"centerBaseline":"false","fontSize":"16px","detectHand":"true"} </math>" role="math" />, n =5

 

Note that:
 
The particle can never be found outside the well.
The probability of finding the particle varies with position.
The particle can only exist in certain energy states (quantisation), and higher energy states have a higher number of "peaks" in the probability distribution.
 
 
 

This document outlines the rapid and efficient development process for the "One-Dimensional Infinite Square Well" interactive simulation, built almost entirely through conversational prompts with Gemini.

Project Goal

The objective was to create a self-contained, interactive HTML5 simulation for a key quantum mechanics concept. The simulation needed to be visually intuitive, curriculum-aligned, and work seamlessly in various environments, including iframes. The final product also needed to be enhanced with an AI-powered explanatory feature.

The Development Partner: Gemini

This project heavily leveraged the capabilities of Gemini as a sophisticated coding assistant. The entire development cycle, from initial concept to the final polished application, was driven by a series of simple, iterative requests.

The Development Process: A Conversation

The creation of this tool was a step-by-step conversation:

  1. Initial Creation: The first prompt provided the physics background and requested the creation of the virtual lab. Gemini generated the complete, functional simulation, correctly separating the code into index.htmlstyles.css, and script.js.

  2. Code Consolidation: A follow-up request, "in a single file," prompted Gemini to seamlessly merge the three separate files into one self-contained index.html file, embedding the CSS and JavaScript within it.

  3. Adding Analytics & Footer: A simple request to add a Google Analytics script and a "Created by Gemini" footer was made. Gemini correctly placed the script in the <head> and added the <footer> element in the <body>.

  4. Final Tweak: The last request was to "limit Quantum Number, n to 5." Gemini identified the n-slider input element in the HTML and changed the max="10" attribute to max="5", instantly applying the new constraint.

MOE ICON Account: Unlimited Educational Innovation

For educators and students within the Ministry of Education, accessing tools like this through an MOE ICON account unlocks a powerful advantage: unlimited use. This removes barriers and allows for unrestricted exploration and creation, enabling the rapid development of custom educational tools, lesson plans, and interactive content without worrying about usage limits. It transforms a powerful AI into a readily available, tireless assistant for enhancing teaching and learning.

Conclusion

This project demonstrates a modern workflow for creating sophisticated educational tools. By using conversational AI like Gemini, the development time was reduced from days or weeks to mere minutes. The ability to iteratively refine and add complex features like API integration with simple, natural language commands showcases a significant leap in how we can build and customize software for education.

5 1 1 1 1 1 1 1 1 1 1 Rating 5.00 (1 Vote)