In [19]:
using Plots, ComplexPhasePortrait, ApproxFun, DualNumbers, SpecialFunctions
gr()
Out[19]:
Dr. Sheehan Olver
s.olver@imperial.ac.uk
Office Hours: 4-5pm Mondays, Huxley 6M40
Website: https://github.com/dlfivefifty/M3M6LectureNotes
Central themes:
Applications (not necessarily discussed in the course):
There is a project worth 10%. This project is open ended: you propose a topic. This could be computational based (possibly based on the slides), theoretical based (possibly looking at material from Ablowitz & Fokas), or otherwise. If you are having difficulty coming up with a proposal, please attend the office hours for advice.
Timeline:
The first few lectures will review the basics of complex analysis. We will use plots to help explain the material, and so this first lecture will focus on getting comfortable with plots of analytic functions.
Consder a complex-valued function $f : D \rightarrow {\mathbb C}$ where $D \subset {\mathbb C}$. To help understand such functions it is useful to plot them. But how?
Every complex-valued function can be written as $f(z) = u(z) + i v(z)$ where $u : D \rightarrow {\mathbb R}$ and $v : D \rightarrow {\mathbb R}$ are real-valued. These are easy to plot separately. We can do a surface plot:
In [2]:
f = z -> exp(z)
u = z -> real(f(z))
v = z -> imag(f(z))
# set up plotting grid
xx = range(-2 ; stop=2, length=100)
yy = range(-10; stop=10, length=100)
plot(surface(xx, yy, u.(xx' .+ im.*yy); title="real"),
surface(xx, yy, v.(xx' .+ im.*yy); title="imag"))
Out[2]:
Or a heat plot:
In [3]:
plot(contourf(xx, yy, u.(xx' .+ im.*yy); title="real"),
contourf(xx, yy, v.(xx' .+ im.*yy); title="imag"))
Out[3]:
In [4]:
xx = -2:0.01:2
yy = -10:0.01:10
f = z -> exp(z)
r = z -> abs(f(z))
θ = z -> angle(f(z))
plot( contourf(xx, yy, r.(xx' .+ im.*yy); title="abs"),
contourf(xx, yy, θ.(xx' .+ im.*yy); title="phase"))
Out[4]:
In [5]:
phaseplot(-3..3, -8..8, z -> exp(z))
Out[5]:
This is seen most clearly with $f(z) = z$: in this case, letting $z = r \E^{\I \theta}$ we are simply plotting $\theta$:
In [6]:
phaseplot(-3..3, -3..3, z -> z)
Out[6]:
In other words, the colour red corresponds to $\arg f(z) \approx 0$, green to $\arg f(z) \approx {2 \pi \over 3}$ aqua to $\arg f(z) \approx \pi$ and so on.
Note that multiplying $z$ by a complex number $R \E^{\I \varphi}$ will rotate the wheel, but the colours still appear in the same order when read counter clockwise:
In [7]:
phaseplot(-3..3, -3..3, z -> exp(1.0im)*z)
Out[7]:
Therefore, if $f(z)$ has a zero at $z_0$, since it behaves like $f(z) = f'(z_0) (z - z_0)$, we will have the full colour wheel always in the counter clockwise order red–green–blue–red:
In [8]:
phaseplot(-20..20, -3..3, z -> sin(z))
Out[8]:
In the case of a double root like $f(z) = z^2 = r \E^{2 \I \theta}$, we have the wheel appearing twice, but still in the same order. Thus the order of a zero can be seen by the number of times we go around the colour wheel: here we see that the function has a triple root at zero since it goes red–green–blue–red–green–blue–red–green–blue–red:
In [9]:
phaseplot(-5..5, -3..3, z -> z^2*sin(z))
Out[9]: