sdof_simulator / project.md
Javedalam's picture
Upload 6 files
27be395 verified

Interactive SDOF Vibration Simulator

Overview

The Interactive SDOF Vibration Simulator is a web-based educational tool designed to help students and engineers visualize the dynamics of a Single-Degree-of-Freedom (SDOF) system. It provides real-time simulation and visualization of how a mass-spring-damper system responds to external forces and initial conditions.

Key Features

1. Real-Time Simulation

  • Powered by a custom Runge-Kutta 4th Order (RK4) solver for high accuracy.
  • Solves the differential equation: $m\ddot{u} + c\dot{u} + ku = F(t)$.
  • Updates continuously as you adjust parameters.

2. Interactive Controls

Adjust system parameters on the fly with responsive sliders:

  • System Properties: Mass ($m$), Stiffness ($k$), Damping Coefficient ($c$).
  • Forcing: Force Amplitude ($F_0$), Forcing Frequency ($p$).
  • Initial Conditions: Initial Displacement ($u_0$), Initial Velocity ($v_0$).

3. Dynamic Visualization

  • Animated Diagram: A physics-based SVG representation of the mass, spring, and damper that moves in sync with the simulation.
  • Live Plots: Real-time time-history graphs for Displacement ($u$) and Velocity ($\dot{u}$).

4. Instant Analysis

Automatically calculates and displays key system characteristics:

  • Natural Frequency ($\omega_n$)
  • Damping Ratio ($\zeta$)
  • Damping Regime: Automatically classifies the system as Underdamped, Critically Damped, or Overdamped.

Technical Details

  • Frontend: Pure HTML5, CSS3, and Vanilla JavaScript.
  • Styling: Modern, responsive dark-mode design using CSS Variables and Flexbox/Grid.
  • Performance: Optimized canvas rendering for smooth 60fps plotting.
  • No Dependencies: Runs entirely in the browser without external libraries.

Usage

  1. Open index.html in a modern web browser.
  2. Use the sliders on the left to modify the system.
  3. Observe the diagram and plots update instantly.
  4. To simulate Free Vibration, set the Forcing Amp ($F_0$) to 0 and adjust the Initial Displacement or Velocity.