upd
This commit is contained in:
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