ENع
→Complex numbers
الدرس 25 · Maths for circuits and signals

Complex numbers as turning arrows

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

15 دقيقة10 خطوات5 أسئلةIntermediate
عن هذا الدرس

A complex number is an arrow on a plane: a real part across and an imaginary part up. Multiplying by j turns it a quarter, multiplying multiplies lengths and adds angles, and a spinning arrow draws a sine wave. Follow one AC circuit, a 3 Ω resistor and a coil with 4 Ω reactance, as its impedance becomes the arrow Z = 3 + 4j and Ohm's law turns it into the current I = 0.6 − 0.8j A.

ستتعلّم

حدّد ما تشعر بأنك أتقنته. هذا التقييم الذاتي لا يؤثر في درجة الدرس.

شكل 25 · تفاعلي
01 / 10

Numbers with two parts

A complex number like 3 + 4j has two parts: a real part, 3, and an imaginary part, 4. Draw it on a plane: 3 steps right along the real axis, 4 steps up. The arrow from 0 to that point is the number.

>>> z = 3 + 4j
>>> z.real, z.imag
(3.0, 4.0)
>>> type(z)
<class 'complex'>
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. Numbers with two parts

    A complex number like 3 + 4j has two parts: a real part, 3, and an imaginary part, 4. Draw it on a plane: 3 steps right along the real axis, 4 steps up. The arrow from 0 to that point is the number.

    >>> z = 3 + 4j
    >>> z.real, z.imag
    (3.0, 4.0)
    >>> type(z)
    <class 'complex'>
  2. Times j: a quarter turn

    Multiplying by j turns an arrow 90° anticlockwise and keeps its length: (3 + 4j)·j = −4 + 3j. Two quarter turns point it backwards, so j·j = −1. That is what j² = −1 means. Four quarter turns bring it home.

    >>> z = 3 + 4j
    >>> z * 1j
    (-4+3j)
    >>> z * 1j * 1j
    (-3-4j)
    >>> 1j * 1j
    (-1+0j)
  3. Adding: tip to tail

    A 3 Ω resistor pushes back in step with the current: 3, on the real axis. At 50 Hz, a 12.7 mH coil adds about 4 Ω a quarter turn later: 4j. Add them tip to tail: the impedance Z = 3 + 4j Ω.

    >>> import math
    >>> round(2 * math.pi * 50 * 0.0127, 2)   # coil: 2πfL
    3.99
    >>> Z = 3 + 4 * 1j
    >>> Z
    (3+4j)
  4. Length: Pythagoras

    The two parts and the arrow form a right triangle. Its length, the magnitude |Z|, comes from Pythagoras: √(3² + 4²) = √25 = 5. So at 50 Hz this pair limits the current like a single 5 Ω resistor.

    >>> abs(3 + 4j)
    5.0
    >>> (3**2 + 4**2) ** 0.5
    5.0
  5. Angle: arctangent

    The angle from the real axis is θ = atan2(4, 3) = 53.13°. Length and angle together are the polar form: Z = 5∠53.13°. Going back is trig: 5·cos 53.13° = 3 and 5·sin 53.13° = 4.

    >>> import cmath, math
    >>> cmath.phase(3 + 4j)          # radians
    0.9272952180016122
    >>> math.degrees(cmath.phase(3 + 4j))
    53.13010235415598
    >>> cmath.polar(3 + 4j)
    (5.0, 0.9272952180016122)
  6. Euler's formula

    Euler's formula, e^jθ = cos θ + j sin θ, is an arrow of length 1 at angle θ. Turn it to 53.13°, which is 0.927 radians, and stretch it 5 times: Z = 5e^j0.927. One expression holds the length and the angle.

    >>> import cmath
    >>> cmath.exp(1j * 0.9272952180016122)
    (0.6+0.7999999999999999j)
    >>> cmath.rect(5, 0.9272952180016122)   # 3 + 4j, rounded
    (3+3.9999999999999996j)
  7. Divide: shrink, turn back

    The source gives V = 5∠0° V. Ohm's law, I = V / Z, divides arrows: divide the lengths, 5 ÷ 5 = 1, and subtract the angles, 0° − 53.13°. So the current is I = 1∠−53.13° A.

    >>> import cmath, math
    >>> I = 5 / (3 + 4j)
    >>> abs(I), math.degrees(cmath.phase(I))
    (1.0, -53.13010235415599)
  8. Back to a + bj

    In parts, I = cos(−53.13°) + j sin(−53.13°) = 0.6 − 0.8j A. Check by multiplying: (0.6 − 0.8j)(3 + 4j) = 5. Multiplying undoes dividing: the lengths multiply, 1 × 5, and the angles add, −53.13° + 53.13° = 0°.

    >>> I = 5 / (3 + 4j)
    >>> I
    (0.6-0.8j)
    >>> I * (3 + 4j)        # 5, up to rounding
    (5-4.440892098500626e-16j)
  9. Spinning arrows make waves

    Spin both arrows 50 times a second. The voltage arrow's shadow on the real axis traces v = 5 cos ωt, ω = 2π·50. The current arrow trails by 53.13°, so its wave peaks 2.95 ms later. The fixed arrows V and I are phasors.

    >>> import math
    >>> 2 * math.pi * 50            # ω in rad/s
    314.1592653589793
    >>> 53.13010235415598 / 360 * 20   # lag in ms
    2.9516723530086657
  10. Python speaks j

    Python writes imaginary numbers with j, as engineers do, since i usually means current. In cmath, abs(Z) gives 5.0, cmath.phase(Z) gives the angle in radians, 0.927, and 5 / Z gives (0.6-0.8j).

    >>> import cmath
    >>> Z = 3 + 4j
    >>> abs(Z)
    5.0
    >>> cmath.phase(Z)
    0.9272952180016122
    >>> I = 5 / Z
    >>> I
    (0.6-0.8j)

اختبار يتاح بعد الخطوة الأخيرة.