# Ions around a charged rod The potential around a charged rod in salt water, where the ions that screen it respond to it exponentially. ```python import sympy as sp import pdemagic as pm x, y = sp.symbols("x y", real=True) c = sp.Function("c")(x, y) rod = 8 * sp.exp(-(x**2 + y**2)) electrolyte = pm.Problem( sp.Eq(-pm.laplacian(c) + sp.sinh(c), rod), domain=pm.FreeSpace(x, y) ) pm.solve(electrolyte).plot() ``` ## What it shows The Poisson–Boltzmann equation, $-\nabla^2 c + \sinh c = \rho$, in the plane across a rod that carries the charge $\rho$. In an electrolyte the ions of opposite charge gather around the rod and screen it. Their density follows the potential exponentially, which makes the equation nonlinear. Where the potential is small, $\sinh c$ is nearly $c$, and the equation is the screened Poisson equation of [a screened charge](screened-charge.md). Where it is large, the screening is stronger: the potential at the rod is 2.11 here, and the linear equation would give 2.66. ## What pdemagic decided A term that is nonlinear in the unknown is solved by Newton's method, from zero (`fourier_newton`), here in five steps. Each step is a linear equation with a coefficient that varies, solved by an iteration on the Fourier method. The grid has 64 by 64 points, on a box around the rod. ## More - [Nonlinear stationary equations](../topics/nonlinear.md) - [Newton's method for nonlinear stationary equations](../methods/newton.md) - [What is solved in free space and on periodic boxes](../ref/equations-free-space.md)