This repository has been archived on 2026-01-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-01-07 19:20:04 +03:00

20 lines
294 B
Python

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()