Linear Algebra

1.9 Applications of Linear Systems

Imron Rosyadi

Linear Algebra in ECE

1.9 Applications of Linear Systems

Imron Rosyadi



Unlocking the real-world power of linear systems in Network Analysis, Chemical Balancing, Polynomial Interpolation, and Economic Modeling.

Network Analysis: Core Principle

A network is a set of branches through which something “flows”. Branches meet at nodes or junctions.

  • Examples: Electrical wires, pipes, traffic lanes, financial flows.
  • Flow Rate: Measured in units like amperes (electricity), gallons/minute (water), vehicles/hour (traffic).
  • Core Principle: Flow Conservation
    • At each node, rate of flow into the node = rate of flow out of the node.
    • This prevents buildup and ensures free movement.

A common problem is to use known flow rates in some branches to find rates in all branches.

Example 1: Simple Network Analysis

Find the flow rates and directions in the remaining branches.

Network Diagram

Arbitrarily assign directions for unknown flows \(x_1, x_2, x_3\).

Equations from Flow Conservation:

  • Node A: \(x_1 + x_2 = 30\)
  • Node B: \(x_2 + x_3 = 35\)
  • Node C: \(x_3 + 15 = 60 \implies x_3 = 45\)
  • Node D: \(x_1 + 15 = 55 \implies x_1 = 40\)

Linear System: \[ \begin{array}{r}x_1 + x_2 \qquad = 30\\ \qquad x_2 + x_3 = 35\\ x_3 = 45\\ x_1 = 40\end{array} \]

Example 1: Solving the Network System

Let’s solve the system using Python.

System: \(x_1 + x_2 = 30\)
\(x_2 + x_3 = 35\)
\(x_3 = 45\)
\(x_1 = 40\)

Solution: \(x_1 = 40, x_2 = -10, x_3 = 45\).

The negative value for \(x_2\) indicates its actual flow direction is opposite to the one assumed.

Example 2: Design of Traffic Patterns

Analyzing traffic flow around a new park in Philadelphia.

Traffic Network

Part (a): Traffic Light Setting
Total Flow In = Total Flow Out
\(500 + 400 + 600 + 200 = x + 700 + 400\)
\(1700 = x + 1100\)
\(x = 600\) vehicles/hour.

Example 2: Design of Traffic Patterns

Part (b): Streets’ Flow Rates
With \(x = 600\), apply flow conservation at each intersection (A, B, C, D):

  • A: \(400 + 600 = x_1 + x_2 \implies x_1 + x_2 = 1000\)
  • B: \(x_2 + x_3 = 400 + x \implies x_2 + x_3 = 1000\)
  • C: \(500 + 200 = x_3 + x_4 \implies x_3 + x_4 = 700\)
  • D: \(x_1 + x_4 = 700\)

Linear System: \[ \begin{array}{r l l}x_1 + x_2 \qquad & = 1000\\ \qquad x_2 + x_3 & = 1000\\ \qquad x_3 + x_4 &= 700\\ x_1 \qquad + x_4 &= 700 \end{array} \]

Example 2: Solving the Traffic Flow System

This system has infinitely many solutions, given by parametric equations. Physical constraints (e.g., non-negative flow) limit the parameter \(t\).

Network Analysis: Electrical Circuits

Linear systems are fundamental to circuit analysis.

  • Ohm’s Law: Voltage drop \(E = IR\) (Current \(\times\) Resistance).
  • Kirchhoff’s Current Law (KCL): Sum of currents entering a node = Sum of currents leaving a node. (Flow Conservation)
  • Kirchhoff’s Voltage Law (KVL): In any closed loop, sum of voltage rises = sum of voltage drops.

Electrical Network Example Clockwise Loop Convention

Conventions: For KVL, we often assume clockwise loops and define voltage rises/drops for batteries and resistors consistently.

Example 3: Circuit with One Closed Loop

Determine the current \(I\).

Single Loop Circuit

  • Resistor (3 Ω): Current \(I\) flows in same direction as loop \(\implies\) Voltage Drop \(E_R = IR = 3I\).
  • Battery (6 V): Loop direction from \(-\) to \(+\) through battery \(\implies\) Voltage Rise \(E_{Batt} = 6\)V.

