Ball and Spring Model
Page created by Ashley Fleck.
The interactions of atoms can be modeled using balls to represent the atoms and a spring to represent the chemical bond between them.
scene.title = "Ball and Spring Model of Matter\n" scene.width = 900 scene.height = 600 scene.background = color.white
scene.append_to_caption("""
Ball and Spring Model of Matter
Jayani Mannam — Spring 2026
1. Introduction
The ball and spring model of matter is a simplified model used to understand how atoms in a solid interact with each other. In this model, atoms are represented as balls, and the bonds between atoms are represented as springs.
Although real atoms are not literally connected by tiny mechanical springs, this model is useful because it captures an important physical idea: when atoms are displaced from their equilibrium positions, forces act to restore them.
This model is especially helpful for understanding vibration, elasticity, wave motion, and energy storage in matter. It also connects microscopic motion to macroscopic material properties.
At the microscopic level, atoms in solids vibrate around stable positions. At the macroscopic level, those vibrations help explain material stiffness, sound propagation, heat transfer, and elastic deformation.
scene.append_to_caption("""
2. Hooke's Law
The main equation behind the model is:
F_spring = -k Δs
where:
- F_spring = restoring force
- k = spring constant
- Δs = displacement from equilibrium
The negative sign means the force acts opposite the displacement.
If the atom moves right, the spring pulls left. If the atom moves downward, the spring pulls upward.
For a vertical spring:
F_spring = -k(L - L0)L_hat
where:
- L = current spring length
- L0 = natural spring length
- L_hat = unit vector along spring
3. Harmonic Approximation
The model works best for small displacements.
Real atomic forces are more complex, but near equilibrium the potential energy curve behaves like a parabola.
That is why Hooke's Law gives a good approximation for vibrating atoms.
""")
Mass-Spring System Simulation
Overview
This project models the motion of a ball attached to a vertical spring. The top of the spring is fixed to a support, while the ball hangs from the lower end. When the ball is pulled downward and released, it oscillates because the spring pulls upward while gravity pulls downward.
The simulation uses numerical integration to update the ball’s momentum and position over small time intervals. Instead of solving the motion analytically, the computer repeatedly applies Newton’s Second Law to predict the next state of the system.
This model demonstrates how forces create acceleration, how springs store energy, and how oscillatory motion can be represented computationally.
Physical Setup
The system contains three visible objects:
- Holder – a fixed support at the top.
- Spring – connects the holder to the ball.
- Ball – the moving mass.
The values used in the simulation are:
- Unstretched spring length: [math]\displaystyle{ L_0 = 0.10 \text{ m} }[/math]
- Spring constant: [math]\displaystyle{ k = 15 \text{ N/m} }[/math]
- Ball mass: [math]\displaystyle{ m = 0.10 \text{ kg} }[/math]
- Gravitational field: [math]\displaystyle{ \vec{g} = \langle 0,-9.8,0\rangle \text{ m/s}^2 }[/math]
The ball begins slightly below equilibrium so the spring is stretched at the start.
Coordinate System
The simulation uses a 3D coordinate system:
- Positive x-direction = horizontal right
- Positive y-direction = upward
- Positive z-direction = outward/inward depth
Since the motion is vertical, most changes occur only in the y-direction.
Model 1: Position Vector
The position of the ball is tracked using a vector:
[math]\displaystyle{ \vec{r}_{ball} }[/math]
The holder also has a fixed position:
[math]\displaystyle{ \vec{r}_{holder} }[/math]
The spring vector is the displacement from the holder to the ball:
[math]\displaystyle{ \vec{L} = \vec{r}_{ball} - \vec{r}_{holder} }[/math]
This gives both the direction and length of the spring at every moment.
Model 2: Spring Length
The current spring length is the magnitude of the spring vector:
[math]\displaystyle{ |\vec{L}| = \sqrt{L_x^2 + L_y^2 + L_z^2} }[/math]
If the spring length equals [math]\displaystyle{ L_0 }[/math], the spring is unstretched.
If:
[math]\displaystyle{ |\vec{L}| \gt L_0 }[/math]
the spring is stretched.
If:
[math]\displaystyle{ |\vec{L}| \lt L_0 }[/math]
the spring is compressed.
Model 3: Hooke's Law
The spring exerts a restoring force that tries to return the spring to its natural length.
The force is:
[math]\displaystyle{ \vec{F}_s = -k(|\vec{L}| - L_0)\hat{L} }[/math]
where:
[math]\displaystyle{ \hat{L} = \frac{\vec{L}}{|\vec{L}|} }[/math]
Explanation:
- [math]\displaystyle{ k }[/math] determines spring stiffness.
- [math]\displaystyle{ (|\vec{L}| - L_0) }[/math] is the stretch/compression amount.
- [math]\displaystyle{ \hat{L} }[/math] gives the direction.
- The negative sign means the force acts opposite displacement.
If the ball is pulled downward, the spring force points upward.
Model 4: Gravity
Gravity constantly pulls the ball downward.
The gravitational force is:
[math]\displaystyle{ \vec{F}_g = m\vec{g} }[/math]
Substituting values:
[math]\displaystyle{ \vec{F}_g = (0.10)\langle0,-9.8,0\rangle }[/math]
[math]\displaystyle{ \vec{F}_g = \langle0,-0.98,0\rangle \text{ N} }[/math]
This force remains constant throughout the simulation.
Model 5: Net Force
The total force on the ball is the sum of spring force and gravity:
[math]\displaystyle{ \vec{F}_{net} = \vec{F}_s + \vec{F}_g }[/math]
This determines how the ball accelerates.
Cases:
- If spring force is larger than gravity, the ball accelerates upward.
- If gravity is larger, the ball accelerates downward.
- If forces balance, acceleration is zero.
Model 6: Newton's Second Law
Newton’s Second Law states:
[math]\displaystyle{ \vec{F}_{net} = m\vec{a} }[/math]
So acceleration is:
[math]\displaystyle{ \vec{a} = \frac{\vec{F}_{net}}{m} }[/math]
Rather than directly solving for acceleration each time, the program updates momentum.
Model 7: Momentum Principle
Momentum is:
[math]\displaystyle{ \vec{p} = m\vec{v} }[/math]
The Momentum Principle gives:
[math]\displaystyle{ \Delta \vec{p} = \vec{F}_{net}\Delta t }[/math]
So each loop:
[math]\displaystyle{ \vec{p}_{new} = \vec{p}_{old} + \vec{F}_{net}\Delta t }[/math]
This is the main physics engine of the simulation.
Model 8: Position Update
Velocity is found from momentum:
[math]\displaystyle{ \vec{v} = \frac{\vec{p}}{m} }[/math]
Then position updates as:
[math]\displaystyle{ \vec{r}_{new} = \vec{r}_{old} + \vec{v}\Delta t }[/math]
Substituting velocity:
[math]\displaystyle{ \vec{r}_{new} = \vec{r}_{old} + \left(\frac{\vec{p}}{m}\right)\Delta t }[/math]
This allows the ball to move frame by frame.
Model 9: Numerical Integration
The simulation does not solve one large equation for all time. Instead, it uses many tiny time steps:
[math]\displaystyle{ \Delta t = 0.01 \text{ s} }[/math]
For each step:
- Calculate spring vector
- Calculate spring force
- Calculate gravity
- Find net force
- Update momentum
- Update position
- Redraw spring
This method is called Euler-Cromer style numerical integration.
Smaller time steps improve accuracy.
Model 10: Oscillatory Motion
Because the spring force always points toward equilibrium, the ball repeatedly moves up and down.
Sequence:
- Ball released downward
- Spring pulls upward
- Ball speeds upward
- Ball passes equilibrium
- Gravity and spring slow it
- Ball reverses
- Motion repeats
This creates periodic motion.
Model 11: Equilibrium Position
Equilibrium occurs when:
[math]\displaystyle{ \vec{F}_s + \vec{F}_g = 0 }[/math]
In magnitude form:
[math]\displaystyle{ k\Delta L = mg }[/math]
So:
[math]\displaystyle{ \Delta L = \frac{mg}{k} }[/math]
Substitute values:
[math]\displaystyle{ \Delta L = \frac{0.10(9.8)}{15} }[/math]
[math]\displaystyle{ \Delta L = 0.0653 \text{ m} }[/math]
So the ball hangs about 6.53 cm below the unstretched position at equilibrium.
Model 12: Energy in the System
Energy shifts between gravitational, elastic, and kinetic forms.
Spring potential energy:
[math]\displaystyle{ U_s = \frac{1}{2}k(\Delta L)^2 }[/math]
Gravitational potential energy:
[math]\displaystyle{ U_g = mgy }[/math]
Kinetic energy:
[math]\displaystyle{ K = \frac{1}{2}mv^2 }[/math]
As the ball moves:
- At highest point: mostly potential energy
- At equilibrium: maximum speed
- At lowest point: spring energy largest
Model 13: Why the Motion Continues
The ball has inertia. Even when it reaches equilibrium, it does not stop instantly because it still has momentum.
That momentum carries it past equilibrium, stretching/compressing the spring in the opposite direction. Then the restoring force reverses the motion.
This repeated exchange creates oscillation.
Model 14: Code Connection
Each major equation appears directly in the code:
Spring vector:
L = ball.pos - holder.pos
Spring force:
Fs = -k * (mag(L) - L0) * norm(L)
Gravity:
Fg = ball.m * g
Net force:
Fnet = Fs + Fg
Momentum update:
ball.p = ball.p + Fnet * dt
Position update:
ball.pos = ball.pos + (ball.p / ball.m) * dt
Spring redraw:
spring.axis = ball.pos - holder.pos
Real-World Applications
Mass-spring systems appear in many engineering designs:
- Vehicle suspension systems
- Building vibration control
- Shock absorbers
- Scales
- Seismographs
- Robotics
- Mechanical sensors
The same principles also apply to atoms vibrating in solids.
Conclusion
This simulation combines physics and computation to model oscillatory motion. By applying Hooke’s Law, gravity, Newton’s Second Law, and momentum updates repeatedly, the program predicts realistic spring motion over time.
The project shows that complex motion can be understood by breaking it into small force-based updates, making numerical modeling a powerful tool in science and engineering.
History
In the 1600's, Robert Hooke developed the idea of Hooke's Law, which states that for relatively small deformations of an object, the deformation is proportional to the force that deformed it. This lead to the development of the equation to calculate force of the spring; where it is equal to the spring stiffness multiplied by the change in length. This fundamental concept lead to other developments in Molecular Mechanics. However, the specific history for the ball-and-spring model is unknown, although the major developments in this area were accomplished in and around the 1930s and 1940s (including developments by T.L. Hill, I. Dostrovsky, and F. H. Westheimer) (6).
See also
The Ball-and-Spring model deals primarily with Kinds of Matter, Young's Modulus, Hooke's Law, and the Length and Stiffness of an Interatomic Bond.
Further reading
The Kinetics of materials is a book written by Robert W. Balluffi that goes in-depth about many different concepts, including the ball-and-spring model and Young's modulus.
The Molecular Dynamics and Spectroscopy by Stimulated Emission Pumping, written by Hai-Lung Dai and Robert W. Field, looks at a different aspect of the ball-and-spring model and determines its role in quantum eigenstate spectra.
External links
- http://www.nuffieldfoundation.org/practical-physics/model-vibrating-atoms-solid
- https://www.physics.ncsu.edu/clarke/teaching/class.html
- http://umdberg.pbworks.com/w/page/46030513/A%20simple%20model%20of%20solid%20matter
References
- http://p3server.pa.msu.edu/coursewiki/doku.php?id=183_notes:model_of_solids
- http://webs.morningside.edu/slaven/Physics/atom/atom7.html
- http://bulldog2.redlands.edu/facultyfolder/eric_hill/Phys231/Lecture/Lect%209.pdf
- http://www.matterandinteractions.org/Content/Materials/materials.html
- Chabay, Ruth W., and Bruce A. Sherwood. Matter & Interactions. 3rd ed.
- http://www.sdsc.edu/~kimb/history.html