Main content

## Electrical engineering

### Course: Electrical engineering > Unit 2

Lesson 3: DC circuit analysis- Circuit analysis overview
- Kirchhoff's current law
- Kirchhoff's voltage law
- Kirchhoff's laws
- Labeling voltages
- Application of the fundamental laws (setup)
- Application of the fundamental laws (solve)
- Application of the fundamental laws
- Node voltage method (steps 1 to 4)
- Node voltage method (step 5)
- Node voltage method
- Mesh current method (steps 1 to 3)
- Mesh current method (step 4)
- Mesh current method
- Loop current method
- Number of required equations
- Linearity
- Superposition

© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Linearity

When you double the voltage on a resistor, the current doubles. We say a resistor is a linear device. Capacitors and inductors are linear, too. Written by Willy McAllister.

## Introduction

Linearity is a mathematical concept that has a profound impact on electronic design. The idea itself is quite simple, but the implications have great meaning for our field. First we will talk about the mathematical meaning of

*linear*. Then we will apply the idea to electronic circuits.### What we're building to

A function is linear in the mathematical sense if it has these properties:

Homogeneity (scaling): f, left parenthesis, a, x, right parenthesis, equals, a, f, left parenthesis, x, right parenthesis

Additivity: f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis

When the inputs and outputs are single numbers, a function that has the scaling property automatically has additivity as well. Resistors, capacitors, and inductors are

*linear*because they have the scaling property.## Linear

The term

*linearity*refers to the property of*scaling*. Suppose you have two related physical properties, for example the speed you can run and the distance you can run. If you double your speed, you double the distance. If you triple your speed, you triple your distance. This is called a*linear*relationship. Usually the cost of something is linear. If a notebook costs $1, then ten notebooks will cost $10.In electronics, an ideal resistor creates a linear relationship between voltage and current. If you double voltage, the current doubles, and vice versa. So we say an ideal resistor is a linear element.

## Scaling (homogeneity)

We want to write this scaling property in mathematical terms.
This doubling-begets-doubling can be written as f, left parenthesis, 2, x, right parenthesis, equals, 2, f, left parenthesis, x, right parenthesis. Similarly, tripling-begets-tripling can be written as f, left parenthesis, 3, x, right parenthesis, equals, 3, f, left parenthesis, x, right parenthesis. And in general, the scaling property is

The fancy mathematical word for this property is

*homogeneity*.A function that looks like a line through the origin has the scaling property. Let y, equals, f, left parenthesis, x, right parenthesis, equals, 2, x.

If x, equals, 2, then y, equals, 2, dot, 2, equals, 4.

If we double x from 2 to 4, then y, equals, 2, dot, 4, equals, 8.

So doubling x exactly doubles y.

Importantly, because f, left parenthesis, x, right parenthesis is a straight line, the scale factor a does not depend on the value of x.

If the function is any other shape, like y, equals, x, squared or y, equals, 1, slash, x or y, equals, e, start superscript, x, end superscript, the scale factor isn't the same for every x, it depends on x's value.

For example, if y, equals, x, squared, slash, 16,

At x, equals, 4, y, equals, 4, squared, slash, 16, equals, 1, so the scale factor going from x to y is 1, slash, 4.

At x, equals, 8, y, equals, 8, squared, slash, 16, equals, 4, so the scale factor is 1, slash, 2.

For any function that is not a straight line, scaling (amplification) is not constant, but rather depends on the input value, x.

This is the main reason we like to build and use

*linear*amplifiers to make small signals bigger. Every signal is uniformly scaled up by the same amount, so the output looks like a scaled up replica of the input.## Adding (additivity)

When a relationship is linear (has the scaling property), we can derive an adding property. All linear functions have the form of a line with scale factor (slope) a:

If we make the input the sum of two distinct inputs left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis. Then,

and using the distributive property,

The terms on the right side are equivalent to:

And now we have an adding property (called

*additivity*in math talk):We can use this additivity property in a clever way.

