# Data-based Distributionally Robust Stochastic OPF Package
The distributionally robust stochastic optimal power flow (OPF) package is developed at the [Control, Optimization and Networks Laboratory](http://www.utdallas.edu/~tyler.summers/), [The University of Texas at Dallas](https://utdallas.edu/). This framework uses MATLAB to solve a multi-stage stochastic OPF problem based on limited information about forecast error distributions, which explicitly combines multi-stage feedback policies with any forecasting method and historical forecast error data. The objective is to determine power scheduling policies for controllable devices in a power network to balance operational cost and conditional value-at-risk (CVaR) of device and network constraint violations. These decisions include both nominal power schedules and reserve policies, which specify planned reactions to forecast errors in order to accommodate fluctuating renewable energy sources (RESs). Instead of assuming the uncertainties across the networks follow prescribed probability distributions, we consider ambiguity sets of distributions centered around a finite training dataset. By utilizing the Wasserstein metric to quantify differences between the empirical data-based distribution and the real unknown data-generating distribution, we formulate a multi-stage distributionally robust OPF problem to compute control policies that are robust to both forecast errors and sampling errors inherent in the dataset. This package includes two sub-packages, especially designed for distribution networks and transmission systems, respectively.
## Outline of README Documentation
* [Requirements](#requirements)
* [Package Organization](#package-organization)
* [Capabilities of framework](#capabilities-of-framework)
* [Getting Started](#getting-started)
* [Useful Tips](#useful-tips)
* [Useful Resources](#useful-resources)
* [Acknowledgement](#acknowledgement)
* [Notes](#notes)
* [License](#license)
## Requirements
* Operating System:
* Windows:
* The framework has been tested with Windows 7 and Windows 10.
* macOS:
* The framework has been tested with IOS 12.
* Software:
* MATLAB:
* This package has been tested with MATLAB R2017b and R2018a. The additional required tool boxes/solvers are:
* CVX: Disciplined convex programming for MATLAB.
* MATPOWER: A power system simulation and optimization tool for MATLAB
* For more information on these packages, please visit [CVX Research](http://cvxr.com/cvx/), and [MATPOWER](http://www.pserc.cornell.edu/matpower/).
## Package Organization
The folders of the repository are:
* DistributionNetworks
* Data-based distributionally robust stochastic OPF sub-package for distribution networks, which includes one main script and two additional functions.
1. the main script of this sub-package is `main_distribution.m`.
2. network admittance generation function is `form_admittance.m`.
3. SDP relaxation solver for optimal power flow is `getVSDP.m`.
4. Note: make sure ``CVX`` is installed properly.
* TransmissionSystems
* Data-based distributionally robust stochastic OPF sub-package for transmission systems, which includes one main script.
1. the main script of this sub-package is `main_transmission.m`.
2. Note: make sure ``MATPOWER`` and ``CVX`` are installed properly.
* CVX
* Convex optimization modeling language for MATLAB.
* MATPOWER
* A power system simulation and optimization package for MATLAB.
## Capabilities of framework
### Overvoltage problem for distribution networks
This sub-package provides a computationally-affordable chance-contrained AC OPF framework to solve an overvoltage problem for IEEE 37-node distribution network. The proposed distributionally robust stochastic OPF methodologies mitigate overvoltages by controlling set points for renewable energy resources and energy storage devices. The set points of controllable devices are repeatedly optimized over a finite planning horizon within a MPC feedback scheme. The risk conservativeness of the voltage magnitude constraints and the out-of-sample performance robustness to sampling errors are explicitly adjustable by two scalar parameters (e.g., weight factor and Wasserstein distance).
### N-1 Security problem for transmission systems
This sub-package provides a computationally-affordable chance-contrained DC OPF framework to solve a N-1 security problem for IEEE 118-bus transmission system. The proposed distributionally robust stochastic OPF will determine scheduled power output adjustments and reserve policies of generators, which specify planned reactions to wind power forecast errors in order to accommodate fluctuating renewable energy sources. The risk conservativeness of the line flow constraints and the out-of-sample performance robustness to sampling errors are explicitly adjustable by two scalar parameters (e.g., weight factor and Wasserstein distance).
## Getting Started
The framework works in principle for any forecast method. The user needs to import forecast error data into this framework, (e.g., solar power forecast scenarios for distribution networks and wind power forecast error scenarios for transmission networks). In order to run this framework, the forecast data should be organized in the following format:
### For distribution networks
Two MATLAB data files `.mat` are required in this sub-package: solar power forecast scenarios dataset and electric power loads dataset. The solar power forecast scenarios dataset will be imported in `main_distribution.m` by the command
```
load('solar.mat')
```
* three matrices contained data for different usages.
* first matrix, `PV_Real24` contains the nominal solar power forecast in kW, which defined in the dimension `PV_Real24 (Timestep,1)`.
* second matrix, `PV_Errors_MPC_S` contains forecast error scenarios of solar power within finite time horizon in kW, which defined in the dimension `PV_Errors_MPC_S (Timestep, Horizon, DRScenarios)`.
* third matrix, `PV_MC` contains scenarios of solar power output for Monte Carlo simulation in kW, which defined in the dimension `PV_MC (Timestep, MCScenarios)`.
* Note that all three matrices represent aggregated power output of PV inverters one node, the framework will do the distribution over the feeder.
Electric power loads dataset will be imported in `main_distribution.m` by the commend
```
load('load.mat')
```
* two matrices contain active power and reactive power loads for every node.
* `P_l` contains the deterministic active power loads in kW, which defined in the dimension `P_l (Nnode, Timestep)`.
* `Q_l` contains the deterministic reactive power loads in kvar, which defined in the dimension `Q_l (Nnode, Timestep)`.
The `Timestep` indicates the number of total timesteps; `DRScenarios` is the number of total scenarios for distributionally robust optimization; `MCScenarios` is the number of total scenarios for Monte Carlo simulation; `Horizon` is the finite time horizon setting of model predictive control; `Nnode` indicates the number of nodes in the distribution network.
### For transmission systems
One MATLAB data file `.mat` is required in this sub-package: wind power forecast error scenarios dataset, which will be imported in `main_transmission.m` by the command
```
load('wind.mat')
```
* three vectors contain wind power forecast error scenarios (in MW) for each individual wind farm.
* `G_error_1` contains the wind power forecast error scenarios for wind farm #1 (at bus 1), which defined in the dimension `G_error_1 (DRScenarios, 1)`.
* `G_error_2` contains the wind power forecast error scenarios for wind farm #2 (at bus 9), which defined in the dimension `G_error_2 (DRScenarios, 1)`.
* `G_error_3` contains the wind power forecast error scenarios for wind farm #3 (at bus 26), which defined in the dimension `G_error_3 (DRScenarios, 1)`.
The `DRScenarios` is the number of scenarios for distributional
Distributionally-robust-stochastic-OPF-master.zip_电力系统 调度_电力系统鲁棒
版权申诉
5星 · 超过95%的资源 91 浏览量
2022-07-15
08:30:31
上传
评论 2
收藏 18.7MB ZIP 举报
weixin_42653672
- 粉丝: 93
- 资源: 1万+