2023 "Huawei Cup" Chinese Graduate Mathematical Modeling Competition (Question A) In-depth Analysis | Complete Code of Mathematical Modeling + Full Analysis of the Modeling Process

Huawei Cup Mathematical Modeling A Question

Have you ever felt at a loss when faced with complex mathematical modeling problems? As the O Award winner of the 2021 American College Student Mathematical Modeling Competition, I provide you with a set of excellent problem-solving ideas to allow you to easily deal with various problems.
Let’s take a look at Question A of the research competition!

Question one:

1. Use Markov chain to describe the backoff process of the node.
●The node performs random backoff according to the binary exponential increasing backoff algorithm. The backoff counter and the backoff order are Markov processes.
●Bianchi et al. proved in the paper that this backoff process can be used as a two-dimensional discrete time Markov. Chain modeling
●Markov chain can accurately describe the probability distribution and transition rules of node backoff states over time

2. Calculate the node sending probability τ and the collision probability p
●τ represents the sending probability when the node randomly backs off to 0, which can be obtained from the steady-state distribution of the Markov chain
●p represents the probability that at least one node sends at the same time causing a collision, according to the node The relationship between the total number and τ can be obtained
●The two are related to each other and require a system of simultaneous equations to be solved

3. Calculate the time slot length in different states
●The time slot length needs to consider different factors such as data transmission time, SIFS, ACK, etc.
●The time slot length is different in different states (success, failure, idle)

4. Calculate throughput rate using state probability and slot length

  • The throughput rate is affected by the state probability and the length of each state slot.
  • The performance of the entire system can be calculated using the throughput rate formula
  • Reflects the relationship between Markov chain modeling, parameter setting and performance measurement

Establish the Markov chain model of node backoff process

Referring to the Bianchi model, a Markov chain model of the backoff process is established for each AP. The state space is {s(t),b(t)}, s(t) represents the backoff order, and b(t) represents the random backoff counter value.
There are m+1 backoff orders in total, and the competition window size corresponding to each order i is W i = 2 i ∗ W 0 W_i=2^i*W_0Wi=2iW0, W 0 W_0 W0is the competition window size of the initial order.
Then the state transition probability is:
P i , k ∣ i , k − 1 = 1 , i ∈ [ 0 , m ] , k ∈ [ 1 , W i − 1 ] P 0 , k ∣ i , 0 = ( 1 − p ) / W 0 , i ∈ [ 0 , m ] , k ∈ [ 0 , W 0 − 1 ] P i , k ∣ i − 1 , 0 = p / W i , i ∈ [ 1 , m ] , k ∈ [ 0 , W i − 1 ] P{i,k|i,k-1}=1, i∈[0,m],k∈[1,Wi-1] P{0,k|i,0}= (1-p)/W0, i∈[0,m],k∈[0,W0-1] P{i,k|i-1,0}=p/Wi, i∈[1,m], k∈[0,Wi-1]Pi,ki,k1=1,i[0,m],k[1,Wi1 ] P 0 ,ki,0=(1p ) / W 0 ,i[0,m],k[0,W 01]Pi,ki1,0=p / Wi ,i[1,m],k[0,Wi1]

Calculate node sending probability τ and collision probability p

In the steady state, the node sending probability can be obtained:
τ = b 00 / ( 1 − p ) τ = b_{00}/(1-p)t=b00/(1p )
where b00 is the steady-state probability of state {0,0}.
The collision probability p is the probability that at least one node sends:
p = 1 − ( 1 − τ ) ( N − 1 ) p=1-(1-τ)^(N-1)p=1(1t )(N1 )
Combining the two equations can solve τ and p.
Calculate the slot length for different states

T s = data transmission time + SIFS + ACK T c = data transmission time + ACK timeout T e = DIFS T_s = data transmission time + SIFS + ACK \ T_c = data transmission time + ACK timeout \ T_e = DIFSTs=Data transfer time+S I F S+A C K ​​T c=Data transfer time+A C K ​​timeout T e=DIFS

Calculate system throughput

