Sub topic 1
What Makes a Circuit Linear
Prerequisites
This chapter assumes you already know the following:
- Ohm's law, V = I·R.
- Kirchhoff's current law (KCL) and voltage law (KVL).
- How to combine resistors in series and in parallel.
- How voltage and current dividers work.
- What an ideal voltage source and an ideal current source are.
You do not need to know superposition yet. This chapter builds the idea that makes it work. The later chapters use it.
Why start with linearity
Superposition is not a trick for circuits. It is a consequence of one property: linearity. If you know exactly what linearity means, you also know when superposition is allowed and when it is not. Most mistakes with superposition come from using it on a circuit that is not linear, or on a quantity that is not linear in the sources.
This chapter defines linearity, checks it for the common circuit elements, and shows why a circuit built only from linear parts has a linear response to its sources.
The two rules of a linear relationship
A relationship between an input x and an output y is linear if it obeys two rules.
- Homogeneity (scaling). If you multiply the input by a constant k, the output is multiplied by the same k. In symbols, if x produces y, then k·x produces k·y.
- Additivity. If input x₁ produces output y₁ and input x₂ produces output y₂, then the combined input x₁ + x₂ produces the combined output y₁ + y₂.
Both rules can be written as one statement. A relationship f is linear if
f(a·x₁ + b·x₂) = a·f(x₁) + b·f(x₂)
for any constants a and b and any inputs x₁ and x₂.
A straight line through the origin passes this test. The function y = 5x is linear. A straight line that does not pass through the origin, such as y = 5x + 3, fails it. Doubling x does not double y. In everyday speech people call that a "linear function", but in circuit analysis it is not linear, because it has an offset.
The function y = x² also fails. Doubling x multiplies y by four, not two. This failure is the reason power does not obey superposition, which a later chapter covers.
Linear circuit elements
A circuit element is linear when the relationship between its voltage and its current obeys both rules.
Resistor
For a resistor, v = R·i with R constant. Double the current and the voltage doubles. Add the voltage produced by one current to the voltage produced by another and you get the voltage produced by the summed current. A resistor with a fixed resistance is linear.
Capacitor and inductor
A capacitor obeys i = C·dv/dt. An inductor obeys v = L·di/dt. Differentiation is a linear operation: the derivative of a sum is the sum of the derivatives, and the derivative of k·v is k times the derivative of v. So capacitors and inductors with constant C and L are linear. This is why superposition also works for AC circuits and for transient analysis, as long as the circuit contains only these elements.
Independent sources
An independent source sets its own voltage or current. It is the input of the circuit, not part of the relationship between input and output. The circuit's output is a function of these inputs, and that function is what we test for linearity. Independent sources are allowed in a linear circuit. The next chapter looks at them in more detail.
Dependent (controlled) sources
A dependent source produces a voltage or current that is proportional to some other voltage or current in the circuit. For example, a source that delivers 3·ix, where ix is a current somewhere else, is linear, because the output is a constant times a circuit variable. A dependent source whose output follows ix² or a product of two circuit variables is not linear.
Elements that are not linear
- Diodes. The current is an exponential function of voltage, roughly i = Is(e^(v/(n·VT)) − 1). It is not proportional to v.
- Transistors in their full operating range.
- Resistors whose value changes with current or temperature, such as an incandescent lamp filament. The relationship v = R(i)·i is not linear when R depends on i.
- Iron-core inductors that saturate, so L is not constant.
You can sometimes treat a nonlinear element as linear over a small range. That is a separate technique, called linearization, and it gives only an approximation.
What a "linear circuit" means
A linear circuit is a circuit made only of linear elements: resistors, capacitors, inductors, linear dependent sources, and independent sources. In such a circuit, the response (any voltage or current you choose to measure) is a linear function of the independent sources.
| Element | Linear? | Reason |
|---|---|---|
| Resistor with fixed R | Yes | v = R·i is proportional |
| Capacitor, fixed C | Yes | i = C·dv/dt, derivative is linear |
| Inductor, fixed L | Yes | v = L·di/dt, derivative is linear |
| Independent source | Allowed | It is the input, not a response |
| Dependent source, gain constant | Yes | Output is a constant times one circuit variable |
| Diode | No | Exponential voltage–current relationship |
| Lamp filament | No | Resistance changes with current |
| Dependent source with a squared term | No | Output is not proportional to a circuit variable |
Why a linear circuit gives a linear response
Here is the argument. You do not need to memorize it, but following it explains why superposition is guaranteed and not just a convenient habit.
Write KCL at every node and KVL around every loop of a circuit that has only linear elements. Each element equation (v = R·i, i = C·dv/dt, and so on) is linear in the unknowns. KCL and KVL are sums of voltages or currents with coefficients of +1 or −1, so they are linear too. The result is a set of simultaneous linear equations. For a resistive circuit with n unknown node voltages, it has this form:
G·v = s
Here v is the vector of node voltages, G is the matrix of conductances, and s is a vector built from the independent sources. For a circuit that is solvable, G can be inverted, so
v = G⁻¹·s
The vector s contains the source values. Matrix multiplication is linear: if s = s₁ + s₂, then v = G⁻¹·s₁ + G⁻¹·s₂. The part G⁻¹·s₁ is the solution when only the sources in s₁ are active. The part G⁻¹·s₂ is the solution when only the sources in s₂ are active. This is superposition. Splitting s into one piece per source gives the full principle.
A numerical check of linearity
You can test the two rules on a circuit with a few lines of code. The circuit below has a 10 V source in series with R1 = 4 Ω, feeding a node A. R2 = 6 Ω connects A to ground. The output is the voltage at A.
import math
R1 = 4.0
R2 = 6.0
def v_out(vs):
"""Voltage at node A for a source voltage vs (voltage divider)."""
return vs * R2 / (R1 + R2)
# Homogeneity: scaling the input by k scales the output by k
k = 3.0
assert math.isclose(v_out(k * 10.0), k * v_out(10.0))
# Additivity: the output for a sum of inputs is the sum of the outputs
assert math.isclose(v_out(10.0 + 5.0), v_out(10.0) + v_out(5.0))
print(v_out(10.0), v_out(30.0), v_out(15.0))The program prints 6.0, 18.0 and 9.0 and both assertions pass. Now add a nonlinear element in place of R2, for example a component whose voltage follows v = 0.5·i², and the same tests fail. The test is simple, and it is a good habit when you are unsure about a component.
Edge cases and common errors
Offsets break linearity
A relationship such as v = 2·i + 1 looks like a line but fails homogeneity. If you model a real part as a resistor in series with a fixed voltage, treat that fixed voltage as an independent source. Then the resistor stays linear and the offset becomes an input. This is the standard way to handle a battery with internal resistance.
Output must be a voltage or current
The linear response is a voltage or a current. Power is the product of a voltage and a current, so it is quadratic in the sources. A circuit is linear, but its power is not a linear function of the sources. The chapter on power limits works this out in detail.
Initial conditions are inputs
A capacitor that starts with a stored voltage, or an inductor that starts with a stored current, contributes like an extra source. Linearity still holds if you count these initial conditions as inputs. If you leave them out when applying superposition to a transient problem, the answer will be wrong.
Constant parameters only
Linearity requires that R, L, C and dependent source gains do not change with the source values. If a resistor heats up and changes value as current rises, the circuit is nonlinear under that condition, even though the part is labeled "resistor". A circuit with a switch that changes state at a given time is a different case. It is linear in each interval, but each interval has to be treated as a separate circuit.
Linear does not mean "simple"
A circuit with many loops, capacitors and dependent sources can still be linear. Linearity tells you the structure of the answer. It does not tell you how easy the algebra will be.
How to decide if a circuit is linear
Use this short checklist before you start any superposition problem.
- List every element. Is each one a fixed resistor, capacitor, inductor, or a source?
- For each dependent source, check that its output is a constant times a single circuit variable, with no squares or products.
- Check that no resistance, inductance or capacitance depends on voltage, current or temperature in the range you care about.
- Identify the quantity you want. It must be a voltage or a current, not a power.
- Count initial energy in capacitors and inductors as additional inputs, if the problem is a transient one.
If every answer is clean, the circuit is linear for your purpose and superposition is safe.
Exercise
A circuit contains a 12 V source, a 3 kΩ resistor, a 2 mH inductor, and a dependent current source that delivers 0.5·vx, where vx is the voltage across the resistor. Is it a linear circuit? Then, a second circuit replaces the dependent source with one that delivers 0.5·vx². Is that circuit linear?
Show answer
The first circuit is linear. The resistor and the inductor have constant values, the 12 V source is an independent input, and the dependent source output is a constant (0.5) times one circuit variable (vx). The second circuit is not linear. The dependent source output is proportional to vx², so doubling vx quadruples the source output, and homogeneity fails. Superposition cannot be applied to it directly.
Exercise
The function v = 2·i + 1 describes a device, with v in volts and i in amperes. Show that it fails the homogeneity test, then say how to model the device so that it can be used in a linear circuit.
Show answer
For i = 1 A, v = 3 V. For i = 2 A, doubling the current, v = 5 V, not 6 V. Homogeneity fails because of the +1 V offset. Model the device as a 2 Ω resistor in series with a 1 V independent voltage source. The resistor is linear, and the offset is an input of the circuit, so the whole circuit is linear.
Exercise
In the Python example, the output is vout(vs) = vs·R2/(R1 + R2). Without running it, what is vout(20.0) when R1 = 4 Ω and R2 = 6 Ω, and what does that tell you about the relationship to v_out(10.0)?
Show answer
vout(20.0) = 20·6/10 = 12.0 V. This is twice vout(10.0) = 6.0 V. Doubling the input doubles the output, which is the homogeneity rule.