Sub topic 11
Ideal inverting integrator
This chapter assumes you know Ohm's law, KCL, the capacitor relation i = C dv/dt, and the virtual short from the earlier chapters. Here you derive the integrator output and use it to predict responses to step and square-wave inputs.
From inverting amplifier to integrator
Take the inverting amplifier and replace the feedback resistor Rf with a capacitor C. The input resistor R stays. The inverting input is a virtual ground, so the node sits at 0 V.
Derivation
Apply KCL at the inverting node. The ideal op amp draws no input current, so the resistor current must flow into the capacitor.
- Resistor current: i_R = (Vin − 0) / R = Vin / R.
- Capacitor current: i_C = C d(0 − Vout)/dt = −C dVout/dt. The capacitor has 0 V on one side and Vout on the other, and current flows from the node toward the output.
- Set iR = iC: Vin / R = −C dVout/dt.
- Rearrange: dVout/dt = −Vin / (RC).
- Integrate from 0 to t:
Vout(t) = −(1/RC) ∫ Vin dt + Vout(0)
The term Vout(0) is the capacitor's initial voltage. The product RC is the time constant. The output changes at a rate of −Vin/RC volts per second.
Step input
For a constant Vin, the integral is Vin·t, so the output is a straight ramp:
Vout(t) = −(Vin / RC) t + Vout(0)
With R = 10 kΩ and C = 100 nF, RC = 1 ms. A 1 V step gives a slope of −1000 V/s. After 5 ms the output is −5 V. The following code steps through that calculation numerically.
R = 10e3 # ohms
C = 100e-9 # farads, so RC = 1 ms
vin = 1.0 # constant 1 V input
dt = 1e-5 # 10 microsecond time step
v = 0.0 # initial capacitor voltage, Vout(0) = 0
for _ in range(500): # 500 steps = 5 ms
v -= vin / (R * C) * dt # Vout changes by -(1/RC) * Vin * dt
print(round(v, 3)) # -5.0Square-wave input
A square wave alternates between +V and −V. During the positive half the output ramps down, and during the negative half it ramps up. The result is a triangle wave.
For a square wave of amplitude ±1 V and period T = 2 ms with RC = 1 ms, each half period lasts 1 ms. The output moves by 1 V/(1 ms) × 1 ms = 1 V in each half period. The triangle therefore has a peak-to-peak swing of 1 V, and its average level depends on Vout(0) and on the DC content of the input.
| Input | Output |
|---|---|
| Constant (step) | Linear ramp, slope −Vin/RC |
| Zero | Constant at Vout(0) |
| Square wave | Triangle wave, inverted |
| Sine wave | Cosine wave, scaled by 1/(ωRC) |
Common errors
- Forgetting the minus sign. The inverting configuration always flips polarity.
- Ignoring Vout(0). The integral alone does not fix the output. You also need the starting capacitor charge.
- Applying the formula past saturation. The equation assumes the op amp output stays within its supply limits. Later chapters cover what happens when it does not.
Check it in a simulation
A transient simulation confirms the ramp. This netlist applies a 1 V step through R and gives the ideal model a high gain. The ic=0 setting and uic option start the capacitor at 0 V.
* Ideal inverting integrator, 1 V step input
V1 in 0 DC 0 PULSE(0 1 0 1n 1n 1 2)
R1 in inv 10k
C1 inv out 100n ic=0
E1 out 0 0 inv 100k
.tran 10u 5m uic
.endAt 5 ms, V(out) should be close to −5 V. It will differ slightly because the model's gain is finite.
Exercise
An integrator has R = 20 kΩ and C = 50 nF. A constant 2 V input is applied starting at t = 0, and Vout(0) = 0. What is Vout after 4 ms?
Show answer
RC = 20e3 × 50e-9 = 1 ms. Vout = −(2 V / 1 ms) × 4 ms = −8 V. This assumes the op amp supply allows an output of −8 V.
Exercise
The same integrator receives a ±1 V square wave with a period of 2 ms and RC = 1 ms. What is the peak-to-peak amplitude of the output triangle?
Show answer
Each half period is 1 ms. The output changes by (1 V / 1 ms) × 1 ms = 1 V in each half, so the triangle is 1 V peak to peak.