Skip to content

aristeidisioan01-ops/demand_response_prog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic System Modeling & Optimization (MATLAB/Simulink)

This repository contains MATLAB scripts and Simulink models used for the modeling, simulation, and optimization of a dynamic energy system. Two different demand response (DR) schemes are implemented:

  1. Cost / CO₂ minimization:
    The Grey Wolf Optimizer (GWO) is used to minimize the objective function related to energy cost and CO₂ emissions.

  2. Loss minimization:
    The DR strategy aims at minimizing power losses in the network (power lines and transformer).


Contents

  • codes/
    MATLAB scripts and functions.

  • models/
    Simulink models (.slx).

  • results/
    Simulation results (.mat, .fig).

  • flowcharts of the 2 scenarios ('.png')

Requirements

  • MATLAB
  • Simulink
  • (Optional) Optimization / Global Optimization / Neural Network toolboxes, if required by the scripts.

How to Run

A. Base case – No demand response

  1. Open MATLAB.
  2. Run initial_conditions.m.
  3. Open and run no_demand_res.slx.
    After the simulation finishes, run no_demand_results.m to store the results.
  4. Run filter_no_signals.m to extract the correct 24-hour values for each measurement.

B. Demand response – Cost / CO₂ minimization (cost_flowchart.png)

  1. Run one of the following optimization scripts:
    • gwo_nn_comb_co2.m (CO₂-oriented objective), or
    • gwo_nn_comb_cost.m (cost-oriented objective).
  2. Open and run with_demand_res_final_v5.slx.
    After the simulation finishes, run with_demand_results.m.
  3. Run filter_with_signals.m to extract the correct 24-hour values for each measurement.
    → Cost/CO₂-minimizing DR scenario completed.

C. Demand response – Loss minimization (iterative GWO–simulation loop) (loss_flowchart.png)

  1. Close and reopen MATLAB (to clear the workspace).
  2. Run initial_conditions.m to initialize the first iteration.
  3. Open only with_demand_res_final_v5_live.slx.
  4. Run gwo_live_simulation_v2.m and wait until all simulations and the GWO optimization are completed.
  5. After completion, you will obtain:
    • loss_history_figure.fig
    • load_compar.mat
    • load_history.mat
  6. Now in order to have the simulation results from the load that minimize the losses open and run the "with_demand_res_loss_verify"
  7. Run filter_with_loss_signals.m to extract the correct 24-hour values for each measurement.
  8. Run calculate_cost_kgCO2.m to compute the total cost and CO₂ emissions for this scenario.

Comparison

  1. Compare the two DR scenarios (cost/CO₂ minimization vs. loss minimization) using the generated .mat files and figures in results/.

About

This repository contains my thesis project in which I applied demand repsonse program using matlab and simulink.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages