<jupyter_start><jupyter_text>electrode geometry<jupyter_code># z grid position
zg = 75
el = fa.electrode

# electrodes
fig, ax = plt.subplots(figsize=(9, 4))
c0 = ax.imshow(el[:, :, zg].T, origin='lower', extent=fa.extent[:4] / milli, cmap=bool_cmap, vmin=0, vmax=1)
cbar = fig.colorbar(c0, label='electrode')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
ax.set_ylabel('y (mm)')
plt.show()<jupyter_output><empty_output><jupyter_text>electric potential<jupyter_code>voltages = np.array([2.5, 2.5, -2.5, -2.5], dtype='float64')
phi = fa.potential(voltages)

# potential
fig, ax = plt.subplots(figsize=(9, 4))
c0 = ax.imshow(phi[:, :, zg].T, origin='lower', extent=fa.extent[:4] / milli, cmap='RdBu')
cbar = fig.colorbar(c0, label='potential (V)')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
ax.set_ylabel('y (mm)')
plt.show()
X, Y, Z = fa.grid()

# potential
fig, ax = plt.subplots(figsize=(9,4))
c0 = ax.contourf(X[:, :, zg] * 1e3, Y[:, :, zg] * 1e3, phi[:, :, zg], cmap='RdBu')
cbar = fig.colorbar(c0, label='potential (V)')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
ax.set_ylabel('y (mm)')
plt.show()<jupyter_output><empty_output><jupyter_text>electric field<jupyter_code># subset 
xmin, ymin, zmin = np.round(fa.grid_r((-0.003, -0.002, 0)))
xmax, ymax, zmax = np.round(fa.grid_r((0.0032, 0.0022, 0)))
subset = (slice(int(xmin), int(xmax), 2), slice(int(ymin), int(ymax), 2), zg)

# field
ex, ey, ez = fa.field(voltages)

fig, ax = plt.subplots(figsize=(6, 6))
ax.quiver(X[subset] * 1e3, Y[subset] * 1e3, ex[subset], ey[subset], angles='xy')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
ax.set_ylabel('y (mm)')
plt.show()<jupyter_output><empty_output><jupyter_text>field amplitude<jupyter_code>famp = fa.amp_field(voltages)

fig, ax = plt.subplots(figsize=(9, 4))
c0 = ax.imshow(famp[:, :, zg].T * centi, origin='lower', extent=fa.extent[:4] / milli, cmap='viridis')
cbar = fig.colorbar(c0, label='electric field (V / cm)')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
plt.show()
fig, ax = plt.subplots(figsize=(9,4))
c0 = ax.contourf(X[:, :, zg] * 1e3, Y[:, :, zg] * 1e3, famp[:, :, zg] * centi, 12, cmap='viridis')
cbar = fig.colorbar(c0, label='electric field (V / cm)')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
plt.show()<jupyter_output><empty_output><jupyter_text>field gradient<jupyter_code>gx, gy, gz = fa.grad_field(voltages)

fig, ax = plt.subplots(figsize=(6, 6))
ax.quiver(X[subset] * 1e3, Y[subset] * 1e3, gx[subset], gy[subset], angles='xy')
ax.set_aspect('equal')
ax.set_xlabel('x (mm)')
ax.set_ylabel('y (mm)')
plt.show()<jupyter_output><empty_output><jupyter_text>point calculations<jupyter_code>xvals = np.arange(-10, 10, .1) * 1e-3
fvals = [fa.amp_field_r((x, 0, 0.075), voltages) * centi for x in xvals]

fig, ax = plt.subplots(figsize=(8,4))
ax.plot(xvals / milli, fvals)
ax.set_ylabel('electric field (V / cm)')
ax.set_xlabel('x (mm)')
plt.show()
gx, gy, gz = np.array([np.array(fa.grad_field_r((x, 0, 0.075), voltages)) * centi**2.0 for x in xvals]).T

fig, ax = plt.subplots(figsize=(8,4))
ax.plot(xvals / milli, gx)
ax.plot(xvals / milli, gy)
ax.plot(xvals / milli, gz)
ax.set_ylabel('grad |F| (V / cm^2)')
ax.set_xlabel('x (mm)')
plt.show()
yvals = np.arange(-8, 8, .1) * 1e-3
fvals = [fa.amp_field_r((0, y, 0.075), voltages) * centi for y in yvals]

fig, ax = plt.subplots(figsize=(8,4))
ax.plot(yvals / milli, fvals)
ax.set_ylabel('electric field (V / cm)')
ax.set_xlabel('y (mm)')
plt.show()
gx, gy, gz = np.array([np.array(fa.grad_field_r((0, y, 0.075), voltages)) * centi**2.0 for y in yvals]).T

fig, ax = plt.subplots(figsize=(8,4))
ax.plot(yvals / milli, gx)
ax.plot(yvals / milli, gy)
ax.plot(yvals / milli, gz)
ax.set_ylabel('grad |F| (V / cm^2)')
ax.set_xlabel('y (mm)')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22372611464968153, 'fraction_numerical': 0.03370488322717622, 'mean_word_length': 5.766606822262118, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '510903', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1833, 'n_tokens_neox': 1756, 'n_words': 322, 'path': 'notebooks/fastadjust.ipynb', 'repo_name': 'ad3ller/fastadjust_pa', 'size': '3768'}