Suppose we have two inputs, x, start subscript, 1, end subscript and x, start subscript, 2, end subscript, and we make each of them an input to a

*linear*function, f, left parenthesis, x, right parenthesis. The outputs are, of course, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis and f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis.If we add the inputs together, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, and put the sum into f, left parenthesis, x, right parenthesis, by definition the output will be f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis.

Here's the clever part: If f, left parenthesis, x, right parenthesis happens to be a

*linear*function, there is another way to derive the output when x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript is the input. The output can also be computed from the sum of the two individual outputs, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis.The additivity property of linear functions is called superposition. It is the basis of a circuit analysis technique that goes by the same name. Superposition is put to brilliant use in the Mesh Current Method and in many other engineering areas (especially signal processing).

## Linearity of electronic components

Let's start by looking at a resistor. Mathematically, you might take the point of view that a resistor is a function that takes voltage as an input, and creates a current as an output.

We can tell if an ideal resistor is linear by testing to see if it meets the rule for scaling. We can write Ohm's Law as a function:

### Resistor scaling

If we double the voltage across the resistor, the current doubles.

If we push 4 times as much current through the resistor, the voltage goes up by 4 times.

If we push 4 times as much current through the resistor, the voltage goes up by 4 times.

### Resistor additivity

If we apply 1, start text, V, end text, plus, 3, start text, V, end text to the resistor, the resulting current is either

or

A resistor has scaling (and therefore automatically has additivity).

A resistor is a

A resistor is a

*linear element*.For a real-world resistor there is of course a limit to the voltage and current. If the power left parenthesis, i, dot, v, right parenthesis is more than the resistor can handle, it may change resistance value as it overheats, or even burn up. So a real resistor is linear only over some range of voltage and current. But an ideal resistor works for any i or v, so an ideal resistor is linear, period.

### Are capacitors and inductors linear?

The capacitor and inductor element laws are

and

At first glance it might look like these are not equations of lines. But they are. They are lines if we think of the independent variable being d, v, slash, d, t and d, i, slash, d, t instead of just v or i.

and

The capacitor law can be graphed as a straight line with d, v, slash, d, t as the horizontal axis and i as the vertical axis. The slope of the capacitor line is start text, C, end text.

Likewise, the inductor law can be graphed as a straight line with d, i, slash, d, t as the horizontal axis and v as the vertical axis. The slope of the inductor line is start text, L, end text.

Ideal capacitors and inductors are linear elements.

Now we have three: start text, R, space, L, space, C, end text.

With just these linear components we can create many interesting electronic functions.

### A diode is a non-linear device

It might help to take a second and talk something that is

*not*a linear device, just for contrast. A*diode*is a non-linear semiconductor device.We will learn a lot more about diodes later on. For now, I just want to take a look at its i-v curve as an example of what a non-linear device looks like:

This i-v curve is the element law for a diode. It clearly does not look like a straight line, so this is definitely not a linear device. The non-linear behavior of a diode is typical of other semiconductor devices like transistors.

## Why do we make such a big deal about linearity?

**Answer: The math works great!**

Circuit made from linear elements can be solved exactly. In fact, there is a whole branch of mathematics devoted to solving linear functions, called Linear Algebra.

Some examples of greatness: Kirchhoff's Laws work because of linearity, as do the Node Voltage Method and the Loop Current Method.

### Non-linear functions and elements

In general, functions with non-linear behavior don't have these properties. We humans have not come up with a general-purpose method to exactly solve non-linear equations/circuits.

Each new type of circuit requires mathematical techniques specific to the new circuit. The usual approach to non-linear circuits is to bend over backwards to make it seem linear over at least some small range of operation. That's what is happening when you see terms like "piecewise-linear approximation" or "small-signal model."

## Summary

A function is linear if it has these properties:

Homogeneity (scaling): f, left parenthesis, a, x, right parenthesis, equals, a, f, left parenthesis, x, right parenthesis

