Page 120 - MATLAB an introduction with applications
P. 120
Electrical Circuits ——— 105
R5=16;
R6=10;
R7=10;
R8=15;
% CREATE THE RESISTANCE MATRIX
R=[–(R1+R2+R3) R2 R3 0;
R2 –(R2+R4+R5+R7) R4 R7;
R3 R4 –(R3+R4+R6)R6;
0 R7 R6 –(R6+R7+R8)];
% GET THE CURRENT VECTOR AS SOLUTION
I=inv(R)*V;
% ALLOT VALUES TO FOUR CURRENTS
i1=I(1)
i2=I(2)
i3=I(3)
i4=I(4)
The output obtained is as follows:
V =
–22
0
12
–44
i 1 =
0.8785
i 2 =
0.7154
i 3 =
0.7138
i 4 =
1.6655
The current in resistor R 2 = i 1 –i 2 = 0.1631 A
The current in resistor R 3 = i 1 –i 3 = 0.1647 A
The current in resistor R 4 = i 2 –i 3 = 0.0016 A
The current in resistor R 6 = i 4 –i 3 = 0.9517 A
The current in resistor R 7 = i 4 –i 2 = 0.9501 A
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09