Applying KVL: Sum of voltage rises = Sum of voltage drops
\(6 = 3I\)
\(I = 2\) A.

Since \(I\) is positive, the assigned direction is correct.

Example 4: Circuit with Three Closed Loops

Determine the currents \(I_1, I_2, I_3\).

Three Loop Circuit

KCL at Node A (or B): \(I_1 + I_2 = I_3 \implies I_1 + I_2 - I_3 = 0\)

KVL for Loops (clockwise traversal):

  • Left Inside Loop: \(50 = 5I_1 + 20I_3\)
  • Right Inside Loop: \(30 = 10I_2 + 20I_3\)

Combined Linear System: \[ \begin{array}{r l l}I_1 + \quad I_2 - \quad I_3 & = \quad 0\\ 5I_1 \qquad + 20I_3 & = \quad 50\\ \qquad 10I_2 + 20I_3 & = -30\end{array} \]

Example 4: Solving the Circuit System

Let’s solve for \(I_1, I_2, I_3\) using Python.

System: \(I_1 + I_2 - I_3 = 0\)
\(5I_1 + 20I_3 = 50\)
\(10I_2 + 20I_3 = -30\)

Solution: \(I_1 = 6\) A, \(I_2 = -5\) A, \(I_3 = 1\) A.

The negative value for \(I_2\) indicates its actual direction is opposite to the assumption.

Balancing Chemical Equations

Chemical equations represent reactions where atoms rearrange. A balanced equation means the same number of atoms of each type appears on both sides of the equation.

Systematic Method using Linear Systems:

  1. Assign unknown coefficients (\(x_1, x_2, \ldots\)) to each molecule.
  2. For each type of atom (e.g., C, H, O), set up an equation ensuring the number of atoms on the reactant side equals the number on the product side.
  3. This forms a homogeneous linear system.
  4. Solve the system; the smallest positive integer solution for the coefficients is the balanced equation.

Example: Balancing Methane Combustion

Balance the equation: \(\mathrm{CH_4} + \mathrm{O_2} \longrightarrow \mathrm{CO_2} + \mathrm{H_2O}\)

Assign coefficients: \(x_1(\mathrm{CH_4}) + x_2(\mathrm{O_2}) \longrightarrow x_3(\mathrm{CO_2}) + x_4(\mathrm{H_2O})\)

Atom Balance Equations:

  • Carbon (C): \(x_1 = x_3 \implies x_1 - x_3 = 0\)
  • Hydrogen (H): \(4x_1 = 2x_4 \implies 4x_1 - 2x_4 = 0\)
  • Oxygen (O): \(2x_2 = 2x_3 + x_4 \implies 2x_2 - 2x_3 - x_4 = 0\)

Homogeneous Linear System: \[ \begin{array}{r}x_1 \qquad - x_3 \qquad \quad = 0\\ 4x_1 \qquad \qquad - 2x_4 = 0\\ \qquad 2x_2 - 2x_3 - x_4 = 0\end{array} \]

Augmented Matrix: \(\left[ \begin{array}{rrrrr}1 & 0 & -1 & 0 & 0\\ 4 & 0 & 0 & -2 & 0\\ 0 & 2 & -2 & -1 & 0 \end{array} \right]\)

Example: Solving for Methane Combustion

Let’s solve the system:
\(x_1 - x_3 = 0\)
\(4x_1 \qquad - 2x_4 = 0\)
\(2x_2 - 2x_3 - x_4 = 0\)

The general solution is \(x_1 = t/2, x_2 = t, x_3 = t/2, x_4 = t\).
Smallest positive integers occur at \(t=2\): \(x_1=1, x_2=2, x_3=1, x_4=2\).

Balanced equation: \(\mathrm{CH_4} + 2\mathrm{O_2} \longrightarrow \mathrm{CO_2} + 2\mathrm{H_2O}\).

Example: Balancing \(\mathrm{HCl} + \mathrm{Na_3PO_4}\)

