Skip to content

Rick10119/Efficient-Scheduling-of-Discrete-Industrial-Processes

Repository files navigation

Efficient Scheduling of Discrete Industrial Processes through Continuous Modeling

Cite: R. Lyu, X. Su, E. Du, H. Guo, Q. Chen and C. Kang. "Efficient Scheduling of Discrete Industrial Processes through Continuous Modeling", IEEE Transactions on Smart Grid, in press.

Link: https://ieeexplore.ieee.org/document/11082423

Video Introduction: https://www.bilibili.com/video/BV1cdurzbEgi

Project Overview

This project provides research data and code for accelerating the application of RTN models in discrete industrial production processes. By using continuous modeling methods, we can improve scheduling efficiency and reduce computation time while maintaining the same accuracy as legacy RTN models.

image image

Core Contributions

1. Novel Continuous RTN (cRTN) Model

  • Decoupling from batches: Unlike legacy RTN that models each batch separately, cRTN uses continuous variables to represent resource quantities and task operations independent of batch numbers
  • Unified formulation: Handles both non-flexible and flexible production processes in a unified manner
  • Computational efficiency: Reduces binary variables from O(bST) to O(ST), where b is the number of batches, S is the number of stages, and T is the number of time slots

2. Key Mathematical Formulations

Legacy RTN Model

Resource Balance: $$R_{r, t} = R_{r, t-1} + \sum_i \sum_\theta \mu_{r, i, \theta} N_{i, t-\theta} \quad \forall r, t$$

Task Execution: $$\sum_t N_{i, t} = 1 \quad \forall i$$

Energy Consumption: $$\Pi_{EL, t} = \sum_i \sum_\theta \mu_{EL, i, \theta} N_{i, t-\theta} \quad \forall t$$

Where:

  • $N_{i, t}$: Binary variable for task i starting at time t
  • $\mu_{r, i, \theta}$: Resource r consumed/generated by task i, θ time slots after start
  • $R_{r, t}$: Value of resource r at time t

Continuous RTN (cRTN) Model

Resource Balance: $$R_{r, t} \leq R_{r, t-1} + \sum_i \sum_k g_{r, i, k} D_{i, k, t} \quad \forall r, t$$

Task Execution: $$0 \leq D_{i, k, t} \leq \delta \quad \forall i, t$$ $$\sum_k D_{i, k, t} = \delta \quad \forall i, t$$

Uninterruptible Tasks: $$D_{i, 0, t} \leq 1 - u_{i, t} \quad \forall t$$ $$R_{r^{i+}, t} \leq u_{i, t} \quad \forall t$$

Energy Consumption: $$\Pi_{EL, t} = \sum_i \sum_k P_{i, k} D_{i, k, t} \quad \forall t$$

Where:

  • $D_{i, k, t}$: Time duration that task i operates in state k within time slot t
  • $g_{r, i, k}$: Resource change rate for task i in state k
  • $u_{i, t}$: Binary variable for task processing state
  • $P_{i, k}$: Power consumption of task i in state k

3. Performance Improvements

  • Solution time: 89% reduction compared to legacy RTN
  • Scalability: Model size remains constant regardless of production targets
  • Accuracy: Eliminates rounding errors inherent in legacy RTN models
  • Energy cost: Up to 25% reduction in certain scenarios

Code Structure

Core Model Files

cRTN Model (cRTN_model/)

  • add_crtn_cons.m: Implements cRTN constraints including resource balance, task execution, and uninterruptible process constraints
  • add_crtn_param_and_var.m: Initializes continuous variables (D_{i,k,t}) and binary variables (u_{i,t}) for cRTN
  • main_flxb_crtn.m: Main script for flexible cRTN model with power adjustment capabilities
  • main_small_case_crtn.m: Demonstrates cRTN on small-scale cases for validation
  • test_crtn_gap.m: Analyzes impact of optimality gap settings on solution quality
  • test_crtn_heat.m: Tests scalability with varying production targets (number of heats)

Legacy RTN Model (rtn_model/)

  • add_basic_rtn_cons.m: Implements basic RTN constraints with binary task start variables
  • add_flxb_rtn_cons.m: Adds flexible power adjustment constraints to RTN
  • add_rtn_param_and_var.m: Initializes binary variables (N_{i,t}) for task scheduling
  • main_basic_rtn.m: Basic RTN model without power flexibility
  • main_flxb_rtn.m: Flexible RTN model with power adjustment
  • main_flxb_rtn_small_case.m: Small-scale RTN validation cases

Visualization (visualize/)

  • cal_rmse_models.m: Calculates RMSE between RTN and cRTN results
  • cal_rmse_models_gap.m: Analyzes rounding error impact across different gap settings
  • plot_typical_load_profile_decp_crtn.m: Generates load profile comparisons

Parameter Files (parameter_setting/)

  • load_parameters_zhang_rtn.xlsx: Original steel plant parameters from Zhang et al.
  • set_parameter_zhang_rtn.m: Converts technical parameters to model parameters
  • rt_hrl_lmps_202208.xlsx: Real-time electricity prices from PJM market

