# Elliptic PDE: Radially Symmetric Singular Solution
Copyright (C) 2010-2020 Luke Olson<br>
Copyright (C) 2020 Andreas Kloeckner

<details>
<summary>MIT License</summary>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</details>

-----

Poisson Problem:
<center> Given open domain $\Omega \subset \mathbb{R}^2$ </center>  
$$ -\nabla \cdot \nabla u = f(x)\quad \text{in}\, \Omega $$
$$ u = g(x)\quad \text{on}\, \partial\Omega $$
Let:
$$ f(x) = \delta(x) $$  
$\delta(x)$ is the Dirac delta function. This problem describes a unit charge at the origin.

## Solution

Potential due to point charge:
$$ u(x,y) = -\frac{1}{2\pi}\ln(r) $$

<center> $r = \sqrt{x^2+y^2}$, the distance to the origin.</center>


```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import math

import sympy as sym
sym.init_printing()
```

## Set up Grid


```python
X = np.arange(-10, 10, 0.2)
Y = np.arange(-10, 10, 0.2)
X, Y = np.meshgrid(X, Y)
```

## Solution


```python
r = np.sqrt(X**2 + Y**2)
Z = -np.log(r)/(2*math.pi)
```

## Check Symbolically


```python
sx = sym.Symbol("x")
sy = sym.Symbol("y")
sr = sym.sqrt(sx**2 + sy**2)
ssol = sym.log(sr)

sym.simplify(sym.diff(ssol, sx, 2) + sym.diff(ssol, sy, 2))
```

## Plot


```python
fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection='3d')
#ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm,
#                       linewidth=0, antialiased=False)
ax.plot_wireframe(X, Y, Z, linewidth=0.2)
#ax.set_zlim(-1.0, 1.0)
#plt.show()

```

Given $C\log(r)$ as the *free-space Green's function*, can we construct the solution to the PDE with a more general $f$?

70d52663d735febfc2925b7a6513bd6f39d63d6b
ipynb
Jupyter Notebook
demos/intro/Elliptic PDE Radially Symmetric Singular Solution.ipynb
inducer/numpde-notes
80952b692fc16f185042a64d91312b0e53fafe17
Unlicense
2020-05-31T23:00:01.000Z
2021-12-25T15:08:14.000Z
demos/intro/Elliptic PDE Radially Symmetric Singular Solution.ipynb
inducer/numpde-notes
80952b692fc16f185042a64d91312b0e53fafe17
Unlicense
demos/intro/Elliptic PDE Radially Symmetric Singular Solution.ipynb
inducer/numpde-notes
80952b692fc16f185042a64d91312b0e53fafe17
Unlicense
2020-08-14T22:49:30.000Z
2021-12-25T15:08:34.000Z
Qwen/Qwen-72B
1. YES
2. YES