Balance: \(\mathrm{HCl} + \mathrm{Na_3PO_4} \longrightarrow \mathrm{H_3PO_4} + \mathrm{NaCl}\)

Assign coefficients: \(x_1(\mathrm{HCl}) + x_2(\mathrm{Na_3PO_4}) \longrightarrow x_3(\mathrm{H_3PO_4}) + x_4(\mathrm{NaCl})\)

Atom Balance Equations:

  • H: \(x_1 = 3x_3 \implies x_1 - 3x_3 = 0\)
  • Cl: \(x_1 = x_4 \implies x_1 - x_4 = 0\)
  • Na: \(3x_2 = x_4 \implies 3x_2 - x_4 = 0\)
  • P: \(x_2 = x_3 \implies x_2 - x_3 = 0\)
  • O: \(4x_2 = 4x_3 \implies 4x_2 - 4x_3 = 0\)

Homogeneous Linear System: \[ \begin{array}{r l l l l l}x_1 \qquad \qquad - 3x_3 \qquad \quad &= 0\\ x_1 \qquad \qquad \qquad - x_4 &= 0\\ \qquad 3x_2 \qquad \qquad - x_4 &= 0\\ \qquad x_2 - x_3 \qquad \quad &= 0\\ \qquad 4x_2 - 4x_3 \qquad \quad &= 0\end{array} \]

Example: Solving for \(\mathrm{HCl} + \mathrm{Na_3PO_4}\)

System: \(x_1 - 3x_3 = 0\)
\(x_1 - x_4 = 0\)
\(3x_2 - x_4 = 0\)
\(x_2 - x_3 = 0\)
\(4x_2 - 4x_3 = 0\)

General solution: \(x_1 = t, x_2 = t/3, x_3 = t/3, x_4 = t\).
Smallest positive integers occur at \(t=3\): \(x_1=3, x_2=1, x_3=1, x_4=3\).

Balanced equation: \(3\mathrm{HCl} + \mathrm{Na_3PO_4} \longrightarrow \mathrm{H_3PO_4} + 3\mathrm{NaCl}\).

Polynomial Interpolation

Problem: Find a polynomial whose graph passes through a specified set of points \((x_1, y_1), \ldots, (x_n, y_n)\).

THEOREM 1.9.1 (Polynomial Interpolation): Given any \(n\) points in the \(xy\)-plane with distinct \(x\)-coordinates, there is a unique polynomial of degree \(n-1\) or less whose graph passes through those points.

Polynomial Interpolation

We seek a polynomial \(p(x) = a_0 + a_1x + a_2x^2 + \dots + a_{n-1}x^{n-1}\). Substituting each point \((x_i, y_i)\) into the polynomial gives a linear system for the coefficients \(a_0, \ldots, a_{n-1}\): \[ \begin{array}{r l} a_{0} + a_{1}x_{1} + a_{2}x_{1}^{2} + \dots +a_{n - 1}x_{1}^{n - 1} &= y_{1}\\ \vdots \\ a_{0} + a_{1}x_{n} + a_{2}x_{n}^{2} + \dots +a_{n - 1}x_{n}^{n - 1} &= y_{n} \end{array} \] This system can be written with an augmented matrix: \[ \left[{\begin{array}{l l l l l l}{1}&{x_{1}}&{x_{1}^{2}}&{\cdots}&{x_{1}^{n-1}}&{y_{1}}\\ {1}&{x_{2}}&{x_{2}^{2}}&{\cdots}&{x_{2}^{n-1}}&{y_{2}}\\ {\vdots}&{\vdots}&{\vdots}&&{\vdots}&{\vdots}\\ {1}&{x_{n}}&{x_{n}^{2}}&{\cdots}&{x_{n}^{n-1}}&{y_{n}}\end{array}}\right] \] Solving this system yields the unique coefficients of the interpolating polynomial.

Example 6: Cubic Polynomial Interpolation

Find a cubic polynomial whose graph passes through the points: \((1,3),\ (2, - 2),\ (3, - 5),\ (4,0)\)

