The netlist
SPICE is a program that solves circuits. You describe the circuit as a netlist: plain text, one line per part. Each line gives the part's name, the two nodes it joins and its value. The first line is only a title.
A node is a point where parts join. SPICE needs every node named, and the ground node must be called 0. Here node 1 is the source's top, node 2 joins R1, R2 and C1, and node 0 is ground.
The line R1 1 2 1k says: a resistor called R1 joins node 1 to node 2 and has 1 kΩ. Letters scale numbers: k is 10³, u is 10⁻⁶, m is 10⁻³. Careful: in SPICE m means milli; mega is meg.
V1 1 0 DC 10 puts a 10 V source with + on node 1 and − on node 0. SPICE counts source current flowing into the + node, through the source, out at −. A source that delivers power shows a negative current.
DC operating point
SPICE writes Kirchhoff's current law at every node, using modified nodal analysis. Each resistor adds its conductance, G = 1/R = 1 mS, into fixed cells. The source adds a row saying v(1) = 10 V. Watch the cells fill.
At DC a capacitor carries no current, so .op treats C1 as open. Solving the matrix gives v(1) = 10 V, v(2) = 5 V and I(V1) = −5 mA. The minus sign means V1 delivers 50 mW; R1 and R2 take 25 mW each.
Transient analysis
.tran 0.1m 3m UIC asks for the voltages from 0 to 3 ms. UIC means start from the IC values in the netlist, so C1 starts empty at 0 V, not at the .op answer. Now the capacitor's current matters.
SPICE cannot solve a derivative directly. Over one time step h it uses i = C·(v_now − v_before)/h. That is a conductance GC = C/h = 10 mS in parallel with a current source GC·v_before: parts a DC solver already handles.
First step, h = 0.1 ms. C1 was at 0 V, so Ieq = 0 mA. Node 2 sees 1 + 1 + 10 = 12 mS. KCL gives v(2) = 10 mA ÷ 12 mS = 0.833 V, the first plot dot.
Repeat: each answer becomes the next step's v_before. v(2) climbs 0.833, 1.53, 2.11 V and levels off at 5 V, the .op answer. Hand check: τ = (R1 || R2)·C1 = 0.5 ms, so v(2) = 5(1 − e^(−t/τ)).
At t = τ the exact answer is 3.16 V. Steps of 0.1 ms give 2.99 V; steps of 10 µs give 3.14 V, almost on the exact curve. Real SPICE uses a better rule (trapezoidal) and picks h from an error estimate.
What is happening
# step 1/11 · netlist # about: V1 (10 V), R1, R2, C1, Netlist line 1, Netlist line 2, Netlist line 3, Netlist line 4, Netlist line 5 the netlist (input deck) 1 RC divider charging 2 V1 1 0 DC 10 3 R1 1 2 1k 4 R2 2 0 1k 5 C1 2 0 1u IC=0 6 .op 7 .tran 0.1m 3m UIC 8 .end line 1 is always the title: SPICE skips it. Lines starting with . are commands. SPICE: Simulation Program with Integrated Circuit Emphasis, UC Berkeley, 1973.
The figure is an ideal circuit: a 10 V source, two 1 kΩ resistors and a 1 µF capacitor. Every voltage, current, matrix entry and plot point is computed by the lesson's own small solver, the same modified nodal analysis SPICE uses, not by running a real SPICE. The figure steps time with backward Euler and a fixed 0.1 ms step because it is the easiest companion model to see. ngspice uses the trapezoidal rule by default (or Gear), and adjusts the step from a truncation-error estimate, so its waveform lies much closer to the exact curve.