summaryrefslogtreecommitdiff
path: root/608/CH25/EX25.04/25_04.sce
blob: 03af96e1df5481ffabb79f5a4f4df97932ba7d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Problem 25.04: Determine the values of currents I, I1 and I2 shown in the network of Figure 25.5.

//initializing the variables:
R1 = 8; // in ohm
R = 5; // in ohm
R2 = 6; // ohm
rv = 50; // in volts
thetav = 0; // in degrees

//calculation:
//voltage,V
V = rv*cos(thetav*%pi/180) + %i*rv*sin(thetav*%pi/180)
//circuit impedance, ZT
ZT = R + (R1*%i*R2/(R1 + %i*R2))
//Current I
I = V/ZT
//current,I1
I1 = I*(%i*R2/(R1 + %i*R2))
//current, I2
I2 = I*(R1/(R1 + %i*R2))

printf("\n\n Result \n\n")
printf("\n current, I is (%.2f + (%.2f)i) A,current,I1 is (%.2f + (%.2f)i) A, current, I2 is (%.2f + (%.2f)i) A ",real(I), imag(I),real(I1), imag(I1),real(I2), imag(I2))