Notes / Linear Control

Complex numbers

Updated

In modes, the spring’s natural rates turned out to be complex. We don’t typically think of being able to visualize complex numbers, but the spring is certainly very real. So, where does the imaginary value come from? A real exponential can only describe growth or decay growth or decay, but the spring also oscillates. We want to describe both together.

Imagine a turning arrow. Its tip’s horizontal position moves back and forth like the spring. The arrow’s length sets the size of the swing, and its angle tells us where we are in the cycle. If we shorten the arrow as it turns, we represent a decaying oscillation.

A turning arrowIts horizontal position moves back and forthHorizontal position over time10−10 s12 s

The horizontal position alone cannot tell us which way the tip is moving; we need the second coordinate too. Complex numbers keep both coordinates together and let multiplication rotate or scale the arrow. Let us see how that works. Call the tip’s horizontal coordinate uu and vertical coordinate vv.

The imaginary unit

A complex number packages the pair into one symbol:

z=u+jv,j2=−1.z=u+jv, \qquad j^2=-1.

The symbol jj is chosen to behave like a quarter-turn. Formally, it is the square root of −1-1; practically, it lets us combine a two-dimensional value into a single number. Two quarter-turns reverse an arrow, and multiplication by −1-1 also reverses an arrow; the rule j2=−1j^2=-1 makes those statements identical. Indeed, multiplying zz by jj gives

jz=j(u+jv)=−v+ju.jz=j(u+jv)=-v+ju.

The point (u,v)(u,v) has become (−v,u)(-v,u), exactly a 90∘90^\circ counterclockwise rotation.

Drag zz around below and jzjz follows, always a quarter-turn ahead and always the same length. Press multiply by jj twice and zz points the opposite way - that is j2=−1j^2=-1. Press it four times and it is back where it started.

The coordinate uu is called the real part and vv is called the imaginary part. Electrical and control engineers use jj rather than ii because ii often denotes electric current. Nothing physical is imaginary here: zz is compact notation for the real pair (u,v)(u,v), together with an algebraic system to rotate it.

The length of the corresponding arrow is

∣z∣=u2+v2.|z|=\sqrt{u^2+v^2}.

Multiplying zz by a positive real number stretches this arrow without changing its direction. Thus the same notation naturally handles the two operations visible in an oscillator’s motion: rotation changes angle, while real scaling changes distance from the origin.

The unit circle

Multiplication by jj gives one instantaneous quarter-turn. An oscillator, however, passes continuously through every angle between those quarter-turns. Let’s build up towards fully describing this motion.

Start at the point 11 on the positive real axis and rotate counterclockwise through an angle θ\theta. Because the point remains on the unit circle, its horizontal coordinate is cos⁡θ\cos\theta and its vertical coordinate is sin⁡θ\sin\theta. The corresponding complex number is therefore

q(θ)=cos⁡θ+jsin⁡θ.q(\theta)=\cos\theta+j\sin\theta.

The symbol qq is only a temporary name for the rotating point. At this stage, this is simply a geometric statement that packages two coordinates on the two-dimensional circle into one symbol as a function of angle θ\theta.

Drag the point around the circle below. Its shadow on the real axis is cos⁡θ\cos\theta and its shadow on the imaginary axis is sin⁡θ\sin\theta.

Euler’s formula

Now I ask the reader to partake in a brief leap of faith. For a real number xx, one exact definition of the exponential is the infinite power series

ex=1+x+x22!+x33!+x44!+⋯ .e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots.

The exclamation mark denotes a factorial: for example, 4!=4⋅3⋅2⋅14!=4\cdot3\cdot2\cdot1. The dots mean that the pattern continues with successively higher powers. Taking more terms gives increasingly accurate partial sums; in the limit, the series defines the exact value of exe^x.

Every operation on the right-hand side - addition, multiplication, and division by a real number - also makes sense for complex numbers. We therefore define the complex exponential using the same recipe:

ez=1+z+z22!+z33!+z44!+⋯ ,z∈C.e^z=1+z+\frac{z^2}{2!}+\frac{z^3}{3!}+\frac{z^4}{4!}+\cdots, \qquad z\in\mathbb{C}.

This is a definition, not yet a claim about circles or sinusoids.

Now choose the particular complex input z=jθz=j\theta. The powers of jj repeat every four steps:

j0=1,j1=j,j2=−1,j3=−j,j4=1,…j^0=1,\qquad j^1=j,\qquad j^2=-1,\qquad j^3=-j,\qquad j^4=1,\ldots

Consequently, the even powers of jθj\theta contribute real terms, while the odd powers contribute imaginary terms. This brings us to the result that connects the exponential to the rotating point.

Euler’s formula. For every real angle θ\theta,

ejθ=cos⁡θ+jsin⁡θ.e^{j\theta}=\cos\theta+j\sin\theta.

Proof. Substitute z=jθz=j\theta into the definition:

ejθ=1+jθ+(jθ)22!+(jθ)33!+(jθ)44!+⋯=1+jθ−θ22!−jθ33!+θ44!+⋯ .\begin{aligned} e^{j\theta} &=1+j\theta+\frac{(j\theta)^2}{2!}+\frac{(j\theta)^3}{3!}+\frac{(j\theta)^4}{4!}+\cdots\\ &=1+j\theta-\frac{\theta^2}{2!}-j\frac{\theta^3}{3!}+\frac{\theta^4}{4!}+\cdots. \end{aligned}

Collecting the real terms and the imaginary terms separately gives

ejθ=(1−θ22!+θ44!−⋯ )+j(θ−θ33!+θ55!−⋯ ).e^{j\theta}=\left(1-\frac{\theta^2}{2!}+\frac{\theta^4}{4!}-\cdots\right)+j\left(\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\cdots\right).

The two expressions in parentheses are precisely the power series for cosine and sine:

cos⁡θ=1−θ22!+θ44!−⋯ ,sin⁡θ=θ−θ33!+θ55!−⋯ .\begin{aligned} \cos\theta&=1-\frac{\theta^2}{2!}+\frac{\theta^4}{4!}-\cdots,\\ \sin\theta&=\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\cdots. \end{aligned}

Therefore ejθ=cos⁡θ+jsin⁡θe^{j\theta}=\cos\theta+j\sin\theta. ■\blacksquare

The coefficients in the sine and cosine series can be found from their successive derivatives at θ=0\theta=0: those derivatives cycle through the same four patterns as the powers of jj. Euler’s formula is therefore what the ordinary exponential becomes when its input points in the imaginary direction.

We show a visual for the proof by drawing each term of the Taylor series as an arrow. Each term is the previous one multiplied by jθ/nj\theta/n, so each arrow is turned a quarter-turn from the last and, once n>θn>\theta, shorter. The chain curls around and settles onto ejθe^{j\theta} on the unit circle. Things to try:

  • Start with one term: the sum is just 11. Add terms one at a time and watch the real terms (dark) and the imaginary terms (orange) alternate - exactly the split into the cosine and sine series in the proof.
  • Raise θ\theta towards π\pi. The early terms now grow before they shrink, so the chain swings far off the circle and needs more terms before it settles.

Comparing Euler’s formula with the geometric definition of q(θ)q(\theta) now gives

q(θ)=ejθ.q(\theta)=e^{j\theta}.

The exponential notation is compact because its exponent stores the angle. At the four quarter-turns,

ej0=1,ejπ/2=j,ejπ=−1,ej3π/2=−j.e^{j0}=1, \qquad e^{j\pi/2}=j, \qquad e^{j\pi}=-1, \qquad e^{j3\pi/2}=-j.

Uniform circular motion

We can now turn the angle-indexed point q(θ)q(\theta) into a motion through time. Let the angle increase at one radian per second, so that θ=t\theta=t, and write

z(t)=ejt=cos⁡t+jsin⁡t.z(t)=e^{jt}=\cos t+j\sin t.

A dot above a symbol will denote its derivative with respect to time. Differentiating gives

z˙(t)=−sin⁡t+jcos⁡t=j(cos⁡t+jsin⁡t)=jz(t).\dot z(t)=-\sin t+j\cos t=j\bigl(\cos t+j\sin t\bigr)=jz(t).

The exponential and the dynamic equation are thus two descriptions of the same motion.

To see the two real coordinates inside z˙=jz\dot z=jz, write z=u+jvz=u+jv. Here u=cos⁡tu=\cos t and v=sin⁡tv=\sin t, so

u˙=−v,v˙=u.\dot u=-v, \qquad \dot v=u.

At the point (u,v)(u,v), the velocity (−v,u)(-v,u) is a 90∘90^\circ counterclockwise rotation of the radius (u,v)(u,v). The velocity is therefore tangent to the circle rather than pointing toward or away from the origin.

The geometry already suggests that the radius remains fixed, which we can prove. The squared distance from the origin satisfies

ddt(u2+v2)=2uu˙+2vv˙=2u(−v)+2v(u)=0.\frac{\mathrm{d}}{\mathrm{d}t}\left(u^2+v^2\right)=2u\dot u+2v\dot v=2u(-v)+2v(u)=0.

Its derivative is zero, so the distance is constant. If the point begins at z(0)=1z(0)=1, it remains on the unit circle and turns counterclockwise at one radian per second.

Euler’s formula treats its argument as an angle. For a motion with angular frequency ω\omega and initial phase ϕ\phi, that angle is θ(t)=ωt+ϕ\theta(t)=\omega t+\phi. Substituting this angle into Euler’s formula and choosing a radius A0A_0 gives

z(t)=A0ej(ωt+ϕ)=A0cos⁡(ωt+ϕ)+jA0sin⁡(ωt+ϕ).z(t)=A_0e^{j(\omega t+\phi)}=A_0\cos(\omega t+\phi)+jA_0\sin(\omega t+\phi).

The real part is the sinusoid we observe on a time plot; the imaginary part is its quarter-cycle-shifted companion. The radius is A0A_0, the starting angle is ϕ\phi, and the angle advances at ω\omega radians per second.

Differentiating shows where the angular frequency enters the dynamics:

z˙(t)=jωA0ej(ωt+ϕ)=jωz(t).\dot z(t)=j\omega A_0e^{j(\omega t+\phi)}=j\omega z(t).

Compared with z˙=jz\dot z=jz, the factor ω\omega simply changes the turning rate. For ω>0\omega>0, one complete turn takes

T=2πω.T=\frac{2\pi}{\omega}.

Complex frequency

So far, the radius remains fixed at A0A_0. To let the envelope change, multiply by a real exponential:

z(t)=A0eσt⏟changing radiusej(ωt+ϕ)⏟changing angle.z(t)=\underbrace{A_0e^{\sigma t}}_{\text{changing radius}}\underbrace{e^{j(\omega t+\phi)}}_{\text{changing angle}}.

If σ<0\sigma<0, the radius shrinks; if σ=0\sigma=0, it remains constant; and if σ>0\sigma>0, it grows. Taking the real part gives the waveform we actually observe:

Re⁡{z(t)}=A0eσtcos⁡(ωt+ϕ).\operatorname{Re}\{z(t)\}=A_0e^{\sigma t}\cos(\omega t+\phi).

Because multiplying exponentials adds their exponents, the same motion can be written more compactly. Define

z(0)=A0ejϕ,s=σ+jω.z(0)=A_0e^{j\phi}, \qquad s=\sigma+j\omega.

Then

z(t)=z(0)est.z(t)=z(0)e^{st}.

The complex rate ss packages two real rates: σ\sigma changes the radius, while ω\omega changes the angle. The initial state determines A0A_0 and ϕ\phi - how strongly the mode is excited and where it begins in its cycle. A command or disturbance can change that state; while an input continues to act, we must also account for the forced response. The mode itself determines σ\sigma and ω\omega - how its envelope changes and how quickly it cycles.

Finally, expand the compact dynamic equation z˙=sz\dot z=sz back into real and imaginary components:

u˙=σu−ωv,v˙=ωu+σv.\begin{aligned} \dot u&=\sigma u-\omega v,\\ \dot v&=\omega u+\sigma v. \end{aligned}

This form is exactly what a control designer wants to know about a natural motion. If σ<0\sigma<0, the mode returns to the origin and is asymptotically stable. If σ>0\sigma>0, it moves away from the origin and is unstable. If σ=0\sigma=0, an ideal oscillation persists forever. The imaginary part ω\omega tells us how rapidly it oscillates. Although z(t)z(t) is complex, the observed waveform remains real: it is the horizontal component Re⁡{z(t)}\operatorname{Re}\{z(t)\}.

In the figure below, the dark arrow is the radius z(t)z(t) and the orange arrow is the velocity z˙=sz\dot z=sz. Things to try:

  • Set σ=0\sigma=0. The velocity stays exactly perpendicular to the radius, so the point stays on the unit circle and the real part is a pure cosine.
  • Drag σ\sigma negative. The velocity now leans inward, the point spirals towards the origin, and the real part decays inside its dashed envelope eσte^{\sigma t}. Push σ\sigma above zero and the velocity leans outward instead.
  • Change ω\omega with σ\sigma fixed. The envelope does not move at all - only the number of turns inside it changes. Set ω=0\omega=0 and the point slides along the real axis without turning: a pure exponential.