summaryrefslogtreecommitdiff
path: root/343/CH1/EX1.30/ex_30.sce
blob: 88e1fefc10ef2fd454a14089af209f65b47b5437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
R1=2;                     //Assigning values to parameters
R2=3;
R3=4;
R4=5;
R5=1;
A=[3,-3;9,12]           //Matrix of I1,I2 by KVL equations
B=[2;4]
[I]=inv(A)*B           // I matrix has I1 and I2 values
disp("Amperes",[I],"Current in 1 Ohm resistor:Row 1 and Column 1, Current in 3 Ohm resistor:Row 2,Column 1");
IR1=1-I(1,1);
IR3=1-I(1,1)-I(2,1);
IR4=I(1,1)+I(2,1)
disp("Amperes",IR1,"Current in 2 Ohm resistor");
disp("Amperes",IR3,"Current in 4 Ohm resistor");
disp("Amperes",IR4,"Current in 5 Ohm resistor");