blob: 769c71b81b1485c789ce9bf782517c411ba76284 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
//CHAPTER 1- D.C. CIRCUIT ANALYSIS AND NETWORK THEOREMS
//Example 51
disp("CHAPTER 1");
disp("EXAMPLE 51");
//SOLUTION
//(9)I1+(-5)I2+(-3)I3=5..........eq (1)
//(-5)I1+(8)I2+(-1)I3=5..........eq (2)
//(-3)I1+(-1)I2+(6)I3=3..........eq (3)
A=[9 -5 -3;-5 8 -1;-3 -1 6];
b=[5;5;3];
x=inv(A)*b;
I1=x(1,:); //to access the 1st element of 3X1 matrix
I2=x(2,:); //to access the 2nd element of 3X1 matrix
I3=x(3,:); //to access the 3rd element of 3X1 matrix
disp(sprintf("Current i1 is %f A (loop ABGH)",I1));
disp(sprintf("Current i2 is %f A (loop BCDH)",I2));
disp(sprintf("Current i3 is %f A (loop GDEF)",I3));
//END
|