Previous Year NEET Question- Field And Potential In P

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


sathee Ask SATHEE

Welcome to SATHEE !
Select from 'Menu' to explore our services, or ask SATHEE to get started. Let's embark on this journey of growth together! 🌐📚🚀🎓

I'm relatively new and can sometimes make mistakes.
If you notice any error, such as an incorrect solution, please use the thumbs down icon to aid my learning.
To begin your journey now, click on

Please select your preferred language