S = P s T s P s T s + P c T c + P e T e ⋅ S = \frac{P_sT_s}{P_sT_s+P_cT_c+P_eT_e} \cdot S=PsTs+PcTc+PeTePsTs⋅Rate where Ps is the success probability, Pc is the
failure probability, and Pe is the idle probability.
These three probabilities can be calculated by solving the Markov chain, thereby obtaining the system throughput rate S.

matlab

% 参数设置
W0 = 16;   % 初始竞争窗口大小
m = 5;     % 最大退避级数 
N = 2;     % AP节点数量
p_col = 0.1; % 并发传输发生碰撞概率
Ts = 60;   % 成功传输时隙长度
Tc = 100;  % 失败传输时隙长度 
Te = 50;   % 空闲时隙长度
rate = 455.8e6; % 传输速率

% 求解τ和p
syms tau p;
b00 = (1-p)*(1-2*p)/(W0*(1-(2*p)^(m+1))*(1-p)+(1-2*p)*(1-p^(m+1))); 
tau = b00/(1-p);
eqn1 = tau == (1 - (1-tau)^(N-1))*p_col;
eqn2 = solve(eqn1,p);
p = double(eqn2);
tau = double(solve(eqn1,tau));

% 计算状态概率
Ps = 1 - tau^N;
Pc = 1 - (1-tau)^N - N*tau*(1-tau)^(N-1); 
Pe = (1-tau)^N;

% 计算吞吐率
S = Ps*Ts/(Ps*Ts + Pc*Tc + Pe*Te)*rate

Insert image description here

Question two:

The SIR is higher during concurrent transmission, resulting in successful data transmission from both APs.
Therefore, the modeling process is basically the same as question 1. The main differences are in the following two aspects:
1. When calculating the collision probability p, concurrent transmission does not necessarily fail, and the probability of success or failure due to SIR needs to be considered.
You can set a concurrent success probability Ps_col, then there is:
p = 1 − ( 1 − τ ) ( N − 1 ) ∗ P scolp = 1 - (1-τ)^(N-1) * Ps_colp=1(1t )(N1)Psco l
2. When calculating the probabilities of different states, the success probability Ps needs to consider the situation of concurrent success:
P s = ( 1 − τ ) N + CN 2 ∗ tau 2 ∗ P scol Ps = (1 - τ)^N + C_N^ 2*tau^2*Ps_colPs=(1t )N+CN2t u _2Psco l
The calculations of Pc and Pe are the same as in question 1.
The rest of the modeling process remains unchanged, and finally the system throughput rate under question 2 can be obtained.

Then the corresponding modeling process is the Markov chain model of the node.
The Markov chain model of the node backoff process is completely consistent with question 1, and the state space and state transition probability are unchanged.
Calculate the node sending probability τ \tauτ and collision probabilityppp

τ = b 0 , 0 1 − pp = 1 − ( 1 − τ ) N − 1 ⋅ P scol \tau = \frac{b_{0,0}}{1-p}\\ p= 1 - (1- \tau)^{N-1} \cdot P\text{scol}t=1pb0,0p=1(1t )N1Pscol

where P scol P\text{scol}P scol represents the success probability of concurrent transmission.
Different status slot lengths

(Same as question 1)

电影电影电影电影
P e = ( 1 − τ ) N P c = 1 − ( 1 − τ ) N − N τ ( 1 − τ ) N − 1 P s = ( 1 − τ ) N + CN 2 τ 2 P scol P_e = (1-\tau)^N \ P_c = 1 - (1-\tau)^N - N\tau(1-\tau)^{N-1} \ P_s = (1 - \tau)^N + C_N^2 \tau^2 P\text{scol}Pe=(1t )N Pc=1(1t )NN t ( 1t )N 1 P s=(1t )N+CN2t2Pscol

Calculate system throughput

The throughput formula is also exactly the same as question 1.
Compared with question 1, the main changes are:
1. The calculation of p considers the concurrent success probability
2. The calculation of Ps adds the concurrent success probability item
Insert image description here

The corresponding calculation code is:

% 参数设置
W0 = 16; 
m = 5;
N = 2;
p_col = 0.9; % 并发传输成功概率 
Ts = 60;
Tc = 100;
Te = 50;
rate = 455.8e6;

