How Do We Find An Electric Field From A Plot Of The Electric Potential?
The brine tank is a historical and excellent way to detect solutions to the Laplace equation! This was used to design things like cyclotron magnets and electrostatic lenses for charged particles before computers were fast enough.
Epitome from Tanabe and Yamada 1958; Science reports of the Research Plant, Tohoku University, Serial A, 10, 133-174
The simplest manner to solve it numerically is to do "Jacobi relaxation". Read more virtually information technology here for example. In cartesian coordinates, y'all make a numerical grid and prepare the points that stand for to the surface of the conductors to their potential, and set the potential to the boundary to some intermediate value. Below I've chosen -1, +1 and 0. The purlieus needs to be far enough away that it doesn't impact your region of interest much. This is an judge technique.
And so y'all iterate. For each pass, you make a new potential that is the boilerplate of the +/-ten and +/-y nearest neighbors, four in total. You update only the points that are not on the conductor or boundary. After thousands of iterations the potential approaches a solution to the Laplace equation.
If yous want a meliorate solution, make the spacing smaller and the boundary farther away. If it'southward too deadening (frequently it is in 3D) and then you can utilize
-
Multigrids; solve on a coarse (fast) grid, then interpolate to a fine grid and iterate a piffling longer
-
Successive Overrelaxation; "overshoot" the averaging by changing the values by an amount larger than 100% of what you lot would take with elementary averaging. Try values like 110% to 150%, it tin can go unstable if they are besides large.
If you have whatsoever questions or need description, get out a comment. I used this technique in this question, where I saved intermediate snapshots and turned them into a GIF.
Here is an instance in Python:
import numpy equally np import matplotlib.pyplot equally plt from scipy.ndimage import convolve d = 0.25 x = np.arange(0, 35+d, d) y = np.arange(0, 48+d, d) X, Y = np.meshgrid(x, y) phi = np.zeros_like(X) isneg = np.zeros_like(X, dtype=bool) ispos = np.zeros_like(X, dtype=bool) jump = np.zeros_like(Ten, dtype=bool) isneg[(X>=ix)*(X<=xix)*(Y>=x)*(Y<=12)] = Truthful ispos[(X>=x)*(X<=20)*(Y>=28)*(Y<=30)] = Truthful ispos[(X>=18)*(X<=20)*(Y>=xx)*(Y<=28)] = True leap[:,0] = bound[:,-one] = jump[0,:] = jump[-1,:] = Truthful phi[isneg] = -1.0 phi[ispos] = +1.0 phi[jump] = 0.0 updateme = np.ones_like(X, dtype=bool) updateme[isneg] = updateme[ispos] = updateme[spring] = Fake kernel = 0.25*np.array([[0, i, 0], [1, 0, i], [0, 1, 0]], dtype=float) phi0 = phi.copy() # keep the original handy keepers = 0, 100, 500, 1000, 2000, 9999 keep = [] for i in range(10000): if i in keepers: keep.append(phi.re-create()) print i phi2 = convolve(phi, kernel) phi[updateme] = phi2[updateme] plt.figure() for i, (affair, due north) in enumerate(zip(keep, keepers)): plt.subplot(ii, 3, i+one) plt.imshow(affair, origin='lower') plt.title("northward="+str(n)) plt.show()
Source: https://physics.stackexchange.com/questions/113290/simulate-plot-electrostatic-field
Posted by: sheppardforgiagether.blogspot.com
0 Response to "How Do We Find An Electric Field From A Plot Of The Electric Potential?"
Post a Comment