Tackling Boundary Conditions in Python (Griffins Example)

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
zhuang382
Messages
9
Reaction score
2
How to run a numerical simulation of Laplace equation if one of the boundary condition is like this: $$V(x,y) = 0 \text{ when } x \to \infty$$

I am trying to use Python to plot the solution of this Example 3.5. in Griffins EM
 
on Phys.org
The example works out the solutions, and you say "run a numerical simulation" which to my mind means numerically solving for a solution. I'm not sure I understand which you mean.

If you merely mean plotting the solutions then I'm not sure why you are asking about x->infinity boundary conditions. You obviously can't make an infinite plot and so would merely graph the function for a finite range at a sufficient scale to see the important features.

If you are actually tackling the numerical solution then I would a.) hope you are using the separability to solve 3 coupled ODE's instead of the whole pde. The latter would involve using finite elements which is involved and not ideal given the boundary conditions are compatible with a separable solution.

If you are working with the seperable ODE's then there are three approaches I would suggest for dealing with the boundary at infinity.

First You can, approximate the case with a distant but finite boundary with V=0 there as your condition.

Second You can transform the equation to a new coordinate which maps a finite interval to ##x\in [0,\infty)##. For example ##x=\frac{\xi}{c-\xi}, \xi\in[0,c)## or ##x=\ln(\xi/c)/k## or ##x = \tan(2\xi/\pi c)##. You will of course have to transform the 2nd derivative operator to the new coordinate, a nice exercise in calculus.

For example: Using ## x = -\ln(\xi/c)\to \xi = ce^{-kx}## you get ##\partial_x = -kc e^{-kx}\cdot\partial_\xi = -k\xi\cdot\partial_\xi## and so ##\partial_x^2 = k^2\xi\cdot\partial_\xi (\xi\cdot\partial_\xi)##.
Just be aware, in this example, that ##\xi=c \leftrightarrow x=0, \xi\to0 \leftrightarrow x\to \infty##.