Usage Instructions

1. Basic Setup

% Set current directory to project root
cd('path/to/Efficient-Scheduling-of-Discrete-Industrial-Processes')

% Run main cRTN model
run('cRTN_model/main_flxb_crtn.m')

2. Parameter Configuration

Key parameters in main_flxb_crtn.m:

  • NOF_HEAT: Number of production batches (default: 8)
  • day_index: Day index for electricity prices (1-15)
  • gap: Optimality gap for solver (default: 1e-4)

3. Model Comparison

% Compare RTN vs cRTN performance
run('rtn_model/main_flxb_rtn.m')  % Legacy RTN
run('cRTN_model/main_flxb_crtn.m') % Proposed cRTN

4. Scalability Testing

% Test with different production targets
run('cRTN_model/test_crtn_heat.m')
run('rtn_model/test_rtn_heat.m')

Key Results

Computational Performance

Model Binary Variables Solution Time Energy Cost Reduction
Legacy RTN O(bST) 156.7 min 6.9%
cRTN O(ST) 17.1 min 7.4%

Scalability Analysis

  • RTN: Solution time increases exponentially with batch number
  • cRTN: Solution time increases linearly and remains tractable up to 10+ batches

Rounding Error Elimination

  • RTN: 2.13% RMSE due to discrete time slot constraints
  • cRTN: 0% RMSE through continuous variable formulation

Technical Details

Discrete IP Characteristics Modeled

  1. Batch-based processing: Products processed in discrete batches
  2. Uninterruptible tasks: Once started, tasks must complete without interruption
  3. Stage coupling: Sequential processing requirements between production stages
  4. Waiting time limits: Time constraints for intermediate product transfers

Model Innovations

  1. Continuous resource representation: $R_{r,t}$ represents task progress (0-1)
  2. Duration-based task modeling: $D_{i,k,t}$ replaces binary start variables
  3. Unified flexible/non-flexible formulation: Single model handles both process types
  4. Virtual task introduction: Output/input tasks model batch completion events

Dependencies

  • MATLAB R2024b or later
  • YALMIP optimization toolbox
  • Gurobi solver (V12.0.0 or later)
  • Statistics and Machine Learning Toolbox

Citation

If you use this code in your research, please cite:

@article{lyu2024efficient,
  title={Efficient Scheduling of Discrete Industrial Processes through Continuous Modeling},
  author={Lyu, Ruike and Su, Xiangbo and Du, Ershun and Guo, Hongye and Chen, Qixin and Kang, Chongqing},
  journal={IEEE Transactions on Smart Grid},
  year={2025},
  note={in press}
}

Frequently Asked Questions (FAQ)

Q1: What is the relationship between RTN and cRTN models?

A: cRTN inherits RTN's graph-based modeling philosophy but introduces a fundamental innovation in variable definition. While traditional RTN uses discrete variables to represent both resource quantities and task operations, cRTN reformulates these using continuous variables while preserving the discrete nature of IPPs through carefully designed binary variables for task states.

Q2: Why are the improvements in energy costs relatively small in some cases?

A: There are two main reasons:

  1. When given sufficient computation time, both RTN and cRTN can find optimal solutions, resulting in similar energy costs. This validates that cRTN achieves better computational efficiency without compromising modeling accuracy.
  2. The magnitude of energy cost improvements through eliminating rounding errors depends on the time step length relative to process duration. With smaller time steps, the impact is less prominent.

Q3: How does the solver's optimality gap setting affect performance?

A: Our analysis shows:

  1. RTN's solution time increases rapidly with stricter gap requirements (>1 hour when gap < 1e-2)
  2. cRTN maintains stable performance even with very strict gap requirements
  3. Given a 30-minute time limit, cRTN consistently achieves gaps < 1e-4, while RTN only reaches gaps around 1e-2

Q4: Is there potential for clustering binary variables to improve computational efficiency?

A: While clustering methods (like those used in Unit Commitment problems) could potentially help accelerate aggregated industrial demand response strategies involving multiple factories, they may not be directly applicable for individual factory scheduling. Our cRTN approach focuses on improving computational efficiency while maintaining accurate modeling of individual IPP constraints.

Q5: How does cRTN ensure the feasibility of solutions?

A: cRTN is a reformulation rather than a relaxation of the RTN model. While we model resources as continuous variables, we maintain the discrete nature of IPPs by introducing binary variables to represent task execution states. Our carefully designed constraints mathematically ensure that the model maintains strict feasibility without compromising the original problem's discrete characteristics.

离散型工业生产过程的计算高效建模方法

项目简介

本项目提供了加速RTN模型在离散工业生产过程中的应用的研究数据和代码。通过连续建模的方法,我们能够在保证精度的前提下减小模型复杂度,从而提高调度效率,减少计算时间。

核心贡献

1. 新型连续RTN (cRTN) 模型

  • 与批次解耦: 与传统的按批次分别建模不同,cRTN使用连续变量表示资源数量和任务操作,与批次数量无关
  • 统一表述: 以统一方式处理非灵活和灵活生产过程
  • 计算效率: 将二进制变量从O(bST)减少到O(ST),其中b是批次数量,S是阶段数量,T是时间槽数量

