# EIFICA for pv **Repository Path**: fgy-lab/eifica-for-pv ## Basic Information - **Project Name**: EIFICA for pv - **Description**: EIFICA for pv:专注于光伏系统优化与管理的开源项目,提供高效的数据分析和智能监控解决方案,助力绿色能源发展。 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-24 - **Last Updated**: 2026-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: 单一光伏 ## README # FICA: Faster Inner Convex Approximation This repository contains codes for our paper ***FICA: Faster Inner Convex Approximation of Chance Constrained Grid Dispatch with Decision-Coupled Uncertainty*** https://arxiv.org/abs/2506.18806. ## Installation Guideline 1. git clone this repository. 2. navigate to the folder, and run the following command to install conda env create -f environment.yml 3. This will create a conda environment called `fica`, activate this by `conda activate fica` (or specify it in your IDE) and you are free to run all scripts. **Note:** If the conda installation is slow, we strongly recommend you to update your `anaconda` to the most recent version before installing our environment. ## Two Simple Runs to See the Speedup! 1. Open the `PD.py` file, scroll down to the code blocks after `if __name__ == '__main__':`. 2. Set `method = 'FICA'` (line 507), run this script `PD.py`, which will show - A plot showing the generation power (day-ahead vs adjusted by AGC) for three wind scenarios. - After closing the plot, the terminal will print the optimal objective value, computing time, and other information similar to: the objective value is ... The method used is FICA The computing time for solving the dispatch is 5.67638897895813 seconds 3. Set `method = 'CVAR'`, re-run this script, and ***compare the computing time and optimality!*** FICA:快速内凸逼近(Faster Inner Convex Approximation) 本仓库包含论文《FICA:含决策耦合不确定性的机会约束电网调度快速内凸逼近》(FICA: Faster Inner Convex Approximation of Chance Constrained Grid Dispatch with Decision-Coupled Uncertainty)的相关代码,论文链接:https://arxiv.org/abs/2506.18806。 安装指南 克隆本仓库。 进入仓库文件夹,运行以下命令进行安装: conda env create -f environment.yml 上述命令会创建名为fica的 conda 环境,通过conda activate fica激活该环境(或在 IDE 中指定该环境),之后即可运行所有脚本。 注意:若 conda 安装速度较慢,强烈建议在安装本环境前,将anaconda更新至最新版本。 两次简单运行,直观感受加速效果! 打开PD.py文件,向下滚动至if __name__ == '__main__':后的代码块。 设置method = 'FICA'(第 507 行),运行PD.py脚本,将显示: 一张图表,展示三种风电场景下的发电功率(日前计划功率与经自动发电控制(AGC)调整后的功率)。 关闭图表后,终端会打印最优目标函数值、计算时间及其他相关信息,格式类似: 目标函数值为……使用的方法为 FICA求解调度问题的计算时间为 5.67638897895813 秒 设置method = 'CVAR',重新运行该脚本,对比两种方法的计算时间与最优性! \ \ \ \ \ If you want to dive deeper... 文件说明 本仓库包含以下文件及文件夹: 第一部分:依赖包与安装 environment.yml:包含该 conda 环境所需的所有依赖包信息。 第二部分:数据 data/:存放数据文件的文件夹,包含负荷数据、风电预测数据及预测误差数据。 GEFC2012_wind.ipynb:基于 GEFC2012 铜牌预测结果与实际值,处理并生成风电预测误差场景的笔记本文件。 WT_error_gen.py:包含生成非高斯、时间耦合风电预测误差样本的函数,用于算法的训练与测试。 第三部分:数值实验代码 1、PD.py:用于求解机会约束电力调度问题的代码,也可用于测试特定参数设置。 2、PD_all_param_eval.py:在论文中对比所提 FICA 方法与基准 CVAR 方法的计算时间时,用于评估所有参数设置的代码。采用 Joblib 实现并行计算,指定并行任务数(njobs)时,需注意计算机可用 CPU 核心数与内存占用情况。 3、PD_opt_all_param_eval.py:功能与 PD_all_param_eval.py 类似,但用于测试所提 FICA 方法与 ExactLHS 方法的最优性对比结果。代码结构与 PD_all_param_eval.py 大致相同,单独设为一个文件是为了更方便地编写不同参数组合(因 ExactLHS 方法仅能求解小规模问题)。 注意:运行 PD_all_param_eval.py(该代码运行耗时较长)时,务必避免计算机内存耗尽。内存瓶颈可能导致 CVAR 方法的运行速度进一步变慢,进而得出有偏差的结论。为方便监控内存,我们提供了以下脚本: bash record_memory.sh 该脚本会生成 memory_usage.csv 文件,每 5 秒记录一次计算机的内存使用情况,适用于 Ubuntu 20.04.6 LTS 操作系统。 第四部分:结果 PD_results_bigM100000_thread4/:存放机会约束电网调度问题结果的文件夹,对应参数为 big-M=100000(每个优化问题使用 4 个线程)。需注意,big-M=100000 仅用于 ExactLHS 方法,不用于所提 FICA 方法与 CVAR 方法。 第五部分:可视化 PD_result_vis.ipynb:基于 PD_results_bigM100000_thread4 / 文件夹中存储的结果文件,实现论文结果可视化的笔记本文件。 figure/:存放上述笔记本文件生成的图表的文件夹 If you find this repository helpful, please cite our paper: > Yihong Zhou, Hanbin Yang, Thomas Morstyn (2025). *FICA: Faster Inner Convex Approximation of Chance Constrained Grid Dispatch with Decision-Coupled Uncertainty*. Available at arXiv https://arxiv.org/abs/2506.18806.