Taps: 0

Simple Harmonic Motion

Interactive Presentation with Animations

Welcome to the SHM Simulation

Simple Harmonic Motion (SHM) is a fundamental concept in physics that describes the oscillatory motion of systems where the restoring force is directly proportional to the displacement. This type of motion is ubiquitous in nature and technology.

In this interactive presentation, we'll explore the mathematical foundations of SHM, visualize the relationships between displacement, velocity, and acceleration, and verify the phase differences through Python simulation.

Oscillatory Motion Phase Relationships Python Simulation Visualization

Mathematical Foundation

Explore the governing equations of SHM and understand the relationships between displacement, velocity, and acceleration.

Phase Analysis

Discover the constant phase relationships in SHM and how they manifest in oscillatory systems.

Python Simulation

Implement SHM equations in Python and visualize the results with interactive plots and animations.

Real-World Applications of SHM

Pendulum Clocks

The regular swinging of a pendulum in clocks is a classic example of SHM, providing accurate timekeeping.

Musical Instruments

Vibrating strings in instruments like guitars and violins exhibit SHM, producing musical tones.

Vehicle Suspensions

Car suspension systems use springs that follow SHM principles to absorb shocks and provide comfort.

Earthquake Engineering

Buildings are designed to withstand seismic waves, which often exhibit SHM characteristics.

Our Team

Meet the Team

1

Introduction

Project Overview

2

What is SHM?

Basics & Objectives

3

Equations

Governing Theory

4

Phase Theory

Relationships

5

Python Setup

Code Foundation

6

Implementation

Calculation & Plot

7

Results

Visual Analysis

8

Verification

Phase Confirmation

9

Phase Shift

Impact Analysis

10

Conclusion

Key Findings

→ Next Page

← Previous Page

Space or click to advance

Tap anywhere to create interactive boxes!

Student Information

Meet our dedicated team members

Md. Amir Hamja

ID: 252-15-608

Computer Science & Engineering

252-15-608@diu.edu.bd

PHY 101 Course

Sadiqur Rahman Emon

ID: 252-15-623

Computer Science & Engineering

252-15-623@diu.edu.bd

PHY 101 Course

Israt Jahan Isme

ID: 252-15-591

Computer Science & Engineering

252-15-591@diu.edu.bd

PHY 101 Course

Abdullah Al Tahmid

ID: 252-15-597

Computer Science & Engineering

252-15-597@diu.edu.bd

PHY 101 Course

Ahnaf Hadid Arian

ID: 252-15-589

Computer Science & Engineering

252-15-589@diu.edu.bd

PHY 101 Course

Team Project - Simple Harmonic Motion Visualization

Simple Harmonic Motion (SHM) Simulation

Modeling Displacement, Velocity, and Acceleration

Course Information

  • Computer Science & Engineering
  • PHY101: Physics I
  • Daffodil International University
  • Fall ,2025

Exploring phase relationships and oscillatory behavior through mathematical modeling and Python simulation

Current Date: 2025-11-17

Python Simulation
Press → or click to continue

What is Simple Harmonic Motion?

Definition

Simple Harmonic Motion (SHM) is a type of periodic oscillation where the restoring force is:

Directly proportional to the displacement from equilibrium

F = -kx

Hooke's Law: Restoring force is proportional to displacement

Project Objectives

  • Model the Motion

    Create mathematical models for displacement, velocity, and acceleration in SHM

  • Visualize the Data

    Plot and analyze the sinusoidal patterns of displacement, velocity, and acceleration

  • Analyze Phase Relationships

    Verify the phase differences between displacement, velocity, and acceleration

  • Explore Phase Shifts

    Investigate how initial conditions affect the oscillation

SHM Theory: Governing Equations

Displacement (x(t))

x(t) = A cos(ωt + φ)

Position as a function of time

Velocity (v(t))

v(t) = -Aω sin(ωt + φ)

First derivative of displacement

vmax = Aω

Acceleration (a(t))

a(t) = -Aω² cos(ωt + φ)

Second derivative of displacement

amax = Aω²

Key Parameters

A

Amplitude

Maximum displacement from equilibrium

ω

Angular Frequency

Rate of oscillation (rad/s)

t

Time

Elapsed time

φ

Phase Constant

Initial position (radians)

Theoretical Phase Relationships

Phase Differences in SHM

The mathematical equations of SHM reveal constant phase relationships between displacement, velocity, and acceleration:

Displacement (x) and Velocity (v):

Velocity leads displacement by π/2 radians (90°)

Velocity (v) and Acceleration (a):

Acceleration leads velocity by π/2 radians (90°)

Displacement (x) and Acceleration (a):

Acceleration is π radians (180°) out of phase with displacement

These phase relationships are inherent in the mathematical forms and remain constant throughout the motion.

Visualizing Phase Relationships

Displacement (x)
Velocity (v)
Acceleration (a)

Physical Significance

These phase relationships reveal the dynamic nature of SHM, showing how the quantities relate to each other throughout the oscillation cycle.

Python Simulation Setup

Environment Setup

The simulation relies on two essential Python libraries:

Numpy

For efficient numerical operations

Matplotlib.pyplot

For generating plots

Import statements:

import numpy as np
import matplotlib.pyplot as plt

