Application of Matrix in Control Flow System
A Mini Project Submitted By
1) SAYAN SAHA 25/EE/095
2) SAYANTAN BHOWMIK 25/EE/096
3) SAYANTAN MAITI 25/EE/097
4) SHASHANK SINGH 25/EE/098
5) SHASWATIK MOITRA 25/EE/099
6) SHOUVIK DAS 25/EE/100
7) SHREYANSH KUMAR 25/EE/101
Under the Guidance of
Dr. Apurba Saha
Department of Applied Science
Haldia Institute of Technology
Haldia, Purba Medinipur-721657 (W.B.)
1
Application of Matrix in Control Flow System
ABSTRACT
This project explores the pivotal role of matrix algebra in the analysis and design of Control
Systems, a fundamental discipline within Electrical Engineering. While classical control theory
often relies on transfer functions, modern control theory utilizes the "State-Space
Representation," a powerful mathematical model that employs matrices to define the internal
state of a physical system. This project aims to demonstrate how high-order differential
equations governing physical systems—such as DC motor speed control or electrical circuit
transients—can be transformed into compact matrix equations of the form 𝑥̇ = 𝐴𝑥 + 𝐵𝑢.
We specifically investigate the application of fundamental matrix operations, including
determinants, eigenvalues, and eigenvectors, to assess critical system properties such as
stability, controllability, and observability. Furthermore, consistent with modern engineering
practices, this report incorporates computational tools like Python/MATLAB to solve these
state equations and visualize system behaviour. Ultimately, this study highlights that matrix
algebra is not merely a theoretical concept but the essential language for modeling complex,
Multi-Input Multi-Output (MIMO) systems in real-world engineering.
2
Application of Matrix in Control Flow System
INTRODUCTION
In mathematics and engineering, a matrix is defined as a rectangular array of numbers,
symbols, or expressions, arranged in rows and columns. These elements are enclosed in square
brackets and treated as a single mathematical entity. While a single number (a scalar) represents
a magnitude, and a vector represents magnitude with direction, a matrix represents a complex
system of relationships.
Historically, the concept of matrices was developed to systematically solve systems of linear
equations. However, in the modern digital age, their utility has expanded far beyond simple
algebra. Matrices now form the foundation of Linear Algebra, which is the primary
mathematical language used to describe the behaviour of complex real-world systems.
The relevance of matrices in engineering cannot be overstated. In almost every branch of
technology—from computer graphics and cryptography to quantum mechanics and structural
analysis—matrices are used to handle large datasets and perform operations on multiple
variables simultaneously.
For an Electrical Engineer, specifically in the domain of Control Systems, the matrix is an
indispensable tool. Real-world systems, such as the autopilot of an aircraft or the speed control
of a robotics arm, are "dynamic," meaning their state changes over time. These systems are
often Multi-Input Multi-Output (MIMO), meaning they are affected by various inputs and
produce various outputs simultaneously. Classical methods are often insufficient for such
complexity.
Matrices provide a compact and powerful way to represent these dynamic systems through
State-Space Modeling. This approach converts cumbersome high-order differential equations
into concise matrix equations (such as 𝑥̇ = 𝐴𝑥 + 𝐵𝑢.), allowing engineers to analyse system
stability, predict future behaviour, and design automated controllers efficiently .
PROBLEM STATEMENT
In Electrical Engineering, circuits often contain multiple energy storage elements, such as
Inductors (L) and Capacitors (C). The behaviour of these circuits is governed by physical laws
like Kirchhoff’s Voltage Law (KVL) and Kirchhoff’s Current Law (KCL).
For a simple circuit with one energy storage element, the system is described by a first-order
differential equation, which is relatively easy to solve. However, real-world control systems
and electrical networks often contain multiple inductors and capacitors. As the number of these
components increases, the system becomes a higher-order differential equation. Solving
these high-order equations manually to find the system response (e.g., how voltage changes
over time) is computationally intensive, prone to algebra errors, and difficult to visualize.
Therefore, we need a method to transform these complex, high-order differential equations into
a set of first-order coupled equations that can be solved simultaneously using computers.
3
Application of Matrix in Control Flow System
Objective
The primary objective of this project is to apply Matrix Algebra to solve this engineering
problem. Specifically, we aim to:
1. Model a dynamic electrical system: We will take a standard RLC Series Electrical
Network and formulate its governing differential equations.
2. Apply State-Space Analysis: We will convert these differential equations into the
matrix form 𝑥̇ = 𝐴𝑥 + 𝐵𝑢 (State-Space Model), where 'A' is the system matrix.
3. Demonstrate Computational Application: We will use a software tool
(Python/MATLAB) to input these matrices and numerically simulate the system's
behaviour, proving that matrix methods allow us to automate complex engineering
calculations.
APPLICATION IN CONTROL SYSTEM BY
STATE-SPACE ANALYSIS
In the field of Control Systems and Electrical Engineering, the application of matrices is
realized through a method known as State-Space Representation.
The Shift from Classical to Modern Control:
Classically, engineers used a tool called the "Transfer Function" to analyse systems. While
effective for simple systems, this method struggles when a system has multiple inputs and
multiple outputs (MIMO). Modern Control Theory solves this by using matrices. Instead of
treating the system as a "black box," matrix algebra allows us to look inside the system and
define its internal "state" at any given moment.
The Matrix Model:
The core application involves converting the system's differential equations into two specific
matrix equations:
1. The State Equation: 𝑥̇ = 𝐴𝑥 + 𝐵𝑢
2. The Output Equation: 𝑦(𝑡) = 𝐶𝑥(𝑡) + 𝐷𝑢(𝑡)
Where the matrices represent:
𝒙(𝒕) (State Vector): A column matrix representing the system's energy storage
elements (e.g., Current through Inductor, Voltage across Capacitor).
𝑨 (System Matrix): A square matrix that defines the internal dynamics of the system.
This is the most critical matrix; its Eigenvalues determine if the system is stable or
unstable.
4
Application of Matrix in Control Flow System
𝑩 (Input Matrix): Describes how external inputs (like a voltage source) affect the
system states.
𝑪 (Output Matrix): Describes which internal states are actually measured or observed.
Real-World Utility:
By organizing a system into the A, B, C, and D matrices, engineers can:
Use computers (MATLAB/Python) to solve systems with hundreds of variables
instantly.
Design "State Feedback Controllers" to stabilize unstable systems (e.g., keeping a
rocket upright).
Check "Controllability" (can we steer the system?) and "Observability" (can we
estimate internal errors?) using simple matrix rank calculations.
MATHEMATICAL MODELING
System Description
To demonstrate the application of matrices, we consider a standard Series RLC Circuit. This
is a fundamental electrical system consisting of a Resistor (R), an Inductor (L), and a
Capacitor (C) connected in series with a voltage source (𝑉 ) .
Governing Differential Equations
By applying Kirchhoff’s Voltage Law (KVL) to the loop, the sum of voltage drops across the
components equals the input voltage:
𝑉 + 𝑉 + 𝑉 = 𝑉 (𝑡)
Substituting the physical relationships for each component:
Voltage across Resistor: 𝑉 = 𝑅 ⋅ 𝑖(𝑡)
( )
Voltage across Inductor: 𝑉 = 𝐿 ⋅
Voltage across Capacitor: 𝑉 = 𝑣 (𝑡)
The KVL equation becomes:
𝑑𝑖(𝑡)
𝐿 + 𝑅𝑖(𝑡) + 𝑣 (𝑡) = 𝑉 (𝑡)
𝑑𝑡
Defining State Variables
To convert this into a matrix model, we must define "State Variables." These are typically the
variables associated with energy storage elements.
5
Application of Matrix in Control Flow System
Let:
𝑥 = 𝑣 (𝑡) (Voltage across the Capacitor)
𝑥 = 𝑖(𝑡) (Current through the Inductor)
Input 𝑢 = 𝑉 (𝑡)
Now, we write the first-order differential equation for each state variable:
Equation 1 (For Capacitor Voltage):
Since 𝑖(𝑡) = 𝐶 , we can rearrange this as:
𝑑𝑥 1
= 𝑥
𝑑𝑡 𝐶
Equation 2 (For Inductor Current):
Rearranging our KVL equation from earlier (𝐿 = 𝑉 − 𝑅𝑖 − 𝑣 ):
𝑑𝑥 1 𝑅 1
=− 𝑥 − 𝑥 + 𝑢
𝑑𝑡 𝐿 𝐿 𝐿
Matrix Representation (State-Space Model)
We can now combine Equation 1 and Equation 2 into a single matrix equation of the form
𝑥̇ = 𝐴𝑥 + 𝐵𝑢:
1 0
0
ẋ
= 𝐶 𝑥 + 1 𝑢
ẋ 1 𝑅 𝑥
− − 𝐿
𝐿 𝐿
Where:
0
System Matrix (A):
− −
0
Input Matrix (B):
Output Equation:
If our desired output is the voltage across the capacitor (𝑦 = 𝑣 = 𝑥 ), the output equation
𝑦 = 𝐶𝑥 + 𝐷𝑢 becomes:
6
Application of Matrix in Control Flow System
𝑥
𝑦 = [1 0] 𝑥 + [0]𝑢
This matrix representation (A, B, C, D) completely models the electrical circuit and is ready
for computational analysis.
TOOLS AND SOFTWARE USED
To validate our mathematical model, we utilized Python, a high-level programming language
extensively used in scientific computing. Specifically, we employed the following libraries:
1 NumPy: For defining and manipulating the system matrices (A, B, C, D).
2 SciPy (signal module): To simulate the state-space model and compute system
responses (Step Response).
3 Matplotlib: To visualize the output voltage over time.
Software Implementation:
Below is the Python code written to solve the RLC circuit State-Space model derived in the
previous section.
1 import numpy as np
2 from scipy import signal
3 import [Link] as plt
4 # 1. Define System Parameters (Example values)
5 R = 2.0 # Resistance in Ohms
6 L = 1.0 # Inductance in Henrys
7 C = 0.5 # Capacitance in Farads
8 # 2. Define the Matrices (State-Space Model)
9 # Matrix A (System Matrix)
10 A = [Link]([[0, 1/C], [-1/L, -R/L]])
11 # Matrix B (Input Matrix)
12 B = [Link]([[0], [1/L]])
13 # Matrix C (Output Matrix) - Measuring Voltage across Capacitor
14 C_mat = [Link]([1, 0])
15 # Matrix D (Feedforward Matrix)
16 D = [Link]([0])
17 # 3. Create the State-Space System
18 sys = [Link](A, B, C_mat, D)
19 # 4. Simulate Step Response (Unit Step Input)
20 t, y = [Link](sys)
21 # 5. Calculate Eigenvalues to check stability
22 eigenvalues = [Link](A)
23 print(f"System Eigenvalues: {eigenvalues}")
7
Application of Matrix in Control Flow System
FINDINGS AND OBSERVATIONS
Based on the mathematical modeling and the software simulation, we made the following
observations regarding the system's behaviour:
Stability Analysis (Eigenvalues)
The most critical finding from the Matrix approach is the determination of stability through
Eigenvalues.
The system matrix A yields two eigenvalues.
Observation: For our RLC circuit values (R=2, L=1, C=0.5), the calculated
eigenvalues have negative real parts.
Conclusion: According to Control Theory, since all eigenvalues lie in the left half of
the complex plane (negative real part), the system is Asymptotically Stable. This
means any transient disturbance will die out over time, which matches the physical
reality of a passive RLC circuit.
Transient Response
The software simulation (Step Response) generated a graph showing the voltage across
the capacitor over time.
Observation: The system exhibited a "damped" response. The voltage rose from 0V
and eventually settled at 1V (matching the input voltage).
Significance: This confirms that our Matrix State-Space model correctly predicts the
physical behaviour of the circuit (charging of the capacitor) without needing to
manually solve the differential equations.
CONCLUSION & FUTURE SCOPE
Conclusion
This project successfully demonstrated the critical role of Matrix Algebra in the field of
Electrical and Control Systems Engineering. We moved beyond the theoretical definitions of
matrices to show their practical application in modeling dynamic physical systems.
Through the State-Space Analysis of an RLC circuit, we established that:
1. Complex high-order differential equations can be simplified into compact first-order
matrix equations (𝑥̇ = 𝐴𝑥 + 𝐵𝑢).
2. Matrix properties, specifically Eigenvalues, provide a direct mathematical test for
system stability, which is the most important parameter in control engineering.
8
Application of Matrix in Control Flow System
3. Computational tools like Python/MATLAB rely entirely on these matrix structures to
simulate and visualize real-world behaviour.
In conclusion, matrices are not merely a mathematical abstraction but the fundamental
language of modern engineering analysis.
Future Scope
The concepts explored in this project form the foundation for advanced engineering
technologies. Future applications of this study include:
Digital Control Systems: Implementing these matrix algorithms on microcontrollers
(like Arduino or Raspberry Pi) to control robots and drones in real-time.
Artificial Intelligence: Neural Networks, the backbone of AI, are essentially massive
layers of matrix multiplications. Understanding matrix operations is a prerequisite for
Machine Learning.
Power Grid Management: Using large-scale matrices (Jacobian matrices) to analyse
power flow in national electrical grids.
REFERENCES
1. Textbooks:
o Higher Engineering Mathematics by B.S. Grewal (Khanna Publishers).
o Modern Control Engineering by Katsuhiko Ogata (Pearson Education).
o Advanced Engineering Mathematics by Erwin Kreyszig (Wiley).
2. Online Resources:
o NPTEL Course on "Control Engineering" by IIT Madras.
o Python Control Systems Library Documentation (python-
[Link]).
o MATLAB Documentation for State-Space Models (MathWorks).
9
Application of Matrix in Control Flow System
ACKNOWLEDGEMENT
We would like to express our sincere gratitude to our Mathematics Subject Teacher, Dr
Apurba Saha, for providing us with the opportunity to work on this project titled "Application
of Matrix in Control System." His guidance and the course material were instrumental in
understanding the relevance of linear algebra in our engineering stream.
We also thank the Department of Applied Science at Haldia Institute of Technology for
providing the necessary academic environment.
Finally, we appreciate the mutual support and cooperation of our group members, which made
it possible to complete this project within the stipulated deadline.
~ Group 4 Students
10
Application of Matrix in Control Flow System
Haldia Institute of Technology
Haldia, Purba Medinipur-721657 (W.B.)
CERTIFICATE OF COMPLETION
This is to certify that
8) SAYAN SAHA 25/EE/095
9) SAYANTAN BHOWMIK 25/EE/096
10) SAYANTAN MAITI 25/EE/097
11) SHASHANK SINGH 25/EE/098
12) SHASWATIK MOITRA 25/EE/099
13) SHOUVIK DAS 25/EE/100
14) SHREYANSH KUMAR 25/EE/101
Electrical Engineering, Haldia Institute of Technology has successfully completed the mini
project entitled “Application of Matrix in Load Flow Analysis ” under my guidance as a part
of Final Class Assessment.
Date: Signature of Class Teacher
11