% 求解τ和p
syms tau p;
b00 = (1-p)*(1-2*p)/(W0*(1-(2*p)^(m+1))*(1-p)+(1-2*p)*(1-p^(m+1)));
tau = b00/(1-p);
eqn1 = tau == (1 - (1-tau)^(N-1))*p_col;  
eqn2 = solve(eqn1,p);
p = double(eqn2);
tau = double(solve(eqn1,tau));

% 计算状态概率 
Ps_col = 0.9; % 并发成功概率
Pe = (1-tau)^N; 
Pc = 1 - (1-tau)^N - N*tau*(1-tau)^(N-1);
Ps = (1 - tau)^N + nchoosek(N,2)*tau^2*Ps_col;

% 计算吞吐率
S = Ps*Ts/(Ps*Ts + Pc*Tc + Pe*Te)*rate

Question 3

In question 3, the RSSI between the two APs is -90dBm, they do not listen to each other, and there is a hidden node problem. And the transmission failure caused by the channel bit error rate Pe is considered.

The modeling steps are as follows:
1. Still establish the Markov chain model of the node and describe the backoff process.
2. Calculate the node sending probability τ and collision probability p. The calculation of τ is the same as the previous two questions.
AP considers the probability of concurrent transmission failure
. 3. Calculate the different status slot lengths Ts, Tc, Te, which is the same as the previous two questions.
4. Calculate the state probability: the idle probability Pe takes into account the channel bit error rate
a. The failure probability Pc takes into account the overlapping transmission failure probability
b. The success probability Ps is the remaining probability
5. Use the above parameters to calculate the system throughput rate S.
Compared with the previous two questions, the problem 3 The main differences in modeling:
(1) The channel bit error rate Pe is introduced
(2) The failure probability Pc considers overlapping transmission failure
(3) The success probability Ps is used as the remaining probability

Specifically, the corresponding modeling is:

1. Markov chain model of the node
(same as the previous two questions)
2. Calculate the node sending probability τ \tauτ and collision probabilityppp

τ = b 0 , 0 1 − pp = 1 − ( 1 − τ ) N − 1 ⋅ P c col \tau = \frac{b{0,0}}{1-p} \\ p = 1 - (1 -\tau)^{N-1} \cdot P{c\text{col}}t=1pb 0 , 0p=1(1t )N1Pccol

3. State slot length
(same as the previous two questions)
4. Calculate state probability
P e = ( 1 − τ ) N ⋅ ( 1 − P e chan ) P c = [ 1 − ( 1 − τ ) N − N τ ( 1 − τ ) N − 1 ] ⋅ P c over P s = 1 − P e − P c P_e = (1-\tau)^N \cdot (1-P_{e\text{chan}}) \\ P_c = [1 - (1-\tau)^N - N\tau(1-\tau)^{N-1}] \cdot P_{c\text{over}} \\ P_s = 1 - P_e - P_cPe=(1t )N(1Pe chan)Pc=[1(1t )NN t ( 1t )N1]PcoverPs=1PePc

5. System throughput rate
(same as the previous two questions)
where,
P e chan P_{e_\text{chan}}PechanRepresents the channel bit error rate,
P c over P_{c_\text{over}}PcoverIndicates the probability of overlapping transmission failure.
Insert image description here

% 参数设置
W0 = 16;  
m = 5;
N = 2; 
p_col = 0.2; % 并发传输失败概率
pe_chan = 0.1; % 信道误码率
pc_over = 0.5; % 交叠传输失败概率
Ts = 60;
Tc = 100;
Te = 50;
rate = 455.8e6;

% 求解τ和p
syms tau p;
b00 = (1-p)*(1-2*p)/(W0*(1-(2*p)^(m+1))*(1-p)+(1-2*p)*(1-p^(m+1)));
tau = b00/(1-p);
eqn1 = tau == (1 - (1-tau)^(N-1))*p_col;
eqn2 = solve(eqn1,p);  
p = double(eqn2);
tau = double(solve(eqn1,tau));

% 计算状态概率
Pe = (1-tau)^N * (1-pe_chan);
Pc = (1 - (1-tau)^N - N*tau*(1-tau)^(N-1)) * pc_over;
Ps = 1 - Pe - Pc;

