summaryrefslogtreecommitdiff
path: root/3504/CH2/EX2.5/Ex2_5.sce
blob: ddbbfbb304a0f6fd325c3533ef0a933a71ec7ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//To determine the current in each loop of the circuit.
clc;
M=[5.11 -0.71 0 -3.25;-0.71 1.86 -0.92 -0.23;0 -0.92 2.86 -1.12;-3.25 -0.23 -1.12 5.55]
D=det(M)
M_1=[1.5 -0.71 0 -3.25;-1.3 1.86 -0.92 -0.23;-7.1 -0.92 2.86 -1.12;-2.1 -0.23 -1.12 5.55]
D_1=det(M_1)
M_2=[5.11 1.5 0 -3.25;-0.71 -1.3 -0.92 -0.23;0 -7.1 2.86 -1.12;-3.25 -2.1 -1.12 5.55]
D_2=det(M_2)
M_3=[5.11 -0.71 1.5 -3.25;-0.71 1.86 -1.3 -0.23;0 -0.92 -7.1 -1.12;-3.25 -0.23 -2.1 5.55]
D_3=det(M_3)
M_4=[5.11 -0.71 0 1.5;-0.71 1.86 -0.92 -1.3;0 -0.92 2.86 -7.1;-3.25 -0.23 -1.12 -2.1]
D_4=det(M_4)
i_1=D_1/D
i_2=D_2/D
i_3=D_3/D
i_4=D_4/D
//Loop currents in Ampere using Cramer's rule,Negative sign indicates that the current is in the reverse direction.