The polynomial is \(p(x) = a_0 + a_1x + a_2x^2 + a_3x^3\). Using the augmented matrix from the previous slide: \[ \left[{\begin{array}{r r r r r}{1}&{x_{1}}&{x_{1}^{2}}&{x_{1}^{3}}&{y_{1}}\\ {1}&{x_{2}}&{x_{2}^{2}}&{x_{2}^{3}}&{y_{2}}\\ {1}&{x_{3}}&{x_{3}^{2}}&{x_{3}^{3}}&{y_{3}}\\ {1}&{x_{4}}&{x_{4}^{2}}&{x_{4}^{3}}&{y_{4}}\end{array}}\right]={\left[\begin{array}{r r r r r}{1}&{1}&{1}&{1}&{3}\\ {1}&{2}&{4}&{8}&{-2}\\ {1}&{3}&{9}&{27}&{-5}\\ {1}&{4}&{16}&{64}&{0}\end{array}\right]} \]

We will solve this system for \(a_0, a_1, a_2, a_3\).

Example 6: Solving and Plotting

The coefficients obtained are \(a_0 = 4, a_1 = 3, a_2 = -5, a_3 = 1\). Thus, \(p(x) = 4 + 3x - 5x^2 + x^3\).

Example 7: Approximate Integration

One application is approximating integrals of complex functions by interpolating them with simpler polynomials.

Example: \(\int_{0}^{1} \sin \left(\frac{\pi x^{2}}{2}\right) dx\)

  1. Use points on the function’s graph (e.g., \((x_i, f(x_i))\)).
  2. Find an interpolating polynomial \(p(x)\) for these points.
  3. Integrate the polynomial \(\int p(x) dx\) as an approximation.

Approximate Integration Graph

The interpolating polynomial \(p(x) = 0.098796x + 0.762356x^2 + 2.14429x^3 - 2.00544x^4\) closely approximates \(f(x)\) over \([0,1]\).

Leontief Input-Output Models

Developed by economist Wassily Leontief (Nobel Prize, 1973). Analyzes interdependencies between sectors of an economy.

  • Sectors: Manufacturing, Agriculture, Utilities. Each produces outputs and requires inputs (from itself or other sectors).
  • Consumption Matrix (C): Entries \(c_{ij}\) represent the dollar value of output from sector \(i\) required by sector \(j\) to produce one dollar’s worth of output.
    • Example: \(C = \left[ \begin{array}{ccc}0.5 & 0.1 & 0.1\\ 0.2 & 0.5 & 0.3\\ 0.1 & 0.3 & 0.4 \end{array} \right]\)
      • (0.5, 0.2, 0.1) in first column means manufacturing needs $0.50 of its own, $0.20 agricultural, $0.10 utilities to produce $1.00 of manufacturing output.
  • Outside Demand Vector (\(\mathbf{d}\)): Demand from the “open sector” (e.g., consumers).
  • Production Vector (\(\mathbf{x}\)): Total output from each sector needed to satisfy internal consumption AND outside demand.

Leontief Equation

The total production \(\mathbf{x}\) must cover: 1. Intermediate Demand (\(C\mathbf{x}\)): What product-producing sectors consume from each other. 2. Outside Demand (\(\mathbf{d}\)): What the open sector demands.

Thus: \(\mathbf{x} = C\mathbf{x} + \mathbf{d}\)

Rearranging this, we get the Leontief Equation: \[ (I - C)\mathbf{x} = \mathbf{d} \] The matrix \((I - C)\) is called the Leontief Matrix. If \((I-C)\) is invertible, the unique solution is \(\mathbf{x} = (I - C)^{-1}\mathbf{d}\).

Example 1 (Leontief): Satisfying Outside Demand

Consider \(C = \left[ \begin{array}{lll}0.5 & 0.1 & 0.1\\ 0.2 & 0.5 & 0.3\\ 0.1 & 0.3 & 0.4 \end{array} \right]\) Outside demand \(\mathbf{d} = \left[ \begin{array}{l}7900\\ 3950\\ 1975 \end{array} \right]\) (Manufactured, Agricultural, Utilities)