Python 3.x is recommended for this simulation

Parameter Definition

Key physical and simulation parameters:

A = 1.0       # Amplitude (m)
f = 0.5       # Frequency (Hz)
omega = 2 * np.pi * f # Angular frequency (rad/s)
phi = 0       # Phase constant (rad)
t_max = 10    # Total time (s)
num_points = 500
t = np.linspace(0, t_max, num_points) # Time array
A = 1.0 m

Maximum displacement

f = 0.5 Hz

Oscillation frequency

ω = π rad/s

Angular frequency

t_max = 10 s

Total simulation time

Implementation: Calculation and Plotting

Python Implementation

# Calculate displacement, velocity, and acceleration
x = A * np.cos(omega * t + phi)
v = -A * omega * np.sin(omega * t + phi)
a = -A * omega2 * np.cos(omega * t + phi)
# Create figure
plt.figure(figsize=(10, 8))
# Plot displacement
plt.subplot(3, 1, 1) # 3 rows, 1 column, 1st plot
plt.plot(t, x, label='Displacement (x)')
plt.ylabel('Displacement (m)')
plt.title('Simple Harmonic Motion')
plt.grid(True)
plt.legend()
# Plot velocity
plt.subplot(3, 1, 2) # 2nd plot
plt.plot(t, v, color='orange', label='Velocity (v)')
plt.ylabel('Velocity (m/s)')
plt.grid(True)
plt.legend()
# Plot acceleration
plt.subplot(3, 1, 3) # 3rd plot
plt.plot(t, a, color='red', label='Acceleration (a)')
plt.xlabel('Time (s)')
plt.ylabel('Acceleration (m/s²)')
plt.grid(True)
plt.legend()
plt.tight_layout()
plt.show()

Code Explanation

Calculations

Displacement, velocity, and acceleration are calculated using the SHM equations derived from Hooke's Law.

Plot Structure

Three subplots are created to visualize each quantity. Each plot has appropriate labels and a legend.

Visual Customization

Color coding distinguishes between the three quantities (blue for displacement, orange for velocity, red for acceleration).

Grid and Layout

Grid lines enhance readability, and tight_layout() ensures proper spacing.

Simulation Results: Visual Analysis

The Python simulation generated three sinusoidal curves representing displacement, velocity, and acceleration over time for an oscillating system with:

Displacement: x(t) = cos(πt)
Velocity: v(t) = -πsin(πt)
Acceleration: a(t) = -π²cos(πt)

Displacement (x)

Amplitude: 1.0 m

Velocity (v)

Max: π m/s

Acceleration (a)

Max: π² m/s²

Key Observations

All three quantities exhibit pure sinusoidal patterns

Displacement and velocity are π/2 radians out of phase

Acceleration leads displacement by π radians

Phase Verification

The simulation confirms the theoretical phase relationships between displacement, velocity, and acceleration in SHM:

Displacement (x) & Velocity (v)

When displacement reaches max amplitude, velocity is zero

When displacement crosses zero, velocity reaches max

Velocity leads displacement by π/2 radians (90°)

Velocity (v) & Acceleration (a)

When velocity reaches max amplitude, acceleration is zero

When velocity is zero, acceleration reaches max

Acceleration leads velocity by π/2 radians (90°)

Displacement (x) & Acceleration (a)

When displacement is max positive, acceleration is max negative

When displacement is max negative, acceleration is max positive

Acceleration is π radians (180°) out of phase with displacement

These visual observations directly confirm the theoretical phase differences derived from the mathematical equations of SHM

Impact of Phase Shift

How Phase Constant Affects SHM

The initial phase constant (φ) in the SHM equations:

x(t) = A cos(ωt + φ)
v(t) = -Aω sin(ωt + φ)
a(t) = -Aω² cos(ωt + φ)

Effect on Curves:

  • Positive φ: Shifts all curves to the left

  • Negative φ: Shifts all curves to the right

Key Insight

Despite the horizontal shifts, the relative phase relationships remain constant:

  • Velocity leads displacement by 90°

  • Acceleration leads velocity by 90°

Visualizing Phase Shifts

Displacement
Velocity
Acceleration
φ defines initial state, not relationships

Conclusion and Key Findings

Project Summary

This project successfully modeled Simple Harmonic Motion (SHM) using Python, providing a clear simulation of displacement, velocity, and acceleration. The visualization accurately depicted the sinusoidal nature of these quantities and effectively verified their constant phase relationships, thereby aligning with established physical theory.

Successful Modeling

Python code successfully generated sinusoidal patterns for displacement, velocity, and acceleration, accurately representing SHM behavior.

Phase Relationship Verification

Analysis confirmed theoretical phase differences: velocity leads displacement by 90°, acceleration leads velocity by 90°, and acceleration is 180° out of phase with displacement.

Phase Shift Impact

Initial phase constant (φ) shifts all curves horizontally but does not alter the fundamental phase relationships between displacement, velocity, and acceleration.

Simulation Technique

The project effectively used Python with NumPy for calculations and Matplotlib for visualization, creating an intuitive understanding of SHM behavior.

Theory

Simulation

Analysis

Insight

Thank You!

We hope this presentation provided valuable insights into Simple Harmonic Motion

✓