{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"using Plots, ComplexPhasePortrait, ApproxFun, SingularIntegralEquations\n",
"gr();"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# M3M6: Methods of Mathematical Physics\n",
"\n",
"$$\n",
"\\def\\dashint{{\\int\\!\\!\\!\\!\\!\\!-\\,}}\n",
"\\def\\infdashint{\\dashint_{\\!\\!\\!-\\infty}^{\\,\\infty}}\n",
"\\def\\D{\\,{\\rm d}}\n",
"\\def\\dx{\\D x}\n",
"\\def\\dt{\\D t}\n",
"\\def\\C{{\\mathbb C}}\n",
"\\def\\CC{{\\cal C}}\n",
"\\def\\HH{{\\cal H}}\n",
"\\def\\I{{\\rm i}}\n",
"\\def\\qqfor{\\qquad\\hbox{for}\\qquad}\n",
"$$\n",
"\n",
"Dr. Sheehan Olver\n",
"
\n",
"s.olver@imperial.ac.uk\n",
"\n",
"
\n",
"Website: https://github.com/dlfivefifty/M3M6LectureNotes\n",
"\n",
"# Lecture 12: Ideal fluid flow\n",
"\n",
"Understanding branch cuts and Cauchy transforms allows us to systematically solve equations involving Laplace equation. A classic example is Ideal fluid flow. Consider the case of uniform flow with angle $\\theta$ around an infinitesimally small plate on $[-1,1]$. We can model this as\n",
"$$\n",
"\\begin{align*}\n",
"v(x,y) &\\sim y \\cos \\theta - x \\sin \\theta \\\\\n",
"v_{xx} + v_{yy} &= 0 \\\\\n",
"v(x,0) & = 0 \\qqfor -1 < x <1\n",
"\\end{align*}\n",
"$$\n",
"Using the techniques we developed in the last few lectures, we obtain a nice, simple, closed form expression as the imaginary part of an analytic function:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"μ = z -> -im*(sqrt(z-1)sqrt(z+1) - z)\n",
"Φ = (θ,z) -> exp(-im*θ)*z + sin(θ)μ(z)\n",
"u = (θ,x,y) -> imag(Φ(θ, x + im*y))\n",
"\n",
"xx = yy = range(-3; stop=3 , length=500)\n",
"contour(xx, yy, u.(1.3,xx',yy); nlevels = 100)\n",
"plot!(Segment(-1.,1.); color=:black, label=\"obstacle\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We divide this task into stages:\n",
"\n",
"1. Rephrasing as a complex-analytical problem: $v(x,y)$ to $\\phi(z)$\n",
"2. Reduction to inverting a Hilbert transform: $\\phi(z)$ to $w(x)$\n",
"3. Calculating the inverse Hilbert transform: Finding $w(x)$\n",
"4. Calculating its Cauchy transform: $w(x)$ to $\\phi(z)$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"### 1. Real and imaginary parts of analytic functions satisfy Laplace's equation\n",
"\n",
"The real and imaginary parts of an analytic function satisfy Laplace's equation: that is if $\\phi(z) = \\phi(x + \\I y) = u(x,y) + \\I v(x,y)$ where $u$ and $v$ are the real/imaginary parts, then \n",
"$$\n",
" u_{xx} + u_{yy}= 0 \\\\\n",
" v_{xx} + v_{yy} = 0\n",
"$$\n",
"To see this, note that the complex-derivative of $\\phi(z)$ can be written in terms of two different partial derivatives:\n",
"$$\n",
" \\phi'(z) = \\lim_{h \\rightarrow 0} {\\phi(z+h) - \\phi(z) \\over h} = \\lim_{h \\rightarrow 0} {u(x+h,y)-u(x,y) + \\I (v(x+h,y)-v(x,y)) \\over h} = u_x + \\I v_x \\\\\n",
" \\phi'(z) = \\lim_{h \\rightarrow 0} {\\phi(z+\\I h) - \\phi(z) \\over \\I h} = \\lim_{h \\rightarrow 0} {u(x,y+h)-u(x,y) + \\I (v(x,y+h)-v(x,y)) \\over \\I h} = - \\I u_y + v_y\n",
"$$\n",
"Taking a second derivative we get two equations:\n",
"$$\n",
" \\phi'(z) = u_{xx} + \\I v_{xx} = -u_{xx} -\\I v_{yy} \n",
"$$\n",
"which implies $u_{xx} + u_{yy} = 0$ and $v_{xx} + v_{yy} = 0$.\n",
"\n",
"\n",
"### 2. Reduce PDE to the Hilbert transform of an unknown function\n",
"\n",
"Therefore we can rewrite the ideal fluid flow equation as a problem of calculating $\\phi(z) = u(x,y) + \\I v(x,y)$ whose imaginary part is the solution too the ideal fluid flow PDE (we don't use the real part $u$). That is, we want to find analytic $\\phi(z)$ that satisfies\n",
"\\begin{align*}\n",
" \\phi(z) &\\sim e^{-\\I \\theta} z \\\\\n",
" \\Im \\phi(x) &= 0 \\qquad\\hbox{for}\\qquad -1 < x < 1\n",
"\\end{align*}\n",
"\n",
"\n",
"Write\n",
"$$\n",
"\\phi(z) = e^{-\\I \\theta} z + c + \\CC_{[-1,1]} w(z)\n",
"$$\n",
"for an as-of-yet unknown function $w$ and $C$ an unknown constant, we have that\n",
"$$\n",
"0 = \\Im \\phi(x) = -x \\sin \\theta + \\Im c + \\Im \\CC_{[-1,1]}^+ w(x) = -x \\sin \\theta + \\Im c -{1 \\over 2} \\HH w(x)\n",
"$$\n",
"In this example, we can take $c = 0$. Therefore, we want to solve\n",
"$$\n",
"\\HH w(x) = - 2 x \\sin \\theta\n",
"$$\n",
"for $w$. \n",
"\n",
"\n",
"### 3. Calculating the inverse Hilberrt transform\n",
"\n",
"We now plug the problem into the inverse Hilbert transform formula:\n",
"\n",
"$$\n",
" w(x) = {- 1\\over \\sqrt{1-x^2}} {\\cal H}[f \\sqrt{1-\\diamond^2}](x) + {D \\over \\sqrt{1-x^2}}\n",
"$$\n",
"\n",
"where $f(x) = -2 x \\sin \\theta$. Now that\n",
"\n",
"Similar to last lecture, we find\n",
"$$\n",
"{\\cal C}[\\diamond \\sqrt{1-\\diamond^2}](z) = {z \\sqrt{z-1} \\sqrt{z+1} - z^2 + 1/2 \\over 2 \\I }\n",
"$$\n",
"and therefore\n",
"$$\n",
"{\\cal H}[\\diamond \\sqrt{1-\\diamond^2}](x) = \\I({\\cal C}^+ + {\\cal C}^-)[\\diamond \\sqrt{1-\\diamond^2}](x) = {1 \\over 2} - x^2\n",
"$$\n",
"Thus (relabeling $D$) we have\n",
"$$\n",
"w(x) = 2\\sin \\theta {D-x^2 \\over \\sqrt{1-x^2}} \n",
"$$\n",
"\n",
"_Demonstration_ Here we see that this gives us the right Hilbert transform:"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.0"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"D = randn()\n",
"θ = 0.1\n",
"x = Fun()\n",
"w = 2sin(θ) * (D-x^2)/sqrt(1-x^2)\n",
"hilbert(w,0.2)- (-2sin(θ)*0.2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$D$ is arbitrary, but from physical principles we know that we don't want the solution to blow up. If $w$ blows up then so does its Cauchy transform. Therefore, we choose $D = -1$ so that\n",
"\n",
"$$\n",
"w(x) = 2 \\sin \\theta \\sqrt{1-x^2}\n",
"$$\n",
"\n",
"### 4. Calculating its Cauchy transform\n",
"\n",
"Now recall\n",
"$$\n",
"\\CC\\left[{\\sqrt{1-\\diamond^2}}\\right](z) = {\\sqrt{z-1} \\sqrt{z+1} -z \\over 2 \\I}\n",
"$$\n",
"\n",
"Therefore, $w(x) = 2 \\sin \\theta \\sqrt{1-x^2}$, implies\n",
"$$\n",
"\\CC w(z) = - \\I \\sin \\theta (\\sqrt{z-1} \\sqrt{z+1} -z)\n",
"$$\n",
"which means\n",
"$$\n",
"\\phi(z) = e^{-\\I \\theta} z - \\I \\sin \\theta (\\sqrt{z-1} \\sqrt{z+1} -z).\n",
"$$\n",
"\n",
"\n",
"## Numerical example of two intervals\n",
"\n",
"We note that for obstacles on the real line, represented by a contour $\\Gamma$, the problem of ideal fluid flow around $\\gamma$ is still reducible to solving the singular integral equation\n",
"$$\n",
"\\HH_\\Gamma f(x) = - 2 x \\sin \\theta\n",
"$$\n",
"Even when not solvable exactly, one can solve it numerically:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a = 0.3\n",
"θ = 1.3\n",
"Γ = Segment(-1,-a) ∪ Segment(a, 1)\n",
"\n",
"x = Fun(Γ)\n",
"sp = PiecewiseSpace(JacobiWeight.(0.5,0.5,components(Γ))...)\n",
"H = Hilbert(sp)\n",
"\n",
"\n",
"o₁ = Fun(x -> -1 ≤ x ≤ -a ? 1 : 0, Γ )\n",
"o₂ = Fun(x -> a ≤ x ≤ 1 ? 1 : 0, Γ )\n",
"\n",
"a, b, f = [o₁ o₂ H] \\ [-2x*sin(θ)]\n",
"\n",
"\n",
"Φ = (θ,z) -> exp(-im*θ)*z + cauchy(f, z)\n",
"v = (θ,x,y) -> imag(Φ(θ, x + im*y))\n",
"\n",
"xx = yy = range(-3.; stop=3., length=500)\n",
"contour(xx, yy, v.(θ, xx',yy); nlevels = 100)\n",
"plot!(Γ; color=:black, label=\"obstacle\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.0.2",
"language": "julia",
"name": "julia-1.0"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}