主要内容

Optimization of Shared Resources in a Batch Production Process

Overview

This example shows how to model and optimize the use of shared resources in a system, to identify resource deficiencies and improve capacity planning. The example is based on a batch production process, where production orders are processed only according to the availability of batch reactors. In the example, SimEvents® entities represent both the production orders of the manufacturing process, and the batch reactors that are required to process them. Later in the example, we will find the optimal resource capacities of the system by applying the Genetic Algorithm solver of MATLAB Global Optimization Toolbox.

模型name ='seBatchProduction'; open_system(modelname); scopes = find_system(modelname,'LookUnderMasks','on','BlockType','Scope');cellfun(@(x)close_system(x),范围);set_param(modelname,'SimulationCommand','更新');

Structure of Model

在模型的顶级,实体生成器通过生成代表生产订单的实体来模拟生产订单的生成和积压。生成新实体时,获取反应器块请求批处理反应器处理顺序。在执行化学过程配方子系统根据指定的化学过程配方完成订单后,块标记的释放电抗器将批量反应堆释放回资源池,即现在可用于处理新订单。数据分析子系统分析了与生产订单完成相关的数据。

共享资源的Production Process

执行化学过程配方子系统模拟化学过程以生产溶胶(一种胶体)。六步配方模型溶胶生产中的主要操作。执行这些步骤需要不同的资源。批量反应堆提供内置能力,以执行添加颜色,添加颗粒和搅拌等步骤。因此,这些步骤所需的资源不需要单独建模。另一方面,添加水,加热和排水的步骤需要额外的资源。这些资源由所有批量反应堆共享,受生产系统的容量受限。

open_system ([modelname'/执行化学过程配方']);

例如,当水的使用达到全部容量时,对于另一个批量反应器来说,水压太低。在这种情况下,在该反应器中的生产暂停,直到供水再次可用。在执行化学过程配方子系统中,示例模型具有标有队列块的资源共享过程Wait for Water Supplyand an Entity Server block labeledAdd Waterin the Add Water subsystem. The容量parameter of the Entity Server block models the capacity of the water supply. During simulation, the number of entities in the Queue block indicates the number of batch reactors waiting for water. The number of entities in the Server block represents the number of batch reactors accessing water.

open_system ([modelname'/Execute Chemical Process Recipe/Add Water']);

建模的批量生产过程能够产生两种类型的批次:A型和B型。虽然产生两种批次所需的主要步骤是相同的​​,但化学过程配方是不同的。例如,制造B型的配方需要更多的水,因此添加水的步骤需要更多时间完成。

结果和显示

在仿真期间,数据分析子系统显示有几个结果以显示生产过程的性能。

The most illustrative result here is the first one,积压中的平均订单数, which represents the wait time for orders as the system struggles to keep up with inflow.

sim(modelname); open_system([modelname'/数据分析/订购积压']);

系统的其他结果包括以下内容,可以在数据分析子系统中看到:

  • Average number of batches waiting for water

  • 等待热量的平均批次数量

  • 等待排水的平均批次数

  • Utilization of batch reactors

  • 利用供水

  • Utilization of heat supply

  • 利用排水设施

  • Throughput of type A batch

  • Throughput of type B batch

open_system ([modelname'/数据分析/等待水']);open_system ([modelname'/数据分析/等待热量']);open_system ([modelname'/数据分析/等待排水']);open_system ([modelname'/Data Analysis/Utilization Reactors']);open_system ([modelname'/Data Analysis/Utilization Water']);open_system ([modelname'/数据分析/利用加热器']);open_system ([modelname'/数据分析/利用漏斗']);open_system ([modelname'/Data Analysis/ThroughputA']);open_system ([modelname'/Data Analysis/ThroughputB']);

Optimizing Resource Capacities

我们现在将从Matlab全局优化工具箱应用一个遗传算法求解器,以此SimEvents模型,以查找该系统的最佳资源能力。遗传算法通过反复修改各个点的群体来解决优化问题。由于其随机性,遗传算法可以提高找到全球解决方案的机会。它不需要可差异或连续的功能。

The decision variables in this optimization are:

  • 批量反应器数量

  • 水箱数量

  • 加热器数量

  • 排水数量

The genetic algorithm sets these variables as it runs multiple simulations of the model via the variable ResourceCapacity. The starting values of resource capacities are shown below:

cellfun(@(x)close_system(x),范围);DISP('ResourceCapacity before optimization =');DISP(资源安全性);close_system([modelname'/数据分析/订购积压']);ResourceCapacity = seRunOptimizationForBatchProductionProcess(); disp('ResourceCapacity after optimization =');DISP(资源安全性);
ResourceCapacity before optimization = 2 2 2 2 Starting parallel pool (parpool) using the 'local' profile ... Connected to the parallel pool (number of workers: 6). Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance and constraint violation is less than options.ConstraintTolerance. Elapsed time is 112.822855 seconds. Parallel pool using the 'local' profile is shutting down. ResourceCapacity after optimization = 13 2 4 2

应用优化结果

我们现在可以在将优化过程的结果恢复到模型后重新调整,以便看到这显着降低了订单积压。

sim(modelname); open_system([modelname'/数据分析/订购积压']);

%cleanupbdclose(modelname); clear模型范围

See Also

|||||

相关话题