Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Other Sciences
Programming and Computer Science
How to fix the error probability plot in Python for MIM and PNS attacks?
Reply to thread
Message
[QUOTE="Nur Ziadah, post: 6106787, member: 644865"] I have several equations and need to convert it into Python. The problem is that I tried to plot a graph according to the equation. However, the graph that I get is not the same as the original one. [B]In the paper, the equation of error probability for MIM attack is given by:[/B] [B]First Image[/B] [ATTACH=full]236010[/ATTACH] [B]Second Image [ATTACH=full]236011[/ATTACH] The equation to calculate the error probability of PNS attack is given by: [ATTACH=full]236012[/ATTACH] Where the region condition satisfied: [ATTACH=full]236013[/ATTACH] The error probability of PNS attack should be plotted like this: [ATTACH=full]236014[/ATTACH] [B]My question:[/B] How to insert equation 8.1 into equation 8.5? [B]This is my python code according to equation 8.5:[/B][/B] [code=Python]import matplotlib.pyplot as plt import math import numpy as np from scipy.special import iv,modstruvex=[0, 5, 10, 15, 20] t= 0.9 x = np.array(x) y = (np.exp(x*t/2)*(iv(0, x*t/2) - modstruve(0,x*t/2))-1)/(np.exp(x*t/2-1)) plt.plot(x, y, label='Normal') plt.xlabel('Mean photon number N') plt.ylabel('Error probabiity') plt.scatter(x,y) plt.title('N/2') plt.ylim([0, 0.5]) plt.legend() plt.show()[/code] [B][/B] Please help me regarding this matter. Thank you. [B][/B] [/QUOTE]
Insert quotes…
Post reply
Forums
Other Sciences
Programming and Computer Science
How to fix the error probability plot in Python for MIM and PNS attacks?
Back
Top