本专栏栏目提供文章与程序复现思路,具体已有的论文与论文源程序可翻阅本博主免费的专栏栏目《论文与完整程序》
论文与完整源程序_电网论文源程序的博客-优快云博客https://blog.youkuaiyun.com/liang674027206/category_12531414.html
这篇文章的核心内容是关于一种基于机会约束的风光制氢合成氨系统低碳优化调度模型。以下是文章的主要内容和结构:
背景知识
- 能源系统挑战:风电和光伏等可再生能源因其随机性、间歇性和反调峰特性,对能源系统的稳定运行带来挑战。
- 电制氢合成氨技术(P2A):P2A技术能够将电能转化为氨能,促进氢能的广泛利用,并作为储能技术的补充,平抑能源负荷波动。
研究方法
- 系统模型构建:提出了一个包含电制氢单元、合成氨单元和氢氨混燃单元的风光制氢合成氨系统模型。该模型利用序列运算理论(SOT)获得风光联合出力概率,并以机会约束的形式提供概率备用约束。
- 优化调度模型:结合综合需求响应(IDR)和实时能价机制,建立系统优化调度模型。模型以系统利润最大化为目标,考虑售能收益、运行成本、碳排放成本等。
- 机会约束规划(CCP):通过设置概率约束来优化决策,使系统在可控的风险水平下运行。
实验与结果
- 仿真环境:选取某地区风光制氢合成氨系统为分析对象,进行冬季典型日的仿真分析。
- 调度方案对比:设置了四种调度方案进行对比分析。结果表明,所提方法在碳排放量减少了5.82%的同时,系统实现了98.3%的风光消纳,并在不确定性情景下保持安全可靠运行。
- 关键结论:
- 低碳效益:通过合理设置燃气机组的掺氢比,系统在低碳和经济效益之间达到最佳平衡。
- 系统可靠性:利用SOT和CCP能够有效处理风光发电的不确定性,实现系统经济性与可靠性的平衡。
- 实时能价机制:通过激励用户调整用能行为,降低系统运行成本,提高系统运行效率。
关键结论
- 系统优化效果:所提出的调度模型能够有效降低碳排放,提高风光消纳率,并在不确定性条件下保持系统的安全可靠运行。
- 技术协同作用:P2A技术与燃气掺氢、煤氨混燃技术的协同应用,为系统的低碳经济运行提供了有效途径。
- 模型的适用性:该模型能够适应高比例可再生能源并网带来的挑战,具有良好的扩展性和应用前景。
以下是使用Python语言复现该仿真算例的思路及代码:
import numpy as np
import pandas as pd
from scipy.stats import weibull_min, beta
from scipy.optimize import minimize
# 设置随机种子以确保结果可复现
np.random.seed(42)
# 仿真参数设置
num_time_steps = 24 # 时间步数(小时)
num_scenarios = 100 # 风光出力场景数
wind_capacity = 100 # 风电装机容量(MW)
pv_capacity = 100 # 光伏装机容量(MW)
electrolyzer_capacity = 200 # 电解槽容量(MW)
ammonia_synthesis_capacity = 200 # 合成氨设备容量(MW)
coal_power_plant_capacity = 455 # 燃煤机组容量(MW)
gas_turbine_capacity = 200 # 燃气轮机容量(MW)
storage_capacity = 1500 # 储氢罐容量(MW·h)
demand_electric = np.random.uniform(100, 200, num_time_steps) # 电负荷需求(MW)
demand_thermal = np.random.uniform(50, 100, num_time_steps) # 热负荷需求(MW)
# 风光出力概率分布参数
wind_shape = 2
wind_scale = 20
pv_alpha = 2
pv_beta = 5
# 生成风光出力场景
wind_output = weibull_min.rvs(wind_shape, scale=wind_scale, size=(num_scenarios, num_time_steps))
pv_output = beta.rvs(pv_alpha, pv_beta, size=(num_scenarios, num_time_steps))
# 计算风光联合出力概率性序列
combined_output = wind_output + pv_output
# 优化调度模型
def optimize_dispatch(combined_output, demand_electric, demand_thermal):
# 初始化决策变量
electrolyzer_output = np.zeros(num_time_steps)
ammonia_synthesis_output = np.zeros(num_time_steps)
coal_power_plant_output = np.zeros(num_time_steps)
gas_turbine_output = np.zeros(num_time_steps)
storage_charge = np.zeros(num_time_steps)
storage_discharge = np.zeros(num_time_steps)
# 目标函数:系统利润最大化
def objective(x):
# 解析决策变量
electrolyzer_output, ammonia_synthesis_output, coal_power_plant_output, gas_turbine_output, storage_charge, storage_discharge = x
# 计算售能收益
revenue_electric = np.sum(electrolyzer_output * 0.5 + ammonia_synthesis_output * 0.6)
revenue_thermal = np.sum(coal_power_plant_output * 0.4 + gas_turbine_output * 0.3)
# 计算运行成本
cost_electrolyzer = np.sum(electrolyzer_output * 0.1)
cost_ammonia_synthesis = np.sum(ammonia_synthesis_output * 0.2)
cost_coal_power_plant = np.sum(coal_power_plant_output * 0.3)
cost_gas_turbine = np.sum(gas_turbine_output * 0.4)
cost_storage = np.sum(storage_charge * 0.05 + storage_discharge * 0.05)
# 计算碳排放成本
carbon_emission_cost = np.sum(coal_power_plant_output * 0.8 + gas_turbine_output * 0.6)
# 计算备用成本
reserve_cost = np.sum(np.maximum(demand_electric - electrolyzer_output - ammonia_synthesis_output, 0) * 0.1)
# 计算环境成本
environmental_cost = np.sum(coal_power_plant_output * 0.05)
# 计算IDR补偿成本
idr_compensation_cost = np.sum(np.maximum(demand_electric - electrolyzer_output - ammonia_synthesis_output, 0) * 0.02)
# 计算系统利润
profit = revenue_electric + revenue_thermal - cost_electrolyzer - cost_ammonia_synthesis - cost_coal_power_plant - cost_gas_turbine - cost_storage - carbon_emission_cost - reserve_cost - environmental_cost - idr_compensation_cost
return -profit # 最小化负利润
# 约束条件
constraints = [
{'type': 'ineq', 'fun': lambda x: x[0] - electrolyzer_capacity}, # 电解槽容量约束
{'type': 'ineq', 'fun': lambda x: x[1] - ammonia_synthesis_capacity}, # 合成氨设备容量约束
{'type': 'ineq', 'fun': lambda x: x[2] - coal_power_plant_capacity}, # 燃煤机组容量约束
{'type': 'ineq', 'fun': lambda x: x[3] - gas_turbine_capacity}, # 燃气轮机容量约束
{'type': 'ineq', 'fun': lambda x: x[4] - storage_capacity}, # 储氢罐容量约束
{'type': 'ineq', 'fun': lambda x: x[5] - storage_capacity}, # 储氢罐容量约束
{'type': 'eq', 'fun': lambda x: np.sum(x[0]) + np.sum(x[1]) - np.sum(demand_electric)}, # 电力平衡约束
{'type': 'eq', 'fun': lambda x: np.sum(x[2]) + np.sum(x[3]) - np.sum(demand_thermal)} # 热力平衡约束
]
# 初始值
x0 = np.array([electrolyzer_capacity / 2] * num_time_steps + [ammonia_synthesis_capacity / 2] * num_time_steps + [coal_power_plant_capacity / 2] * num_time_steps + [gas_turbine_capacity / 2] * num_time_steps + [storage_capacity / 2] * num_time_steps + [storage_capacity / 2] * num_time_steps)
# 求解优化问题
result = minimize(objective, x0, method='SLSQP', constraints=constraints)
return result.x
# 进行优化调度
dispatch_results = optimize_dispatch(combined_output, demand_electric, demand_thermal)
# 提取优化结果
electrolyzer_output = dispatch_results[:num_time_steps]
ammonia_synthesis_output = dispatch_results[num_time_steps:2 * num_time_steps]
coal_power_plant_output = dispatch_results[2 * num_time_steps:3 * num_time_steps]
gas_turbine_output = dispatch_results[3 * num_time_steps:4 * num_time_steps]
storage_charge = dispatch_results[4 * num_time_steps:5 * num_time_steps]
storage_discharge = dispatch_results[5 * num_time_steps:]
# 绘制结果
import matplotlib.pyplot as plt
plt.figure(figsize=(12, 8))
plt.subplot(2, 1, 1)
plt.plot(electrolyzer_output, label='Electrolyzer Output')
plt.plot(ammonia_synthesis_output, label='Ammonia Synthesis Output')
plt.plot(demand_electric, label='Electric Demand')
plt.xlabel('Time (h)')
plt.ylabel('Power (MW)')
plt.title('Electric Power Dispatch')
plt.legend()
plt.subplot(2, 1, 2)
plt.plot(coal_power_plant_output, label='Coal Power Plant Output')
plt.plot(gas_turbine_output, label='Gas Turbine Output')
plt.plot(demand_thermal, label='Thermal Demand')
plt.xlabel('Time (h)')
plt.ylabel('Power (MW)')
plt.title('Thermal Power Dispatch')
plt.legend()
plt.tight_layout()
plt.show()
文字注释
- 参数设置:首先定义了仿真所需的各项参数,包括时间步数、风光出力场景数、各设备的容量、电热负荷需求等。
- 风光出力场景生成:使用Weibull分布和Beta分布生成风电和光伏的出力场景。
- 优化调度模型:定义了一个函数来执行优化调度,包括目标函数、约束条件和初始值的设置。目标函数是系统利润最大化,约束条件包括设备容量约束和电力、热力平衡约束。
- 模型求解:使用SciPy库的
minimize
函数求解优化问题,得到各设备的输出功率。 - 结果绘制:绘制电解槽、合成氨设备、燃煤机组和燃气轮机的输出功率与电热负荷需求的对比图,以可视化展示优化调度结果。
本专栏栏目提供文章与程序复现思路,具体已有的论文与论文源程序可翻阅本博主免费的专栏栏目《论文与完整程序》
论文与完整源程序_电网论文源程序的博客-优快云博客https://blog.youkuaiyun.com/liang674027206/category_12531414.html