15 / 32 · Lab
Lab: connect a time constant to an AC corner
Use the same circuit for transient and small-signal AC analyses.
Lessons are free to read. Enroll to save your learning progress.
One circuit, two questions
Use the 10 kΩ, 100 nF low-pass to answer a time-domain question and a frequency-domain question. The nominal τ is 1 ms and fc is 159.154943 Hz. These are linked by fc = 1/(2πτ), so an incorrect resistor or capacitor value affects both analyses in a predictable way. This cross-check catches unit mistakes that one plot might miss.
Save rc-response.cir with the following deck. Run ngspice -b rc-response.cir using an available standalone executable. The .print AC phase is in radians in standard ngspice output; multiply by 180/π when comparing to the degree values in the course.
RC step and AC low-pass
V1 in 0 DC 0 AC 1 PULSE(0 3.3 1u 1n 1n 20m 40m)
R1 in out 10k
C1 out 0 100n
.tran 10u 8m 0 2u
.ac dec 40 1 100k
.print tran v(in) v(out)
.print ac vm(out) vp(out)
.save all
.endThe source contains DC, AC, and pulse specifications because those are separate analyses. AC 1 means a normalized small-signal excitation, not a physical 1 V transient added to the pulse. The operating point uses DC 0, so the capacitor begins discharged. The pulse rises after 1 μs; define elapsed charging time relative to that edge.
Acceptance values
Approximately 1 ms after the edge, expect 2.085998 V; after 5 ms, expect 3.277765 V. The finite 1 ns rise introduces negligible difference on the 1 ms scale. Interpolate sampled transient output near the requested times and compare within 2 mV. For AC, use a separate .ac lin 1 159.154943 159.154943 run when an exact corner checkpoint is required. Expect magnitude 0.707107 and phase −0.785398 rad, within 0.001 in each quantity.
Diagnose a discrepancy
Change C to 200 nF. τ doubles to 2 ms and fc halves to 79.577472 Hz. Predict this before rerunning. If only one analysis changes, inspect which deck actually ran and whether you compared the same node. Preserve the input, simulator version, and output for reproducibility. This standalone exercise does not establish any schematic editor's simulation integration. See the ngspice documentation for analysis syntax and source conventions.
Try it yourself
What changes if R becomes 5 kΩ while C stays 100 nF?
Read the explanation
τ becomes 0.5 ms, fc becomes 318.309886 Hz, and the ideal DC gain remains 1. The capacitor reaches 63.2121% of its final value after 0.5 ms.