A discrete-time simulation framework for exploring feedback control, system stability, oscillation, and regulation tradeoffs under dynamic load.
This project models how systems respond to changing demand and how different control strategies influence stability, responsiveness, and backlog growth.
Many real-world systems must adjust capacity in response to changing load:
- Autoscaling infrastructure
- Congestion control in networks
- Resource allocation systems
- Feedback-regulated services
Poor control can lead to:
- runaway backlog
- oscillation
- over-correction
- under-reaction
- instability
This simulator provides a controlled environment for studying those dynamics.
The system includes:
- Time-varying incoming load
- Finite worker capacity
- Queue buildup when demand exceeds processing
- Feedback-based worker adjustment
- Multiple control strategies
- System state tracking over time
- Fixed worker count
- No adaptation to changing load
- Demonstrates uncontrolled backlog growth
- Large worker adjustments when queue deviates from target
- Fast reaction to pressure
- Risk of oscillation and jitter
- Gradual worker adjustments
- Smoother response to load changes
- More stable but slower to correct
- What happens when systems do not adapt to load?
- How does aggressive correction affect stability?
- Can smoother control reduce oscillation?
- What tradeoffs exist between responsiveness and stability?
- Queue depth over time
- Worker count over time
- Maximum queue buildup
- Capacity adjustment behaviour
- Stability vs oscillation patterns
| Strategy | Stability | Responsiveness | Behaviour |
|---|---|---|---|
| None | Poor | None | Runaway backlog |
| Aggressive | Medium | High | Fast but jittery |
| Damped | Better | Medium | Smoother regulation |
control-loop-stability-simulator/
├── sim/
│ ├── engine.py
│ ├── system_model.py
│ ├── controller.py
│ └── metrics.py
├── scripts/
│ ├── run_experiment.py
│ └── plot_results.py
├── results/
├── README.md
└── requirements.txt
python3 -m venv venv
source venv/bin/activate
pip install matplotlibpython -m scripts.run_experiment
python -m scripts.plot_results
Results will be saved in the results/ folder.
Possible next steps:
- Proportional–Integral–Derivative (PID) controllers
- Worker scaling delay and spin-up time
- Noisy or stochastic load patterns
- Target queue tuning
- Oscillation amplitude measurement
- Stability scoring metrics
- Predictive control strategies
This project is part of a systems engineering portfolio exploring:
- System behaviour under dynamic load
- Feedback regulation mechanisms
- Stability vs responsiveness tradeoffs
- Control strategy design
It is designed as an experimental learning and research tool rather than a production system.
MIT

