ENع
→Integrals
الدرس 27 · Maths for circuits and signals

Integrals as areas

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

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

When a capacitor charges, the current into it falls over time. How much charge did it collect? Multiply current by time, but the current keeps changing, so slice time into thin strips and add up rectangles. Watch a Riemann sum close in on the exact area, the definite integral, and see why the slope of the running area is the curve itself.

ستتعلّم

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

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

Current is a rate

Close the switch at t = 0. Current i flows from the 5 V source through R into the capacitor C. Current is a rate: 1 mA carries 1 µC of charge every millisecond. How much charge has C collected after 3 ms?

>>> 5 / 1000            # i = V / R at t = 0, in amps
0.005
>>> 1e-3 * 1e-3         # 1 mA for 1 ms, in coulombs
1e-06
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. Current is a rate

    Close the switch at t = 0. Current i flows from the 5 V source through R into the capacitor C. Current is a rate: 1 mA carries 1 µC of charge every millisecond. How much charge has C collected after 3 ms?

    >>> 5 / 1000            # i = V / R at t = 0, in amps
    0.005
    >>> 1e-3 * 1e-3         # 1 mA for 1 ms, in coulombs
    1e-06
  2. The current falls

    At first C is empty, so all 5 V sits across R and i = 5 V / 1 kΩ = 5 mA. As C charges, i falls: i(t) = 5e^(−t/τ) mA, where τ = RC = 1 ms is the time constant.

    >>> from math import exp
    >>> [round(5*exp(-t), 2) for t in (0, 1, 2, 3)]   # mA
    [5.0, 1.84, 0.68, 0.25]
    >>> 1e3 * 1e-6            # tau = R*C, in seconds
    0.001
  3. One slice is a rectangle

    Over a short time the current barely changes, so charge = current × time: the area of a thin rectangle under the plot. Slice 1 is 0.5 ms wide and 5 mA tall: 5 mA × 0.5 ms = 2.5 µC.

    >>> 5 * 0.5               # mA × ms = µC
    2.5
    >>> 5e-3 * 0.5e-3          # the same in A × s = C
    2.5e-06
  4. Add up the slices

    Cut 0 to 3 ms into six slices. Make each one as tall as the current at its left edge, and add the areas. This is a Riemann sum. The six slices hold 6.04 µC.

    >>> from math import exp
    >>> def area(n, T=3.0):
    ...     dt, q = T / n, 0.0
    ...     for k in range(n):
    ...         q += 5*exp(-k*dt) * dt
    ...     return q
    ...
    >>> round(area(6), 2)        # µC
    6.04
  5. The corners overshoot

    Check it: 6.04 µC on a 1 µF capacitor would mean 6.04 V, more than the 5 V source can give. The current falls inside every slice, so each rectangle pokes above the curve. Those red corners are the error.

    >>> 6.04e-6 / 1e-6          # q / C, in volts
    6.04
    >>> 6.04 > 5
    True
  6. Thinner slices

    Use more, thinner slices and the corners shrink. Thirty slices of 0.1 ms give 4.99 µC. Three hundred slices of 0.01 ms give 4.77 µC, and 3000 give 4.75 µC. The sums settle on one number.

    >>> from math import exp
    >>> def area(n, T=3.0):
    ...     dt, q = T / n, 0.0
    ...     for k in range(n):
    ...         q += 5*exp(-k*dt) * dt
    ...     return q
    ...
    >>> [round(area(n), 2) for n in (6, 30, 300, 3000)]
    [6.04, 4.99, 4.77, 4.75]
  7. The limit is the integral

    The number the sums approach as the slices get infinitely thin is the definite integral: q = ∫₀³ i(t) dt = 4.75 µC, the exact area under the curve. The ∫ sign is a stretched S for sum; dt is the shrinking slice width.

    >>> from math import exp
    >>> round(5 * (1 - exp(-3)), 4)   # exact area, µC
    4.7511
    >>> round(5 * (1 - exp(-3)), 2)
    4.75
  8. Area so far is charge

    Now let the right edge move. The area from 0 up to any time t is the charge collected so far, q(t). Plotted, it is a second curve that climbs fast at first, then flattens as the current dies away.

    >>> from math import exp
    >>> [round(5*(1 - exp(-t)), 2) for t in (0, 1, 2, 3)]   # µC
    [0.0, 3.16, 4.32, 4.75]
  9. Slope of area is height

    The fundamental theorem of calculus: area grows at the rate of the curve, so dq/dt = i. We need a q whose slope is 5e^(−t): q(t) = 5(1 − e^(−t)) µC, t in ms. At 3 ms, q = 4.75 µC.

    >>> from math import exp
    >>> q = lambda t: 5 * (1 - exp(-t))
    >>> h = 1e-6
    >>> round((q(1 + h) - q(1)) / h, 4)   # slope of q at 1 ms
    1.8394
    >>> round(5 * exp(-1), 4)               # i at 1 ms
    1.8394
  10. Charge sets the voltage

    A capacitor's voltage is its charge over its capacitance: vC = q / C = 4.75 µC ÷ 1 µF = 4.75 V. After three time constants C holds 95% of the 5 V. This is the RC charging curve.

    >>> from math import exp
    >>> q, C = 5e-6 * (1 - exp(-3)), 1e-6
    >>> round(q / C, 2)          # volts
    4.75
    >>> round(1 - exp(-3), 3)     # fraction of 5 V
    0.95

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