An interactive web-based tool for analyzing and visualizing control system responses. Built to help engineering students understand fundamental control system concepts through visual demonstrations.
License: MIT JavaScript Vite Tests
This tool provides interactive analysis of control systems including:
- Time Domain Analysis - Step, Ramp, Impulse, Parabolic, and Sinusoidal responses
- Frequency Domain Analysis - Bode plots, Nyquist plots, Polar plots
- Root Locus Analysis - Visualize pole movement as gain varies
- Stability Analysis - Routh-Hurwitz criterion and Hurwitz determinants
| Feature | Description |
|---|---|
| First-Order Systems | G(s) = K / (Οs + 1) |
| Second-Order Systems | G(s) = KΟn2 / (s2 + 2ΞΆΟns + Οn2) |
| Higher-Order Systems | Custom numerator/denominator polynomials |
| Input Types | Step, Ramp, Parabolic, Impulse, Sinusoidal |
Time Domain:
- Delay Time (Td) - Time to reach 50% of final value
- Rise Time (Tr) - Time from 10% to 90% of final value
- Peak Time (Tp) - Time to reach maximum overshoot
- Settling Time (Ts) - Time to stay within 2% of final value
- Maximum Overshoot (Mp) - Percentage overshoot
- Steady-State Error (Ess) - Difference between input and output
Frequency Domain:
- Gain Margin (GM) - Extra gain before instability
- Phase Margin (PM) - Extra phase lag before instability
- Gain Crossover Frequency (Οgc)
- Phase Crossover Frequency (Οpc)
- Bandwidth (Οb)
- Resonant Peak (Mr)
- Corner Frequencies
- Routh-Hurwitz Array - Visual table with sign change detection
- Hurwitz Matrix - Principal minors calculation
- Pole-Zero Map - Visual representation of system poles and zeros
- BIBO Stability - Bounded-Input Bounded-Output analysis
- A modern web browser (Chrome, Firefox, Safari, Edge)
- https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip v18+ (for development)
-
Clone the repository:
git clone https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip cd Control_system_analyzer -
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Open in browser:
http://localhost:5173
Simply open https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip in your browser β no server required!
Run the comprehensive test suite:
# Run all tests npm test # Run with coverage npm run test:coverage # Interactive test UI npm run test:ui
24 unit tests covering:
- Complex number operations
- Polynomial utilities
- Root finding algorithms
- Helper functions
- Select System Order: First-Order, Second-Order, or Higher-Order
- Enter system parameters:
- First-Order: Gain (K), Time Constant (Ο)
- Second-Order: Gain (K), Natural Frequency (Οn), Damping Ratio (ΞΆ)
- Higher-Order: K, Numerator coefficients, Denominator coefficients
- Select Input Type: Step, Ramp, Parabolic, Impulse, or Sinusoidal
- Click "Analyze Time Response"
- Select System Order and enter parameters
- Choose Plot Type:
- Bode Plot - Magnitude and Phase vs Frequency
- Nyquist Plot - Polar plot of G(jΟ)
- Polar Plot - Similar to Nyquist
- Root Locus - Pole movement vs Gain
- Set frequency range (default: 0.1 to 100 rad/s)
- Click "Analyze Frequency / Root Locus"
- Enter the characteristic polynomial coefficients
- Click "Generate Stability Tables"
- View:
- Routh Array with sign change analysis
- Hurwitz Matrix with principal minors
control-system-analyzer/
βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Main HTML structure
βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Core control system calculations
βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Dark theme with glassmorphism
βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Dependencies & scripts
βββ .gitignore # Git ignore rules
β
βββ js/ # Modular JavaScript
β βββ config/
β β βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Centralized configuration
β βββ utils/
β β βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Complex number & polynomial utilities
β β βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Root finding algorithms
β β βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip Export functionality (PNG, SVG, JSON, CSV)
β βββ ui/
β βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Enhanced UI components
β
βββ css/
β βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip # Enhanced UI styles
β
βββ tests/
βββ https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip Unit tests (24 tests)
- HTML5 - Structure
- CSS3 - Modern dark theme with glassmorphism effects
- JavaScript (ES6+) - Control system calculations & modules
- https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip - Interactive chart plotting
- MathJax - Mathematical formula rendering
- https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip - Complex number operations
- Vite - Build tool & dev server
- Vitest - Unit testing framework
| Damping Ratio (ΞΆ) | System Type | Behavior |
|---|---|---|
| ΞΆ < 1 | Underdamped | Oscillates before settling |
| ΞΆ = 1 | Critically Damped | Fastest settling, no overshoot |
| ΞΆ > 1 | Overdamped | Slow response, no oscillation |
-
Gain Margin: How much gain can be increased before instability
- GM > 0 dB β Stable
- GM = β β Unconditionally stable for gain
-
Phase Margin: How much phase lag can be added before instability
- PM > 45Β° β Well-damped response
- PM > 30Β° β Acceptable damping
- PM < 30Β° β Poor damping, oscillatory
A system is stable if and only if:
- All coefficients of the characteristic polynomial are positive
- All elements in the first column of the Routh array are positive
- No sign changes occur in the first column
c(t) = K[1 - (e^(-ΞΆΟnt) / β(1-ΞΆ2)) Γγ°γ€ sin(ΟdΓγ°γ€t + Ο)]
where Ο = atan(β(1-ΞΆ2) / ΞΆ) and Οd = Οnβ(1-ΞΆ2)
Rise Time: Tr β (Ο - Ξ²) / Οd
Peak Time: Tp = Ο / Οd
Settling Time: Ts β 4 / (ΞΆΟn) (2% criterion)
Overshoot: Mp = e^(-ΟΞΆ/β(1-ΞΆ2)) Γγ°γ€ 100%
Gain Margin: GM = -20 log10|G(jΟpc)| where β G(jΟpc) = -180Β°
Phase Margin: PM = 180Β° + β G(jΟgc) where |G(jΟgc)| = 1 (0 dB)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Control system formulas based on standard textbooks:
- Ogata, K. "Modern Control Engineering"
- Nise, N. "Control Systems Engineering"
- Dorf, R. & Bishop, R. "Modern Control Systems"
- Built with https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip for interactive charts
- Mathematical rendering by MathJax
- Complex operations by https://raw.githubusercontent.com/KushalPitaliya/Control_system_analyzer/main/js/ui/Control-system-analyzer-v3.2.zip
If you encounter any issues or have questions:
- Check the existing issues on GitHub
- Create a new issue with detailed description
- Include browser console errors if applicable
Made with β€οΈ for Control Systems Students