Linear functions are the simplest algebraic functions. They have an important property which is: **the sum of two linear functions is as well a linear function**. Also, linear equations are the algebraic equations which are the easiest to solve. Using matrices and determinants to solve a system of equations only applies to linear equations.

A system, defined by the function *f(x)*, is linear if the following relationship is true:

f(x_1)&=y_1\\

f(x_2)&=y_2\\

f(x_1+x_2)&=y_1+y_2

\end{split} \]

This property is called the **Superposition Principle**, which can be defined as: if a system (function) responds to the input *x _{1}* with the output

*y*and it responds to the input

_{1}*x*with the output

_{2}*y*, it will respond to the sum of the inputs

_{2}*x*with the sum of the outputs

_{1}+ x_{2}*y*. With other words, for all linear systems, the net response caused by two or more stimuli is the sum of the responses that would have been caused by each stimulus individually.

_{1}+ y_{2}If the inputs are variable in time, the superposition principle can be written as:

\[ \begin{split}f(x_1(t))&=y_1(t)\\

f(x_2(t))&=y_2(t)\\

f(x_1(t)+x_2(t))&=y_1(t)+y_2(t)

\end{split} \]

Based on the definition of the superposition, we can claim that:

- any system (function) which respects the principle of superposition is a
**linear system (function)** - the
**superposition principle**applies to all linear systems (functions)

A system (function) is defined as linear if it satisfies the following properties::

\[ \begin{split}f(x_1+x_2) &= f(x_1)+f(x_2) \quad &\text{Additivity}\\

f(c \cdot x_1) &= c \cdot f(x_1) \quad &\text{Homogeneity}

\end{split} \]

where *c* is a scalar (constant).

The Additivity and Homogeneity properties together constitute the **principle of superposition**.

A more **generic definition of the superposition principle** can be written as: the response *y(t)* of a linear system due to multiple inputs *x _{1}(t), x_{2}(t), … x_{n}(t)*, which are acting simultaneously on the system, is equal with the sum of the responses of each individual input, when all the initial conditions of the system are zero. Therefore, if

*y*is the system’s response (output) for the input

_{i}(t)*x*, the following relationship is valid:

_{i}(t)The principle of superposition can be used to solve problems in mathematics, control systems, electronics and physics. In the examples below we are going to go through each domain and solve problems using the superposition principle.

### Example 1. Linear functions

A linear system is described by the function:

\[y(t)=5 \cdot x_{1}(t) + x_{2}(t)\]where the inputs *x _{1}(t)* and

*x*are defined as:

_{2}(t)x_{1}(t) &= t\\

x_{2}(t) &= t^2

\end{split} \]

Find the expression of *y(t)* function of *t*, using the superposition principle.

**Step 1**. Set *x _{2}(t) = 0* and calculate

*y*. This way we calculate only the effect of the first input.

_{1}(t)x_{1}(t) = t \\

x_{2}(t) = 0 \\

y(t) = y_{1}(t) = 5 \cdot t

\end{split} \]

**Step 2**. Set *x _{1}(t) = 0* and calculate

*y*. This way we calculate only the effect of the second input.

_{2}(t)x_{1}(t) = 0 \\

x_{2}(t) = t^2 \\

y(t) = y_{2}(t) = t^2

\end{split} \]

**Step 3**. Calculate the total output *y(t)* as the sum of *y _{1}(t)* and

*y*.

_{2}(t)### Example 2. Differential equations

In case of linear differential equations, the general solution can be found by summing up particular solutions. This is possible because a linear differential equation complies with the **superposition principle**.

Let’s take the following linear, 2^{nd} order homogeneous differential equation:

**Step 1**. The solutions of this type of differential equation can be guessed as:

y_1(x) &= \cos(x) \\

y_2(x) &= \sin(x)

\end{split} \]

**Step 2**. Verify if the solutions are valid

The first order derivatives of the solutions, the trigonometric functions *cos(x)* and *sin(x)*, are:

\frac{d}{dx} \cos(x) &= – \sin(x) \\

\frac{d}{dx} \sin(x) &= \cos(x)

\end{split} \]

The second order derivatives of the solutions will be:

\[ \begin{split}\frac{d^2}{dx^2} \cos(x) &= – \cos(x) \\

\frac{d^2}{dx^2} \sin(x) &= – \sin(x)

\end{split} \]

If we replace the second order derivatives of the solutions and the solutions *y _{1}(x)* and

*y*in the initial differential equation (1), we’ll get:

_{2}(x)\cos(x) – \cos(x) &= 0\\

\sin(x) – \sin(x) &= 0

\end{split} \]

which proves that *y _{1}(x)* and

*y*are solutions for the differential equation.

_{2}(x)**Step 3**. According to the principle of superposition, the general solution of the differential equation can be written as:

where *c _{1}* and

*c*are scalars (constants).

_{2}Let’s prove that *y(x)* is in fact a general solution of the differential equation. We know that a constant factor can be taken out of a derivative and the derivative of the sum of two functions is equal to the sum of their derivatives. Applied to our general solution, it means:

Replacing (2) and (3) in the initial differential equation (1), gives:

\[ \begin{split}– c_1 \cos(x) – c_2 \sin(x) + c_1 \cos(x) + c_2 \sin(x) &= 0\\

0 &= 0

\end{split} \]

which proves that (2) is a general solution of the differential equation (1).

### Example 3. Control systems

A control system is linear if **the superposition principle** can be applied to it. Therefore, for linear systems, the response to multiple inputs can be calculated by considering one input at a time and adding the results.

Let’s consider two transfer functions, *H _{1}(s)* and

*H*:

_{2}(s)H_1(s) &= \frac{5}{0.1 \cdot s + 1}\\

H_2(s) &= \frac{5}{0.2 \cdot s^2 + 1.2 \cdot s +1}

\end{split} \]

The two transfer functions are forming up a system which is stimulated by two inputs *u _{1}(t)* and

*u*. Let’s assume that

_{2}(t)*u*is a

_{1}(t)**step input**and

*u*is a

_{2}(t)**ramp input**.

The purpose of the exercise is to demonstrate the principle of superposition. The output *y(t)* is going to be calculated as the sum between *y _{1}(t)* and

*y*, where:

_{2}(t)*y*is the output of the system when_{1}(t)*u*is a step input and_{1}(t)*u*_{2}(t) = 0*y*is the output of the system when_{2}(t)*u*and_{1}(t) = 0*u*is a ramp input_{2}(t)

In order to simulate the our system, we are going to use an Xcos block diagram model.

In section `A)`

of the Xcos block diagram, the system is simulated with both inputs, step and ramp signals. The output *y(t)* is then plotted on `Scope 1`

together with the input signals *u _{1}(t)* and

*u*. In section

_{2}(t)`B)`

of the diagram, the input *u*is set to zero and only a step input is fed to the system. In section

_{2}(t)`C)`

of the diagram, the input *u*is set to zero and only a ramp input is fed to the system. The outputs

_{1}(t)*y*and

_{1}(t)*y*are then plotted individually and summed together in

_{2}(2)`Scope 2`

.As expected, the sum of the individual outputs *y _{1}(t)* and

*y*gives the same

_{2}(2)*y(t)*, simulated with both inputs active. This demonstrates that the principle of superposition is valid for linear continuous systems.

### Example 4. Electric circuits

Considering the electric circuit below. Find the values of the electric currents flowing through the resistors.

where:

\[ \begin{split}E_1 &= 28 \text{ V}\\

E_2 &= 7 \text{ V}\\

R_1 &= 4 \text{ }\Omega\\

R_2 &= 2 \text{ }\Omega\\

R_3 &= 1 \text{ }\Omega

\end{split} \]

To solve the circuit we’ll use the **principle of superposition**. The strategy used is to eliminate all but one source of voltage within the circuit at a time and, using series/parallel analysis (KVL and KCL), to determine the electric current within the modified circuit for each voltage source separately. Then, once the electric currents have been determined, for each voltage source working separately, the values are all “superimposed” on top of each other (added algebraically) to find the actual currents with all voltage sources active.

**Step 1**. Keep only one voltage source (*E _{1}*) and calculate the values of the electrical currents through the resistors.

In the above circuit we have two **loops**, A and B and two **nodes**, C and D. We’ll write Kirchhoff’s Current Law (KCL) for node C and Kirchhoff’s Voltage Law (KVL) for both loops.

\[I_1 = I_2 + I_3 \tag{4}\]

\[E_1 = I_1 \cdot R_1 + I_2 \cdot R_2 \tag{5}\]

\[0 = I_2 \cdot R_2 – I_3 \cdot R_3 \tag{6}\]

We have a system of three equations from which we have to calculate the electrical currents flowing through the resistors.

Replacing (4) in (5) gives:

\[(I_2 + I_3) \cdot R_1 + I_2 \cdot R_2 = E_1 \tag{7}\]From (6) we can extract the expression of *I _{3}*:

Replacing (8) in (7), gives:

\[I_2 \cdot (R_1 + R_2) + I_2 \cdot \frac{R_1 \cdot R_2}{R_3} = E_1 \tag{9}\]From (9) we can write the expression of *I _{2}* only function of the resistances and input voltage:

Replacing the numerical values of the resistances and voltage in (10), gives the value of the electrical current *I _{2}*:

Replacing (11) in (8), gives the value of *I _{3}*:

Replacing (11) and (12) in (4) gives the value of *I _{1}*:

**Step 2**. Keep only one voltage source (*E _{2}*) and calculate the values of the electrical currents through the resistors.

In the above circuit we have two **loops**, A and B and two **nodes**, C and D. We’ll write Kirchhoff’s Current Law (KCL) for node C and Kirchhoff’s Voltage Law (KVL) for both loops.

\[I_3 = I_1 + I_2 \tag{14}\]

\[E_2 = I_3 \cdot R_3 + I_2 \cdot R_2 \tag{15}\]

\[0 = I_1 \cdot R_1 – I_2 \cdot R_2 \tag{16}\]

We have a system of three equations from which we have to calculate the electrical currents flowing through the resistors.

Replacing (14) in (15) gives:

\[(I_1 + I_2) \cdot R_3 + I_2 \cdot R_2 = E_2 \tag{17}\]From (16) we can extract the expression of *I _{1}*:

Replacing (18) in (17), gives:

\[I_2 \cdot \frac{R_2 \cdot R_3}{R_1} + I_2 \cdot (R_3 + R_2) = E_2 \tag{19}\]From (19) we can write the expression of *I _{2}* only function of the resistances and input voltage:

Replacing the numerical values of the resistances and voltage in (20), gives the value of the electrical current *I _{2}*:

Replacing (21) in (18), gives the value of *I _{1}*:

Replacing (21) and (22) in (14) gives the value of *I _{3}*:

**Step 3**. Add the values of the electrical currents from Step 1 and Step 2 taking care of the sign.

I_1 &= 6 – 1 &= 5 \text{ A}\\

I_2 &= 2 + 2 &= 4 \text{ A}\\

I_3 &= 4 – 3 &= 1 \text{ A}

\end{split} \]

In order to make sure that our calculation is correct, we are going to model the same circuit in an Xcos environment and run a simulation with both voltage sources active. The electrical currents in the Xcos simulation should match our manual calculation.

As expected, we have exactly the same results for the electrical current flowing through the resistors, which validates the **superposition principle** as a calculation method. This exercise proves that, in a linear electrical circuit (network), the voltage or current in any element resulting from several sources acting together is the sum of the voltages or currents resulting from each source acting alone.

### Example 5. Electrostatic forces

Let’s assume that we have three electric charges *Q _{1}*,

*Q*and

_{2}*Q*, positioned one from another as in the image below, part A).

_{3}*Q*and

_{1}*Q*have positive charge while

_{3}*Q*has negative charge. Assuming that the electrical charges do not interact with anything else around them, and assume that gravitational interactions are negligible, what is the magnitude and direction of the net electrostatic force on the electrical charge

_{2}*Q*?

_{1}For a numerical calculation, we’ll consider the following parameters:

\[ \begin{split}Q_1 &= 1.6 \cdot 10^{-19} \text{ C}\\

Q_2 &= -3.2 \cdot 10^{-19} \text{ C}\\

Q_3 &= 4.8 \cdot 10^{-19} \text{ C}\\

L &= 0.001 \text{ m}\\

\varepsilon_0 &= 8.854187817 \cdot 10^{-12} \text{ permittivity of vacuum}\\

\varepsilon_r &= 1.00058986 \text{ (relative permittivity of air, at STP)}

\end{split} \]

In part B) of the image above, we’ve drawn the forces acting on *Q _{1}*. Acting on

*Q*(positive charge), there is an attraction force

_{1}*F*from

_{21}*Q*(negative charge) and a repulsion force

_{2}*F*from

_{31}*Q*(positive charge). Applying the

_{3}**principle of superposition**, first, we can calculate the magnitude of each force individually and second, the magnitude and direction of the resultant force as a vector sum of the individual forces.

**Step 1**. Calculate the distance between charge *Q _{1}* and

*Q*.

_{3}We can observe that the charges are displayed in a right angle triangle with the legs of length *L*. To calculate the distance between *Q _{1}* and

*Q*we need to apply the

_{3}**Pythagorean theorem**.

where:

L_{31} [m] – distance between charge Q_{3} and Q_{1};

L_{21} [m] – distance between charge Q_{2} and Q_{1};

L_{23} [m] – distance between charge Q_{2} and Q_{3};

Solving the equation above gives *L _{13}* function of

*L*:

L_{31}^2 = L^2 + L^2 = 2 \cdot L^2\\

L_{31} = L \cdot \sqrt{2}

\end{split} \]

**Step 2.** According to Coulomb’s law the electrostatic force between two charges is calculated as:

where:

F [N] – Coulomb force

Q_{1}, Q_{2} [C] – electrical charges

L [m] – distance between electrical charges

k [F/m] – is called the Coulomb’s constant, or electric force constant or electrostatic constant.

The value of Coulomb’s constant is calculated as:

\[k = \frac{1}{4\pi\varepsilon} \]where *ε* is the absolute permittivity:

Applying Coulomb’s law to both forces gives:

\[ \begin{split}F_{21} &= k \cdot \frac{Q_2 \cdot Q_1}{L_{21}^2} = -4.5989 \cdot 10^{-22} \text{ N}\\

F_{31} &= k \cdot \frac{Q_3 \cdot Q_1}{L_{31}^2} = 3.4492 \cdot 10^{-22} \text{ N}

\end{split} \]

Knowing the magnitude and direction of *F _{31}* and

*F*, we can determine the magnitude and direction of the resultant force

_{21}*F*.

_{1}**Step 3**. Calculate the x-axis and y-axis components for *F _{31}* and

*F*.

_{21}F_{21x} &= F_{21} &= -4.5989 \cdot 10^{-22} \text{ N}\\

F_{21y} &= 0 &= 0 \text{ N}\\

F_{31x} &= F_{31} \cdot \cos(45^{\circ}) &= 2.43895 \cdot 10^{-22} \text{ N}\\

F_{31y} &= F_{31} \cdot \sin(45^{\circ}) &= 2.43895 \cdot 10^{-22} \text{ N}

\end{split} \]

**Step 4**. Calculate the x-axis and y-axis components for *F _{1}*.

F_{1x} = F_{21x} + F_{31x} &= -4.5989 \cdot 10^{-22} + 2.43895 \cdot 10^{-22} &= -2.15995 \cdot 10^{-22} \text{ N}\\

F_{1y} = F_{21y} + F_{31y} &= 0 + 2.43895 \cdot 10^{-22} &= 2.43895 \cdot 10^{-22} \text{ N}

\end{split} \]

**Step 5**. Calculate the magnitude and direction of the resultant force *F _{1}*.

We can apply the **Pythagorean theorem** to find the resultant force:

and the **definition of the tangent** to find the direction, angle *θ*:

\tan(\theta) &= \frac{F_{1y}}{F_{1x}}\\

\theta &= \arctan \left ( {\frac{F_{1y}}{F_{1x}}} \right ) = -41.52831^{\circ}

\end{split} \]

**Conclusion**: The resultant force was determined by calculating the action of each force upon charge *Q _{1}* and summing up the results. This method is an example of the application of the

**principle of superposition**.

### Example 6. Metal bar change in length

Calculate the total change in length, in mm, of a steel bar with several linear loads (see image below).

For the bar to be in equilibrium, the following relationship needs to be satisfied:

\[F_{1} = F_{2} + F_{3} + F_{4}\]The force and length values are as follows:

\[ \begin{split}F_{1} &= 2000 &\text{ N}\\

F_{2} &= 500 &\text{ N}\\

F_{3} &= 500 &\text{ N}\\

F_{4} &= 1000 &\text{ N}\\

L_{1} &= 0.5 &\text{ m}\\

L_{2} &= 0.25 &\text{ m}\\

L_{3} &= 0.25 &\text{ m}

\end{split} \]

We also need the cross-sectional area of the bar *A* and Young’s modulus of elasticity *E* for steel:

A &= 0.0001 \text{ m}^2\\

E &= 2 \cdot 10^{11} \frac{\text{ N}}{m^{2}}

\end{split} \]

To solve this problem we need to use **Hooke’s law**, which states that tensional stiffness (tensile stress) of an uniform bar *σ* is linearly proportional to its fractional extension (strain) *ε* by the modulus of elasticity *E*:

The fractional extension (strain) *ε* is:

where *ΔL* is the change in length of the bar due to force applied and *L* is the load-free length of the bar.

The tensile stress *σ* is the ration between the force applied *F* and the cross-sectional area *A*:

Replacing (22) and (23) in (21), gives:

\[\frac{F}{A} = E \cdot \frac{\Delta L}{L} \tag{24}\]From (24) we can extract the expression of the change in length of the bar:

\[\Delta L = \frac{F \cdot L}{A \cdot E} \tag{25}\]The **principle of superposition** applied to this problem states that the total change in length of the bar is equal with the sum of the changes in length of the incremented sections of the bar, with individual force applied (see image below).

**Step 1**. Calculate the change in length of the first section

**Step 2**. Calculate the change in length of the first and second section

**Step 3**. Calculate the change in length of the first, second and third section

**Step 4**. Calculate the total change in length

From (26), we get:

\[\Delta L = 0.00125 + 0.001875 + 0.005 = 0.008125 \text{ mm}\]This problem is a demonstration that the principle of superposition can be used to solve complex problems with multiple loads and/or reactions acting on the member. Superposition helps us solve these problems by breaking the member down as many times as necessary for each force acting on it. Once all the stresses or deflections for the point of interest are found, they can then be added all together to get a final answer.

check final article