 #1
Nur Ziadah
 35
 3
I have a few of integration equations and need to convert it into Python. The problem is when I tried to plot a graph according to the equation, some of the plot is not same with the original one.
The first equation is the error probability of authentication in normal operation:
cond equation is the error probability of authentication under MIM attack:
The error probability of authentication in normal operation can be calculated by:
Supposedly, the graph (original) will be shown like this:
yaxis: error probability
xaxis: N
Pe^normal = blue lines
Pe^MIM = red lines
Differences between two error probabilities (Pe^MIM  Pe^normal)= green lines
I tried to code it into Python and this is my full codes:
The graph produce from my code is:
It looks like that my plot is not same with the original one in terms N=0 of Pe^MIM (red line) and differences between two error probabilities (green line). The problem is the calculation for error probability under MIM attack was not given.
I hope that anyone may help me to solve this problem.
Thank you.
The first equation is the error probability of authentication in normal operation:
cond equation is the error probability of authentication under MIM attack:
The error probability of authentication in normal operation can be calculated by:
Supposedly, the graph (original) will be shown like this:
yaxis: error probability
xaxis: N
Pe^normal = blue lines
Pe^MIM = red lines
Differences between two error probabilities (Pe^MIM  Pe^normal)= green lines
I tried to code it into Python and this is my full codes:
Python:
import matplotlib.pyplot as plt
import math
import numpy as np
from scipy.special import iv,modstruve
x=np.arange(0.5,21,1)
x = np.array(x)
t = 0.9
pe_normal = (np.exp(t*x/2)*(iv(0, t*x/2)  modstruve(0,t*x/2))1)/(np.exp(t*x)1)
pe_diff = (np.exp((1t**2)*x/2)*(iv(0, (1t**2)*x/2)  modstruve(0,(1t**2)*x/2))1)/(np.exp((1t**2)*x)1)
pe_mim= np.add(pe_normal,pe_diff)
plt.plot(x, pe_normal, '', color='blue', label='Normal')
plt.plot(x, pe_mim, '', color='red', label='MIM')
plt.plot(x, pe_diff, '', color='green', label='DIFF')
plt.xlabel('Mean photon number N')
plt.ylabel('Error probabiity')
plt.text(10, 0.4, 't=0.9', size=12, ha='center', va='center')
plt.ylim([0, 0.5])
plt.xlim([0, 20])
plt.legend()
plt.show()
The graph produce from my code is:
It looks like that my plot is not same with the original one in terms N=0 of Pe^MIM (red line) and differences between two error probabilities (green line). The problem is the calculation for error probability under MIM attack was not given.
I hope that anyone may help me to solve this problem.
Thank you.
Attachments

upload_20181229_12216.png2 KB · Views: 1,125

upload_20181229_12248.png2.6 KB · Views: 1,026

upload_20181229_12356.png5.7 KB · Views: 1,114

upload_20181229_12442.png2.7 KB · Views: 1,075

upload_20181229_12729.png6.3 KB · Views: 474

afNIG.png1.9 KB · Views: 449

upload_20181229_142955.png6 KB · Views: 1,023
Last edited: