Poisson Problem:
Potential due to point charge: $$ u(x,y) = -\frac{1}{2\pi}\ln(r) $$
numpy
is used for vectors and linear algebramatpllotlib.pyplot
is used for plotting%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import math
X = np.arange(-10, 10, 0.2)
Y = np.arange(-10, 10, 0.2)
X, Y = np.meshgrid(X, Y)
r = np.sqrt(X**2 + Y**2)
Z = -np.log(r)/(2*math.pi)
fig = plt.figure()
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()