Logo Lanfrica

diawbirane10-lgtm/ufls-smartgrid-onee-senelec

Domaine:

environment and energydigital infrastructure

Type de record:

software
Créateur:
dia
Hôte:
Under-frequency load shedding (UFLS) relay for Smart Grid — MATLAB/Simulink/Stateflow, ONEE (Morocco) & SENELEC (Senegal) case studies # Smart-Grid UFLS Relay — ONEE & SENELEC System-level model of an under-frequency load shedding (UFLS) relay applied to two African grid cases: the ONEE interconnected system (Morocco) and the SENELEC system (Senegal). The project combines aggregated frequency-power dynamics, a droop-based governor, secondary AGC action, and a timed-threshold Stateflow automaton. Full reports: French · English ## Architecture - **Grid dynamics** (`modules/grid_dynamics.m`): aggregated swing equation around 50 Hz, droop governor with time constant `Tg`, primary reserve saturated by `P_gov_max`, slow AGC integration. - **UFLS automaton** (`modules/ufls_automaton.m`): six states — `NORMAL`, `ALERT`, `SHED1`, `SHED2`, `SHED3`, `RESTORE` — with confirmation delays on each shedding threshold and a minimum hold time before restoration. - **Case parameters** (`params/params_ONEE.m`, `params/params_SENELEC.m`): inertia, damping, droop, shedding thresholds and collapse limits for each network. - **Stateflow models** (`sf_ufls_onee.slx`, `sf_ufls_senelec.slx`): programmatically generated Simulink models with a real Stateflow chart for the relay, built by `build_stateflow.m`. ## Running the simulation Two simulation paths are provided: 1. **Pure MATLAB loop** — `run_all.m` runs both cases, calling `main_simulation.m`, `postprocess.m` and `validate_project.m`, and writes results to `results/`. 2. **Simulink/Stateflow models** — `build_stateflow.m` generates `sf_ufls_onee.slx` and `sf_ufls_senelec.slx`, which can be opened and simulated directly in Simulink to visualize the relay's states and transitions. ## Validation `validate_project.m` checks, for both cases: finite logged signals, absence of frequency collapse, UFLS triggering, return to the restored state, state bounds, and governor limits. Results are logged to `results/validation/`. ## Results summary | Case | f nadir | t nadir | Max shedding | Final shedding | Collapse | Restored | |---|---|---|---|---|---|---| | ONEE | 48.956 …

Licenses