We need to solve \((I - C)\mathbf{x} = \mathbf{d}\). First, compute \(I - C\): \[ I - C = \left[ \begin{array}{lll}1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{array} \right] - \left[ \begin{array}{lll}0.5 & 0.1 & 0.1\\ 0.2 & 0.5 & 0.3\\ 0.1 & 0.3 & 0.4 \end{array} \right] = \left[ \begin{array}{rrr}0.5 & -0.1 & -0.1\\ -0.2 & 0.5 & -0.3\\ -0.1 & -0.3 & 0.6 \end{array} \right] \] Now, solve the system \(\left[ \begin{array}{rrr}0.5 & -0.1 & -0.1\\ -0.2 & 0.5 & -0.3\\ -0.1 & -0.3 & 0.6 \end{array} \right]\left[ \begin{array}{c}x_{1}\\ x_{2}\\ x_{3} \end{array} \right] = \left[ \begin{array}{c}7900\\ 3950\\ 1975 \end{array} \right]\).

Example 1 (Leontief): Solving for \(\mathbf{x}\)

Solution: \(\mathbf{x} = \left[ \begin{array}{l}27500\\ 33750\\ 24750 \end{array} \right]\)

The economy can meet the demand by producing these amounts.

Productive Open Economies

For \(\mathbf{x}\) to be a valid production vector, its entries must be nonnegative. An economy is productive if \((I-C)^{-1}\) exists and has nonnegative entries for every demand vector \(\mathbf{d}\).

THEOREM 1.10.1: If \(C\) is the consumption matrix for an open economy, and if all of the column sums are less than 1, then the matrix \(I - C\) is invertible, the entries of \((I - C)^{-1}\) are nonnegative, and the economy is productive.

  • A sector is profitable if its column sum in \(C\) is less than 1 (it needs less than $1 of input to produce $1 of output).
  • Thus, if all product-producing sectors are profitable, the economy is productive. (Or if all row sums are less than 1, also productive.)

Example 2 (Leontief): Confirming Productive Economy

Recall \(C = \left[ \begin{array}{lll}0.5 & 0.1 & 0.1\\ 0.2 & 0.5 & 0.3\\ 0.1 & 0.3 & 0.4 \end{array} \right]\) Column sums:

  • Mfg: \(0.5 + 0.2 + 0.1 = 0.8 < 1\)
  • Ag: \(0.1 + 0.5 + 0.3 = 0.9 < 1\)
  • Util: \(0.1 + 0.3 + 0.4 = 0.8 < 1\)

All column sums are less than 1, so by Theorem 1.10.1, the economy is productive! \((I-C)^{-1}\) should exist and have nonnegative entries.

The entries of \((I-C)^{-1}\) are indeed nonnegative, confirming the economy’s productivity. The production vector matches the previous calculation.

ECE Applications & Summary

Key Areas for ECE where Linear Systems are Applied:

  • Network Analysis:
    • Electrical Circuits: Solving currents and voltages using Kirchhoff’s Laws (KCL, KVL) – fundamental to circuit design & diagnostics.
    • Traffic Management: Optimizing flow, designing road networks to prevent congestion.
    • Data Networks: Analyzing data packet flow, optimizing routing.
  • Signal & Image Processing:
    • Polynomial Interpolation: Reconstructing signals, approximating complex functions, noise reduction, image scaling.
    • Filter Design: Many digital filters are based on linear relationships.
  • Control Systems:
    • System Identification: Using input/output data to model a system as a set of linear equations.
    • State-Space Models: Describing system dynamics as linear systems.
  • Optimization: Many engineering optimization problems are linear or can be linearized.

ECE Applications & Summary

Today We Covered:

  • Systematic methods to solve real-world problems using linear systems.
  • Network Analysis: Flow conservation in general networks and specific electrical circuits (Ohm’s, KCL, KVL).
  • Balancing Chemical Equations: Stoichiometry via homogeneous systems.
  • Polynomial Interpolation: Fitting curves to data points leading to unique solutions.
  • Leontief Input-Output Models: Economic interdependencies and production planning.