# Electric Microgrid Particle Swarm Optimizer
Uses Binary Particle Swarm Optimization (BPSO) to solve the Unit Commitment Problem in the context of electric power generation in an idealized microgrid.
## [Use in browser (WebGL)](https://anvoker.github.io/MicrogridPSO/webgl/)
Features:
- Good performance BPSO implementation with bitwise operations.
- Premature convergence detection and correction in the form of particle craziness.
- Running multiple BPSOs in parallel on different threads (unavailable in WebGL).
- Takes into consideration realtime market prices.
- Snapshot system allows visualizing the BPSO algorithm's functioning at each iteration.
- Visualizations of the microgrid's state.
- Ability to customize data such as load curve and generator specifications.
- Importing and exporting of data as .csv files.
## Table of Contents
- [1. Unit Commitment Problem Statement](#1-unit-commitment-problem-statement)
- [2. Microgrid Model](#2-microgrid-model)
- [2.1. Microgrid State](#21-microgrid-state)
- [2.2. Battery](#22-battery)
- [2.3. Generators](#23-generators)
- [2.4. Simplifications](#24-simplifications)
- [3. Operation](#3-operation)
- [4. BPSO](#4-bpso)
- [5. PSO Visualizations](#5-pso-visualizations)
- [5.1. Radar](#51-radar)
- [5.2. Schedule Map](#52-schedule-map)
- [5.3. Convergence](#53-convergence)
- [6. Building](#6-building)
- [7. Roadmap](#7-roadmap)
## 1. Unit Commitment Problem Statement
Given a microgrid that:
- Is connected to the main grid where energy can be imported or exported at market prices.
- Has a local demand curve that needs to be satisfied.
- Has multiple heterogenous generators with operating costs and minimum uptime and minimum downtime constraints.
Find the schedule (on/off states at each time step) for the generators that will lead to the minimum costs / maximum profit for the grid over a period of 24h.
The Big O complexity of an exhaustive search is `O(2^(n*t))` where `n` is the number of generators and `t` is the number of time steps. For 3 generators and 24 time steps, the number of possible configuration is ~4.7 sexdecillions. Another way to think about it is that it exceeds the storage capacity of an Int32 by roughly 1 trillion times. Many of these states are invalid because they violate the minimum uptime and minimum downtime constraints, which effectively define how quickly a generator can be toggled.
## 2. Microgrid Model
The microgrid is modelled as having idealized:
- Renewable energy sources. Wind and solar power.
- Battery system connected to the renewable energy sources.
- Point of common coupling (PCC) with the main grid.
- Heterogenous thermal generators that can be switched on and off.
### 2.1. Microgrid State
The state of the microgrid is composed of the following variables:
- A local power demand curve. Measured in MW.
- Wind and solar power generation curves. Measured in MW.
- Battery energy curve. Represents how much energy is currently stored in the battery system in MWh.
- Battery state of charge curve. Represents how much energy stored in the battery system as a fraction of maximum energy storage.
- Energy exchange curve. Represents energy exchange in MWh with the main grid. Positive values are imports and negative values are exports.
- Generator schedules, one for each generator. Defines the on and off states of the generators at each point in time.
- Generator production curves, one for each generator. Defines how much power a generator is outputting at each point in time.
### 2.2. Battery
The battery system is modelled as having:
- A total storage capacity measured in MWh.
- A maximum power it can export or import measured in MW.
- An initial state of charge (SoC). The SoC the battery starts with at t = 0.
- A minimum and maximum SoC.
### 2.3. Generators
The thermal generators are modelled as having:
- A maximum power they can generate measured in MW.
- Cost coefficients a, b, c that define the curve of the quadratic cost equation a*P^2 + b*P + c.
- Minimum uptime. The amount of minutes the generator has to stay on before being free to be switched off.
- Minimum downtime. The amount of minutes the generator has to stay off before being free to be switched on.
### 2.4. Simplifications
- Generators can vary their power output instantly, by any amount, as long as they're already on.
- All generations have a minimum power output of zero.
- Prices are known for the entire day, but buying and selling is done as if on a realtime market. This best resembles working based off of a realtime market 24h prediction.
- Buying and selling is done instantaneously and with a granularity of one minute. In reality, realtime markets have bids and the exchange needs to be constant over a longer interval of time.
- Reactive power considerations are ignored.
- Excess renewable power is ignored as if renewable sources could instantly reduce their output or dump it.
## 3. Operation
1. Renewable energy is used first. Excess renewable energy is stored in the battery. Conversely shortages are made up by drawing power from the battery.
2. Any remaining demand has to be met either with electricity from the thermal generators or from imports.
3. The state of the grid, market prices and remaining local demand are fed into the Unit Commitment PSO algorithm that outputs the closest-to-optimal generator schedules it could find.
4. The generator schedules are fed into an algorithm that solves Economic Dispatch. The goal of this algorithm is to balance the load between all the online generators in a way that maximizes profit. The algorithm outputs the best generator production curves it could find.
5. The generator production curves are used to determine the full state of the microgrid, computing total cost and energy exchange.
## 4. BPSO
The search space is modelled as having one time dimension and n binary dimensions (one for each thermal generator). As a result, a position in this search space is represented as an array of binary integers where each row of binary integers corresponds to the on/off states of the generators at that particular time step.
``p[10, 52]`` => ``00110100`` => generators 0, 1, 4, 6, 7 are off and generators 2, 3, 5 are on.
The solution to the UC problem is a position that has the smallest cost. This cost is used as the fitness associated to a position.
Particles have:
- **A position ``p``**.
- **A velocity ``v``**.
- The fitness of the best position they've found so far **``PBestFitness``**.
- The best position they've found so far **``PBest``**.
Additionally the swarm stores:
- The fitness of the global best position **``GBestFitness``**.
- The best position found by the entire swarm so far **``GBest``**.
The BPSO algorithm utilizes a simple **PBest/GBest topology** where each particle tracks their personal best, the swarm tracks the global best and particles are attracted both towards their PBest and the swarm's GBest.
At every iteration a new velocity is calculated for the particles. The new position is obtained by XORing the current position with the new velocity.
In the velocity calculation a few factors come into play:
- There's an **inertial probability ``w``** to take the previous velocity into consideration by ORing it to the rest of the equation. This approximates how continuous space inertia works in a binary space.
- A random amount of bits are switched to move the particle towards to PBest.
- A random amount of bits are switched to move the particle towards to GBest.
- There's a **craziness probability ``c``** to XOR random noise into the velocity calculation. ``c`` goes up with each iteration that hasn't lead to a GBest update.
Notice that since we're in a binary space the magnitude of velocity is represented as a random bitmask that controls how many bits switch at a time. The particle doesn't instantly move to PBest or GBest because a random bitmask forces the change to happen to only some bits every iteration.
## 5. PSO Visualizations
##
没有合适的资源?快使用搜索试试~ 我知道了~
二元粒子群优化应用于微电网中的单元组合问题_C#_代码_下载
共630个文件
meta:315个
cs:139个
ttf:29个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 83 浏览量
2022-06-20
22:36:11
上传
评论
收藏 18.15MB ZIP 举报
温馨提示
特征: 具有按位运算的良好性能 BPSO 实现。 粒子疯狂形式的过早收敛检测和校正。 在不同的线程上并行运行多个 BPSO(在 WebGL 中不可用)。 考虑到实时市场价格。 快照系统允许在每次迭代中可视化 BPSO 算法的功能。 微电网状态的可视化。 能够自定义数据,例如负载曲线和发电机规格。 将数据导入和导出为 .csv 文件。
资源推荐
资源详情
资源评论
收起资源包目录
二元粒子群优化应用于微电网中的单元组合问题_C#_代码_下载 (630个子文件)
fadeOut.anim 5KB
fadeIn.anim 5KB
show.anim 3KB
close.anim 3KB
DropDown.anim 3KB
LiberationSans SDF.asset 2.15MB
OpenSansRegular SDF.asset 2.14MB
OpenSansBold SDF.asset 2.14MB
OpenSansSemiBold SDF.asset 2.11MB
Roboto-Regular SDF.asset 2.04MB
LiberationSans SDF - Fallback.asset 534KB
ProjectSettings.asset 20KB
EmojiOne.asset 13KB
NavMeshLayers.asset 9KB
QualitySettings.asset 6KB
InputManager.asset 6KB
Default Style Sheet.asset 5KB
GraphicsSettings.asset 4KB
Physics2DSettings.asset 2KB
TMP Settings.asset 2KB
NavMeshAreas.asset 1KB
DynamicsManager.asset 1KB
EditorSettings.asset 885B
UnityConnectSettings.asset 853B
TagManager.asset 448B
AudioManager.asset 416B
VFXManager.asset 265B
EditorBuildSettings.asset 255B
TimeManager.asset 202B
XRSettings.asset 158B
NetworkManager.asset 151B
PresetManager.asset 120B
ClusterInputManager.asset 114B
TMPro_Surface.cginc 4KB
TMPro_Properties.cginc 3KB
TMPro.cginc 2KB
NuGet.Config 158B
Window.controller 4KB
BlackBackground.controller 4KB
DropDown.controller 2KB
New Animator Controller.controller 278B
StringFormatter.cs 97KB
GraphCanvas.cs 31KB
MicrogridMisc.cs 27KB
MGHelper.cs 25KB
GraphSubscriber.cs 21KB
PSOSearch.cs 20KB
MicrogridAlgorithm.cs 14KB
RadarCanvas.cs 13KB
DataPresetPickerWindow.cs 11KB
MathHelper.cs 11KB
ExhaustiveSearch.cs 10KB
MicrogridFileInput.cs 9KB
ReplaceWithTextMesh.cs 8KB
StandaloneFileBrowser.cs 8KB
MGHelperTests.cs 7KB
RectTransformExtensions.cs 6KB
GraphInput.cs 6KB
IterationSnapshot.cs 6KB
CanvasSwitcher.cs 6KB
MathHelperTests.cs 6KB
ThermalGeneratorPresets.cs 5KB
Microgrid.cs 5KB
StandaloneFileBrowserWindows.cs 5KB
Binary.cs 5KB
StandaloneFileBrowserMac.cs 5KB
Reflection.cs 5KB
CHPGraphCanvasManager.cs 5KB
ScheduleMap.cs 5KB
DropDownControl.cs 5KB
StandaloneFileBrowserLinux.cs 5KB
BasicSample.cs 4KB
CSVHelper.cs 4KB
Graph.cs 4KB
Factory.cs 4KB
ToolTip.cs 4KB
Radar.cs 4KB
DataTable.cs 4KB
AlgorithmData.cs 3KB
DataTableSourceGenerators.cs 3KB
AlgorithmSwapper.cs 3KB
ThermalGeneratorEntry.cs 3KB
DataRow.cs 3KB
fgCSVReader.cs 3KB
TimelineSlider.cs 3KB
PSOTimeline.cs 3KB
PSOSearchSettings.cs 3KB
EDCanvasManager.cs 3KB
GraphLegend.cs 3KB
MicrogridInputFields.cs 3KB
PSOProgressEventArgs.cs 3KB
UIPopup.cs 3KB
CHPPlantData.cs 3KB
WindowsController.cs 2KB
PopupController.cs 2KB
StandaloneFileBrowserEditor.cs 2KB
RadarArray.cs 2KB
ThermalGeneratorPickerWindow.cs 2KB
MiscUtils.cs 2KB
ScheduleTextureHelper.cs 2KB
共 630 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9153
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【后端开发框架】教程&案例&相关项目
- setup asdfasfd
- 信号与系统、数字信号处理、通信原理等课程内容及相关实验项目
- 简鹿视频格式转换器 1.0 离线包.zip
- 《javascript网页编程》项目考试要求.doc
- 基于python实现的机器学习算法
- yolov8实战第十天-pyqt5-yolov8实现数据结构化、yolov8目标跟踪、过线检测计数系统(参考论文完整部署代码)
- C# opencvsharp对Mat数据进行序列化或者反序列化以及格式化输出演示源码.7z
- 主机性能指标采集器,感兴趣的运维小伙伴们可以下载试试
- 计算机网络和现代通信组网是信息科学和电子工程领域的重要分支,涉及大量的理论知识和实践技能 以下是一些学习资源和项目思路,可以帮助
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功