I am trying to validate that the Schwartz-Christoffel mapping does indeed take the upper-half plane $\mathbb{H} = \{ z: \mathrm{Re}(z) > 0\}$ to a polygon.
This involves integrals of functions of the type and computing at every point.
$$ f(z) = \int_0^z \frac{dx}{\sqrt{(x-a)(x-b)}}$$
where $a < b \in \mathbb{R}$.
I would like the case $a = 1,b=-1$. I know this integral can be computed exactly, but not if the denominator $P(z)$ were a cubic or quartic like $x^4 - 1$.
Here is a numpy script I wrote... sorry if it's wrong.
import numpy as np
impott matplotlib.pyplot as plt
f = lambda z: np.cumsum(z, axis=1) + 1j*np.cumsum(z, axis=0)
n = 200
dt = 1.0/n
y = (np.ones((n,2*n)))/n
y = f(y)-1
w = y[(y.imag > 0.001)] # semicircle of radius 1
g = lambda t: np.sqrt(1 - t**2)**-0.5 # function to be integrated
plt.plot((g(w)).real, g(w).imag, 'b.')
plt.axis("Equal")
plt.show()
Here's the picture I came up with... defintely not a polygon. Maybe I have to change the original mesh?
I don't want to compute the antiderivative exactly, since I would like it to work for more complex examples like $\int_0^z \frac{dx}{\sqrt{(x-1)(x-2)(x-3)}}$. Instead I proposed two strategy:
- build a mesh representing values of $\frac{1}{\sqrt{P(z)}}$
- transform the mesh into the values of $\int_0^z$ at each point
- if the roots of $P(z)$ are real and we stick to $\mathrm{Re}(z)> 0$ the square-root is still single-valued at least