ex-4: created a program for plotting the expected distribution
This commit is contained in:
parent
15079ff587
commit
87beaa2248
24
ex-4/note.py
Normal file
24
ex-4/note.py
Normal file
@ -0,0 +1,24 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
p_max = 10
|
||||
|
||||
def f(x):
|
||||
return x * np.log(p_max/x)/np.arctan(np.sqrt(p_max**2/x**2 - 1))
|
||||
|
||||
|
||||
def main():
|
||||
x = np.arange(0, 10, 0.001)
|
||||
y = f(x)
|
||||
|
||||
plt.rcParams['font.size'] = 20
|
||||
plt.figure()
|
||||
plt.title('Expected distribution', loc='right')
|
||||
plt.ylabel('$\\langle |P_v| \\rangle$')
|
||||
plt.xlabel('$P_h$')
|
||||
plt.plot(x, y, c='#92182b')
|
||||
plt.show()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
BIN
notes/images/expected.pdf
Normal file
BIN
notes/images/expected.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user