PROJECT
TITLE: ANY PROBLEM RELATED TO DAILY LIFE IN MATLAB
INTRODUCTION
As we have to solve a problem on matlab, so I selected a problem related to KIRCHOFFS
VOLTAGE LAW. I used different operations in MATLAB to solve this problem. As in this problem
of KVL we are dealing with 3 loops to find their currents, so solving those loops by KVL we get
three equations at the end. Then solving those equations using MATLAB we get the required
values of current.
PROBLEM
The circuit has five resistors R1 = 5, R2 = 100, R3 = 200, R4= 150, R5 = 250(all of the values are in
KΩ) and two voltages v1 = 100, v2 = 50. The current i1, i1, i3, i4, i5 flows in the circuit. Find their
values.
For loop A
KVL ; v1 + v2 + v3 = 0
-v1 + R1i1 + R4i4 = 0
For loop B
KVL; v3 + v4 + v5 = 0
-R4i4 + R2i2 + R5i5 = 0
For loop C
KVL; v5 + v6 + v2 = 0
-R5i5 + R3i3 + v2 = 0
Conservation of charge is
i1 = i2 + i4 1
i2 = i3 + I5 2
NOW KVL of loop A is
R1i1 + R4i4 = -v1 3
From eq 1 we know that
i4 = i1 -i2
put in eq 3
(R1 + R4)i1 – R4i2 = v1 4
Also put the value of i4 in KVL of loop B
-R4 ( i1 -i2 ) + R2i2 + R5 ( i2 – i3 ) = 0
-R4i1 + r4i2 + R2i2 + R5i2 + R5i3 = 0
-R4i1 + ( R4 + R2 + R5 )i2 – R5i3 = 0 5
Now put I5 = i2 – i3 in KVL of loop C
R5i5 – R3i3 = -v2
R5 ( i2 – i3 ) + R3i3 = v2
R5i2 + R5i3 + R3i3 = v2
R5i2 – ( R3 + R5 )i3 = v2 6
SOLUTION
R = [5,100,200,150,250]*1000;
v1 = 100; v2 = 50;
A1 = [R(1) + R(4), -R(4), 0];
A2 = [-R(4), R(2) + R(4) + R(5), -R(5)];
A3 = [0, R(5), -(R(3) + R(5))];
A = [A1; A2; A3];
b=[v1; 0; v2];
current = A\b;
disp('the currents are:')
the currents are:
>> disp(current)
1.0e-03 *
0.9544
0.3195
0.0664
CONCLUSION