upd
This commit is contained in:
18
exam/archive/scripts/2.py
Normal file
18
exam/archive/scripts/2.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
E = 1.0
|
||||
r = 1.0
|
||||
|
||||
R = np.linspace(0.001, 5, 500)
|
||||
|
||||
P = E**2 * R / (R + r)**2
|
||||
|
||||
plt.plot(R, P)
|
||||
plt.xlabel("R")
|
||||
plt.ylabel("P(R)")
|
||||
plt.grid(True)
|
||||
|
||||
plt.savefig("2.png", dpi=300, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
||||
17
exam/archive/scripts/4.py
Normal file
17
exam/archive/scripts/4.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
r = 1.0
|
||||
|
||||
R = np.linspace(0.001, 10, 500)
|
||||
|
||||
eta = R / (R + r)
|
||||
|
||||
plt.plot(R, eta)
|
||||
plt.xlabel("R")
|
||||
plt.ylabel("η(R)")
|
||||
plt.grid(True)
|
||||
|
||||
plt.savefig("4.png", dpi=300, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
||||
19
exam/archive/scripts/5.py
Normal file
19
exam/archive/scripts/5.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
R = 1.0
|
||||
E0 = 1.0
|
||||
|
||||
r = np.linspace(0, 2.5*R, 500)
|
||||
|
||||
E = np.where(r <= R, E0 * r / R, E0 * (R**2) / (r**2))
|
||||
|
||||
# plot
|
||||
plt.plot(r, E)
|
||||
plt.xlabel("r")
|
||||
plt.ylabel("E(r)")
|
||||
plt.grid(True)
|
||||
|
||||
plt.savefig("5.png", dpi=300, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user