2. 关键数学公式

传统RTN模型

资源平衡: $$R_{r, t} = R_{r, t-1} + \sum_i \sum_\theta \mu_{r, i, \theta} N_{i, t-\theta} \quad \forall r, t$$

任务执行: $$\sum_t N_{i, t} = 1 \quad \forall i$$

能耗: $$\Pi_{EL, t} = \sum_i \sum_\theta \mu_{EL, i, \theta} N_{i, t-\theta} \quad \forall t$$

连续RTN (cRTN) 模型

资源平衡: $$R_{r, t} \leq R_{r, t-1} + \sum_i \sum_k g_{r, i, k} D_{i, k, t} \quad \forall r, t$$

任务执行: $$0 \leq D_{i, k, t} \leq \delta \quad \forall i, t$$ $$\sum_k D_{i, k, t} = \delta \quad \forall i, t$$

不可中断任务: $$D_{i, 0, t} \leq 1 - u_{i, t} \quad \forall t$$ $$R_{r^{i+}, t} \leq u_{i, t} \quad \forall t$$

代码结构

核心模型文件

cRTN模型 (cRTN_model/)

  • add_crtn_cons.m: 实现cRTN约束条件,包括资源平衡、任务执行和不可中断过程约束
  • add_crtn_param_and_var.m: 初始化cRTN的连续变量(D_{i,k,t})和二进制变量(u_{i,t})
  • main_flxb_crtn.m: 具有功率调节能力的灵活cRTN模型主脚本
  • main_small_case_crtn.m: 在小规模案例上演示cRTN以进行验证
  • test_crtn_gap.m: 分析最优性间隙设置对解质量的影响
  • test_crtn_heat.m: 测试不同生产目标(炉次数量)的可扩展性

传统RTN模型 (rtn_model/)

  • add_basic_rtn_cons.m: 实现具有二进制任务开始变量的基本RTN约束
  • add_flxb_rtn_cons.m: 为RTN添加灵活功率调节约束
  • add_rtn_param_and_var.m: 初始化任务调度的二进制变量(N_{i,t})
  • main_basic_rtn.m: 无功率灵活性的基本RTN模型
  • main_flxb_rtn.m: 具有功率调节的灵活RTN模型

使用方法

  1. 确保MATLAB已安装并配置正确。
  2. 将项目克隆到本地计算机。
  3. 在MATLAB中,将当前文件夹设置为项目的根目录。
  4. 运行cRTN_model/main_flxb_crtn.m脚本以开始调度计算。

运行说明

  • 参数设置:在main_flxb_crtn.m中,用户可以根据需要调整NOF_HEATday_indexgap等参数。
  • 结果保存:运行结束后,结果将保存在results/文件夹中,文件名中包含day_indexNOF_HEATgap信息。
  • 可视化:使用visualize/plot_typical_load_profile_decp_crtn.m脚本可以生成负荷曲线图,帮助分析结果。

常见问题解答 (FAQ)

Q1: RTN模型和cRTN模型之间的关系是什么?

A: cRTN继承了RTN的图形化建模理念,但在变量定义上进行了根本性的创新。传统的RTN使用离散变量来表示资源数量和任务操作,而cRTN通过精心设计的二进制变量来表示任务状态,将这些变量重新定义为连续变量,同时保留了IPP的离散特性。

Q2: 为什么在某些情况下,能源成本的改善相对较小?

A: 主要有两个原因:

  1. 在给予足够计算时间的情况下,RTN和cRTN都能找到最优解,导致相似的能源成本。这验证了cRTN在不影响建模精度的前提下,实现了更好的计算效率。
  2. 通过消除舍入误差来改善能源成本的幅度取决于时间步长相对于过程持续时间的长短。时间步长越小,影响越不明显。

Q3: 求解器的最优性间隙设置如何影响性能?

A: 我们的分析显示:

  1. RTN的求解时间随着更严格的间隙要求迅速增加(当间隙<1e-2时,超过1小时)
  2. 即使在非常严格的间隙要求下,cRTN也能保持稳定的性能
  3. 在30分钟的时间限制下,cRTN始终能达到间隙<1e-4,而RTN只能达到约1e-2的间隙

Q4: 是否有可能通过聚类二进制变量来提高计算效率?

A: 虽然聚类方法(如在单元承诺问题中使用的那些)可能有助于加速涉及多个工厂的工业需求响应策略,但它们可能不直接适用于单个工厂的调度。我们的cRTN方法专注于在保持单个IPP约束的准确建模的同时,提高计算效率。

Q5: cRTN如何确保解的可行性?

A: cRTN是RTN模型的重新表述,而不是放松。虽然我们将资源建模为连续变量,但通过引入二进制变量来表示任务执行状态,保持了IPP的离散特性。我们精心设计的约束条件在数学上确保了模型在不影响原问题离散特性的情况下,严格保持可行性。

About

Data and code for our TSG paper on how to accelerate the RTN model for discrete industrial production processes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages