Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

MA203: Numerical Methods

Assignment 3, 30 August 2023

Akshat Barnwal - 22110022

PROBLEM 3

Using Kirchhoff’s voltage law to derive a set of equations for calculating currents for the circuit
shown below. Solve the resulting system of equations numerically.

UNDERSTANDING THE PROBLEM:

The problem is fairly straightforward, wherein we are asked to calculate the currents in different
branches of an electric circuit.

The first step would be to apply Kirchoff’s loop/voltage law in the different loops of the circuit
and get equations for the currents i1, i2 and i3.
Then, we can solve the obtained system of linear equations by either Gaussian elimination or
Gauss Jordan.

WHAT IS KNOWN:

The following values are known to us:


(1) the values of resistances as shown in the figure,
(2) the voltage source of 20V

TO CALCULATE:

The currents i1, i2 and i3 in the branches of the circuit as shown in the figure.

UNDERSTANDING GAUSSIAN ELIMINATION:

Gaussian Elimination is one of the simplest methods to solve a given system of linear equations

(when they are represented as a system of matrices 𝐴𝑥 = 𝐵). It involves making the coefficient

matrix A into an upper-triangular matrix and then use back substitution to get values of x.
MATLAB CODE:

(1) Function to implement Gaussian Elimination:


(2) Declaring the matrices that were obtained by solving the equations, calling the

function and displaying results:

HANDWRITTEN SOLUTION
RESULTS:

The values of currents i1, i2 and i3 are as follows:


i1 = 3.745455 A
i2 = 1.381818 A
i3 = 1.236364 A

CONCLUSION AND DISCUSSION:

The Gauss Elimination is a powerful tool to solve systems of linear equations. However,
computationally, it is not the most efficient as it involves a total of three ‘for’ loops and has a
time complexity of the order O(n3).
Nonetheless, its simplicity makes it a widely studied method.

You might also like