Additivity: f, left parenthesis, x, start subscript, 1, end subscript, plus, x, start subscript, 2, end subscript, right parenthesis, equals, f, left parenthesis, x, start subscript, 1, end subscript, right parenthesis, plus, f, left parenthesis, x, start subscript, 2, end subscript, right parenthesis

If x and a are real numbers (as opposed to vectors or arrays), these properties mean the same thing, and you can test for just one of them.

Resistors, capacitors, and inductors are

*linear*elements because they have the scaling property.### Linearity in words

- Scaling the input by a scales the output by a.
- Adding two inputs produces the same output as applying each input individually and adding the two separate outputs.

## Want to join the conversation?

- Let's analyse the equation of a line, for example
`y=2x+3`

. A*line*should be*linear*by definition. But, if I were to test it by the numbers, I would get strange results. For example, let's plug`x=3`

and its double,`x=6`

into the function. The linearity principle states that`f(2x) = 2f(x)`

. So, let's try with our linear function`y=2x+3`

.

(1) For`x=3`

,`f(3)=2*3+3=9`

(2) For`x=6`

,`f(6)=2*6+3=15`

15 is not the double of 9. What am I getting wrong?

Thank you for your help!(2 votes)- The term 'linear' has an everyday meaning and a different meaning in mathematics. In everyday language it means "Hey, that looks like a line." In math, it means those two properties in the article (scaling and additivity). Many, but not all, lines have the mathematical property of linearity. Only those lines that pass through the origin (lines whose y-intercept is zero) are linear in the mathematical sense. This particular restriction is what gives rise to all sorts of really good properties of linear circuits.(12 votes)

- Under the subheading Adding (additivity) you claimed:

All linear functions have the form of a line with scale factor (slope)*a_:*

_f(x) = ax

Could you give us a rigorous proof of this claim? By definition, a linear function has the following property:*f(ax) = af(x)*

Could you show us how the statement*f(ax) = af(x)*implies the statement*f(x) = ax*?(3 votes)- I will use different variables for the given function and the linearity test.

Is f(x) = ax a linear function?

Linearity test:

f(x) is linear if f(bx) = bf(x)

Evaluate both sides of the linearity test and check to see if they are the same.

Left side: f(bx) = a (bx)

Right side: b f(x) = b (ax)

abx = bax

The linearity test passes, so f(x) = ax is a linear function.(2 votes)

- A diode is a non-linear device. Elaborate.(1 vote)
- A diode is non-linear because it's i-v curve does not have the properties of scaling or additivity. The last illustration in this article shows a typical diode i-v curve. If you apply the tests for scaling or additivity to this curve, they both fail. If we drive a diode with a controlled voltage, the resulting current is
**not**a scaled version of the voltage. That's why we say a diode is non-linear.(3 votes)

- Can we say that an element is linear if its equation for current and voltage is linear?

I ask because I'm having trouble with the language of circuit elements being linear, vs certain element equations being linear. For example the power across a resistor with respect to voltage is not linear, correct? P=V^2/R.(1 vote)- Steven - This is a really good question. The power equation you cited, P = v^2/R is not linear. It does not pass the two tests for linearity (scaling and additivity). The plot of power vs voltage is not a straight line through the origin. However, the i-v equations for R, L, and C do pass those tests.

But you bring up a good point. We say an element is linear if some (but not all) aspects are linear. Seems kind of arbitrary. The only thing I can think of is the circuit problems we are solving are digging into how all the voltages and currents in the circuit work themselves into a mutually agreeable state. While i and v are doing this, there isn't anything that involves balancing or trading off power between elements. Power isn't part of the journey to a solution, nor does it cause i or v to change. So in this regard, as long as we care only about variables (i and v) that have a linear relationship, we can use theories like superposition as tools for solving circuits.

I'm open to any other thoughts on this from a mathematics perspective.(1 vote)