% 计算系统吞吐率
S = Ps*Ts/(Ps*Ts + Pc*Tc + Pe*Te)*rate

The Markov chain modeling of the node backoff process is the same as the previous two questions, which is the basis.
When calculating p, the concurrent transmission failure probability P ccol Pc_col needs to be consideredPcco l . An additional parameter is introduced here to describe the probability of overlapping transmission failure.
When calculating Pe, add the channel bit error rateP echan Pe_chanPechan , reflects the transmission failure rate caused by channel quality.
When calculating Pc, add the overlapping transmission failure probabilityP cover Pc_overPcov er , reflects the failure rate caused by overlapping transmission.
Ps is calculated as the residual probability, ensuring that the sum of state probabilities is 1.
The form of the throughput rate formula remains unchanged and is calculated using the modified state probability.

Question 4

1. Establish a three-state Markov chain to represent the transmission status of three APs.
2. Calculate the transition probability between states:
●AP1 and AP3 do not listen to each other, and the probability of simultaneous transmission is greater
●AP2 and both listen to each other, and its transmission opportunities are less
●Consider the probability of failure caused by AP1 and AP3 transmitting successively
3. Calculate the time slot length of each state:
●Successful transmission, failed transmission, idle time slot
4. Calculate the system throughput rate using state probability and time slot length
The main difficulty of Question 4 is:
(1) Establish a three-state Markov chain to describe three APs Transmission
(2) Calculate complex transition probabilities between states
(3) Handle the situation where AP1 and AP3 send successively

Clearly define the state meaning of the three-state Markov chain, indicating the transmission status of different APs.
The calculation of state transition probability is more complicated and needs to consider whether different APs listen to each other.
AP1 and AP3 may send messages at the same time if they are not listening to each other. You need to consider the probability of failure caused by sending the two messages one after the other.
AP2 listens to both of them, and its sending opportunities are relatively few, so the transfer probability needs to be set appropriately.
When calculating the status slot length, it is necessary to distinguish between successful transmission, collision failure and idle conditions.
The formula for calculating throughput using state probabilities and slot length is the same as before.
The transition probability is difficult to determine accurately. Reasonable assumptions can be made first and the parameters can be adjusted through simulation.
Ideal simplification cannot fully describe complex wireless channels, but it can reflect the overall trend.
The implementation process can be based on matlab programming and gradually expand the complexity from simple scenarios.
It can be extended from a two-state Markov chain to a three-state Markov chain, adding details step by step.

1. Define the three-state Markov chain
state space: S = { s 1 , s 2 , s 3 } S = \{s_1, s_2, s_3\}S={ s1,s2,s3}
s 1 s_1 s1- Only AP1 sends
s 2 s_2s2- Only AP2 sends
s 3 s_3s3- AP1 and AP3 send
2 at the same time. State transition probability
P ( s 1 ∣ s 1 ) − AP1 sends again after sending probability P ( s 2 ∣ s 1 ) − AP2 sends probability after AP1 ends P ( s 3 ∣ s 1 ) − After AP1 finishes, AP3 also sends probability P ( s 1 ∣ s 2 ) − After AP2 finishes, AP1 sends probability P ( s 2 ∣ s 2 ) − After AP2 finishes, AP3 sends probability P ( s 3 ∣ s 2 ) − After AP2 finishes, AP3 Also send probability P ( s 1 ∣ s 3 ) − After AP1 and AP3 finish, AP1 sends probability P ( s 2 ∣ s 3 ) − After AP1 and AP3 finish, AP2 sends probability P ( s 3 ∣ s 3 ) − AP1 and AP3 After the end, the two will send at the same time with probability P(s1|s1) \quad - \text{The probability of AP1 sending after sending} \\ P(s2|s1) \quad - \text{The probability of AP2 sending after AP1 ends}\\ P(s3|s1) \quad - \text{The probability that AP3 also sends after AP1 ends}\\ P(s1|s2) \quad - \text{The probability that AP1 sends after AP2 ends}\\ P(s2|s2) \ quad - \text{The probability of AP2 sending again after sending}\\ P(s3|s2) \quad - \text{The probability of AP3 also sending after AP2 ends}\\ P(s1|s3) \quad - \text{AP1 and Probability of AP1 sending again after AP3 ends}\\ P(s2|s3) \quad - \text{Probability of AP2 sending after AP1 and AP3 end}\\ P(s3|s3) \quad - \text{After AP1 and AP3 end Probability of sending both at the same time}P(s1∣s1)Probability of sending again after AP1 sendsP(s2∣s1)AP2 sending probability after AP1 endsP(s3∣s1)After AP1 ends, AP3 also sends probabilityP(s1∣s2)AP1 sending probability after AP2 endsP(s2∣s2)Probability of sending again after AP2 sendsP(s3∣s2)After AP2 ends, AP3 also sends probabilityP(s1∣s3)Probability that AP1 will send again after AP1 and AP3 finishP(s2∣s3)After AP1 and AP3 end, AP2 sends probabilityP(s3∣s3)After AP1 and AP3 end, they will send the probability at the same time.

