File size: 2,174 Bytes
27be395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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**.