Complex numbers

The imaginary unit is i, an ordinary constant. Juxtaposition is already multiplication, so 4i is 4*i and needs no special number syntax — the same reading that makes 2e mean 2*e.

z=3+4⁢i=3 + 4i
w=1−2⁢i=1 - 2i

Arithmetic. Any operation with a complex operand on either side answers complex, promoting the real one.

sum=z+w=3 + 4i+1 - 2i=4 + 2i
difference=z−w=3 + 4i−(1 - 2i)=2 + 6i
product=z·w=(3 + 4i)·(1 - 2i)=11 - 2i
quotient=zw=3 + 4i1 - 2i=-1 + 2i
scaled=2·z=2·(3 + 4i)=6 + 8i
negated=0−z=0−(3 + 4i)=-3 - 4i

i squared is where the whole thing comes from.

i2=-1 + 0i

Taking a value apart. Re and Im give real numbers; Im is the coefficient of i, so Re(z) + Im(z)*i rebuilds z.

Re⁡(z)=Re⁡(3 + 4i)=3
Im⁡(z)=Im⁡(3 + 4i)=4
conj⁡(z)=conj⁡(3 + 4i)=3 - 4i
|z|=|3 + 4i|=5
arg⁡(z)=arg⁡(3 + 4i)=0.927295

Whole powers only, by repeated multiplication. A fractional power of a complex number needs a branch cut, which this language does not choose.

z2=(3 + 4i)2=-7 + 24i
z3=(3 + 4i)3=-117 + 44i
z0=(3 + 4i)0=1 + 0i
z(0−1)=(3 + 4i)(0−1)=0.12 - 0.16i

A complex value stays complex. Nothing demotes when the imaginary part happens to be zero, so a result's type never depends on its value.

realagain=z−4⁢i=3 + 4i−4⁢i=3 + 0i

Units. Both parts share one dimension, because they are components of one measurement rather than two measurements.

Z=(3+4⁢i)⁢Ω=(3 + 4i) Ω
Z=(0.003 + 0.004i) kΩ
|Z|=|(3 + 4i) Ω|=5⁢Ω
Re⁡(Z)=Re⁡((3 + 4i) Ω)=3⁢Ω

The argument is an angle, so it is dimensionless whatever Z is measured in.

arg⁡(Z)=arg⁡((3 + 4i) Ω)=0.927295

The impedance of a series RLC branch at one frequency, which is what the corpus uses complex arithmetic for.

R=32.3383⁢Ω
L=4.58533×10−5⁢H
C=4.56546×10−8⁢F
f=110000⁢Hz
Zrlc=R+2·π·f·L·i+12·π·f·C·i=32.3383⁢Ω+2·π·110000⁢Hz·4.58533×10−5⁢H·i+12·π·110000⁢Hz·4.56546×10−8⁢F·i=(32.3383 + 1.79395e-5i) Ω
|Zrlc|=|(32.3383 + 1.79395e-5i) Ω|=32.3383⁢Ω
arg⁡(Zrlc)·180π=arg⁡((32.3383 + 1.79395e-5i) Ω)·180π=3.17844×10−5

A branch of impedances, as one value

A network is a collection of impedances, and until now each one had to be its own name. A vector holds them, sums to the series impedance, and comes apart elementwise into magnitudes and angles — which is what a table of the branch would show.

The same branch, split into the three impedances it is made of, using the resistance, inductance and capacitance already defined above.

ZR=R+0⁢i·Ω=32.3383⁢Ω+0⁢i·Ω=(32.3383 + 0i) Ω
ZL=0⁢Ω+2·π·f·L·i=0⁢Ω+2·π·110000⁢Hz·4.58533×10−5⁢H·i=(0 + 31.6915i) Ω
ZC=0⁢Ω+12·π·f·C·i=0⁢Ω+12·π·110000⁢Hz·4.56546×10−8⁢F·i=(0 - 31.6915i) Ω
branch=[ZRZLZC]=[(32.3383 + 0i) Ω, (0 + 31.6915i) Ω, (0 - 31.6915i) Ω]
Zseries=sum⁡(branch)=sum⁡([(32.3383 + 0i) Ω, (0 + 31.6915i) Ω, (0 - 31.6915i) Ω])=(32.3383 + 1.79395e-5i) Ω
magnitudes=|branch|=|[(32.3383 + 0i) Ω, (0 + 31.6915i) Ω, (0 - 31.6915i) Ω]|=[32.3383 ohm, 31.6915 ohm, 31.6915 ohm]
angles=arg⁡(branch)=arg⁡([(32.3383 + 0i) Ω, (0 + 31.6915i) Ω, (0 - 31.6915i) Ω])=[0°, 90°, -90°]

Scaling the whole branch is one multiplication — two of everything in parallel halves each impedance.

halved=branch2=[(32.3383 + 0i) Ω, (0 + 31.6915i) Ω, (0 - 31.6915i) Ω]2=[(16.1691 + 0i) Ω, (0 + 15.8458i) Ω, (0 - 15.8458i) Ω]

What a complex vector does not do, it says. Ordering complex numbers has no meaning, so sort and min refuse one rather than answering emptily, and a matrix of complex numbers is not built at all.