3. Time slot length T s T_sTs, T c T_c Tc, T e T_e Te
4. Use the above parameters to calculate the throughput SSS

Insert image description here

% 参数设置
Ts = 60;    % 成功传输时隙长度
Tc = 100;   % 失败传输时隙长度  
Te = 50;    % 空闲时隙长度
rate = 455.8e6; 

% 状态转移概率矩阵
P = [0.7 0.2 0.1;   % P(s1|s1) P(s2|s1) P(s3|s1) 
     0.3 0.5 0.2;   % P(s1|s2) P(s2|s2) P(s3|s2)
     0.2 0.1 0.7];  % P(s1|s3) P(s2|s3) P(s3|s3)

% 平稳态概率  
pie = [0.4 0.3 0.3];  

% 计算吞吐率
Ps = pie(1); 
Pc = pie(2) + pie(3)*0.3;   % AP1和AP3先后发送失败概率为0.3
Pe = 1 - Ps - Pc;
S = Ps*Ts/(Ps*Ts + Pc*Tc + Pe*Te)*rate

Ablation experiment analysis:

1. Basic model
(1) Establish a two-state Markov chain, state space S={s1,s2}
(2) s1 represents AP1 sending, s2 represents AP2 sending
(3) Ignore the influence of AP3
(4) Transition probability matrix P and time The gap length calculation is similar to questions 1 and 2
(5) Calculate the system throughput rate S

2. Impact of adding AP3
(1) Expand to three-state Markov chain, state space S={s1,s2,s3}
(2) Add s3 state to indicate that AP1 and AP3 are sent at the same time
(3) Reset the state transition probability matrix P
( 4) The time slot length remains unchanged
(5) Calculate the new system throughput rate S
(6) Analyze the changes in throughput rate

3. Add the probability of sequential transmission failure
(1) When calculating the collision failure probability Pc, add the probability of sequential transmission failure
(2) Pc = Pc_s + Pc_f, where Pc_f represents the probability of sequential transmission failure
(3) Recalculate the system throughput rate S
(4) Analyze changes in throughput rate

4. Iterative optimization and evaluation
(1) Adjust the transition probability to make S close to the simulation result
(2) Evaluate the impact of each state on system performance
(3) Analyze the pros and cons of the model

The corresponding conclusion is:

  1. The basic two-state Markov chain model is too simplified and cannot reflect the impact of AP3, and the calculated system throughput rate has a large error.
  2. After adding the three-state Markov chain, the simultaneous transmission of AP3 is taken into account, and the system throughput rate result is more accurate.
  3. Only considering simultaneous transmission collision failure will underestimate the system collision failure probability. The result will be more accurate after adding the probability of sequential transmission failure.
  4. The setting of state transition probability has a great impact on the results, and iterative adjustments are needed to make the results close to the simulation values.
  5. The presence of AP3 reduces AP2's chance, but when both AP1 and AP3 send, the system throughput rate is the highest.
  6. The three-state Markov chain model is between the two-state model and simulation, and can reasonably reflect the system performance. The model can continuously approximate the actual situation through iterative optimization, but there are still idealized simplifications.

Check out more full versions here!
(5 private messages/2 messages) How to evaluate question A of the 2023 Mathematical Modeling Research Competition? - csdn

Guess you like

Origin blog.csdn.net/qq_25834913/article/details/133235669