2023 Huashu Cup Mathematical Modeling Ideas - Case: Production Planning Arrangement in the Shortest Time

0 Ideas for the competition

(Share on CSDN as soon as the competition questions come out)

The shortest time production planning model

This model has appeared in several competition questions, and it is predicted that the 2022 national competition will also be related to this model.

1 Model description

Discrete system simulation plays a very important role in the process arrangement of industrial production. How to establish simple, easy and monitorable mathematical models for some discrete problems with complex internal mechanisms has always been a research hotspot in simulation technology.

There are currently three simulation modeling strategies for discrete event systems, namely:

  • Event Scheduling
  • activity scanning
  • process interaction.

The model demo uses the active scanning method to process a practical example in production.

The activity scanning method has good applicability to the system with strong correlation between events.

2 instances

2.1 Problem Description

In the production process of many factories, due to the limitation of the number of equipment and the order of product processing, it is often impossible to simply arrange production tasks. We envisage that the arrangements will be made by applying powerful mathematical software with simple and easy methods.

Assume that the products of a heavy machinery factory are all one-piece. One of the workshops has 4 different types of equipment. Now it accepts the processing tasks of 6 products. The procedures accepted by each product are processed on the designated equipment. The process and processing cycle are as follows surface

insert image description here
Now we seek a method of arrangement according to this practical problem.

Require:

1. Each product must be processed according to the prescribed process and must not be reversed.

2. Each device can only perform one task at the same time (each process of each product is a task).

3. Complete all tasks accepted in the shortest possible time.

In order to save electric energy and allocate production tasks reasonably, the factory also requires:

1. Make a timetable for the start and completion of each process for each product.

2. Give the timetable for each device to undertake the task.

2.2 Mathematical model

2.2.1 Model process

insert image description here

2.2.2 Notation Conventions

insert image description here

2.2.3 Solving the model

insert image description hereinsert image description hereinsert image description here

2.3 Related codes

clear
clc
seq=[3 1 2 3 4 0 0 0                     %各产品加工时所用的设备的次序
     1 4 2 3 0 0 0 0
     3 4 1 2 1 0 0 0
     2 3 4 1 4 3 0 0
     4 2 3 4 1 3 4 0
     1 2 1 3 4 1 3 1];
 tim=[8 2 4 24 6 0 0 0                   %加工对应使用的时间
      4 5 3 4 0 0 0 0
      3 7 15 20 8 0 0 0
      7 6 21 1 16 3 0 0
      10 4 8 4 12 6 1 0
      1 4 7 3 5 2 5 8];
whole=[0 0 0 0];
for i=1:6
    for j=1:8
        if(seq(i,j)~=0)
            whole(seq(i,j))=whole(seq(i,j))+tim(i,j);
        end
    end
end
whole                          %生产各件产品所需的总时间

mes=cell(4,1);                   %记录各个设备的工作时间(对应于上面tim的位置)
for k=1:4
    mes{
    
    k,1}=zeros(6,8);
    for j=1:8
        for i=1:6
            if(seq(i,j)==k)
            mes{
    
    k,1}(i,j)=tim(i,j);
        else
            mes{
    
    k,1}(i,j)=100;
            end
        end
    end
end

turn=cell(5,100);               %记录四个设备的开关时间及加工对象(on(i)for i=1:4
    for j=1:100
        turn{
    
    i,j}='off';
    end
end
for i=1:100
    turn{
    
    5,i}=[num2str(i) '分'];
end

open=zeros(6,8);           
%记录6个产品的加工进度,0表示未进行,1表示已开始(或已结束),2表示可选,3表示没有这个程序
for i=1:6
    open(i,1)=2;
end
for i=1:6
    for j=1:8
        if seq(i,j)==0
            open(i,j)=3;
        end
    end
end

gongxu=zeros(6,1);
dai=zeros(4,1);
j=1;
s=[1	1	1	1	1	3	3	3
1	1	1	1	3	3	3	3
1	1	1	1	1	3	3	3
1	1	1	1	1	1	3	3
1	1	1	1	1	1	1	3
1	1	1	1	1	1	1	1];
while isequal(open,s)==0
    on=[];
    for i=1:4
        if turn{
    
    i,j}=='off'  
%在turn矩阵中逐列搜索,若设备处于关机状态,则作记录(可用)
            on=[on i];
        end
    end
    l1=length(on);
    for m=1:l1          %在整个生产计划中(对设备逐个)寻找能够选作操作的步骤
        [x,y]=find(open==2);
        l2=length(x);
        a=[x(1) y(1)];
        for k=1:l2   %对某个设备on(m),找出当前它能操作的步骤中耗时最小的一个
            if mes{
    
    on(m)}(a(1),a(2))>mes{
    
    on(m)}(x(k),y(k))
                a=[x(k) y(k)];
            end
        end
        if turn{
    
    on(m),j}=='off' & mes{
    
    on(m)}(a(1),a(2))~=100 
%若时间为100则意味着这个步骤不属于我们希望使用的那件设备
            while tim(a(1),a(2))>0
                turn{
    
    on(m),tim(a(1),a(2))+j-1}=a(1);
                tim(a(1),a(2))=tim(a(1),a(2))-1;
            end
        end
    end
    for i=1:4
        if turn{
    
    i,j}~='off'
            dai(i)=turn{
    
    i,j};
        end
    end
    for i=1:4
        if turn{
    
    i,j}~='off' & turn{
    
    i,j+1}=='off'
            gongxu(turn{
    
    i,j})=gongxu(turn{
    
    i,j})+1;
            open(turn{
    
    i,j},gongxu(turn{
    
    i,j}))=1;
        end
        if gongxu(dai(i))<8 & open(dai(i),gongxu(dai(i))+1)~=3 & turn{
    
    i,j+1}=='off'
            open(dai(i),gongxu(dai(i))+1)=2;
        end
    end
    j=j+1;
end

2.4 Model solution results

Start and finish schedules for each process of each product

insert image description here
Schedule of tasks undertaken by each device

insert image description here
From the results, we can see that using this method, all the processes can be completed in only 78 unit time. And we can also see at the beginning of the paper that it takes 75 units of time to complete it alone. It can be seen that the results obtained by this method are quite satisfactory, and the operation is simple and the monitorability is strong.

Guess you like

Origin blog.csdn.net/dc_sinor/article/details/132042706