मागील वर्षाचा NEET प्रश्न- P मध्ये फील्ड आणि क्षमता
=== फ्रॉन्ट मटर फील्ड्स ===
शीर्षक: गेल्या वर्षचे NEET प्रश्न - क्षेत्र आणि संभाव्यता पी
=== बॉडी ===
# Define the charge locations and the path
q1 = +q
q2 = -q
p1 = [0, 0, 0]
p2 = [1, 1, 1]
y = lambda x: x**2
path = [p1] + [tuple(p1 + (x, y(x))) for x in np.linspace(0, 1, 100)] + [p2]
# Calculate the electric field strength
E = (q1 - q2) / (4 * np.pi * eps0 * np.sqrt(x**2 + y**2)) * np.array([x, y, 0]) / np.sqrt(x**2 + y**2)
# Calculate the work done by the electric field
W = np.sum(E * np.diff(path))
print(W)