summaryrefslogtreecommitdiff
path: root/147/CH3/EX3.8/Example3_8.sce
blob: a9cdcab7034ecc860fba107eadf68e89c92a9146 (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
//Voltage V, Resistances R1 and R2, Capacitive reactance Xc
close();
clear;
clc;
R1 = 10;//ohm
R2 = 20;
Xc = -11.55*%i;
V = 173.2;//V
//By Nodal analysis
V1 = V/(R1*((1/R1)+(1/R2)+(1/Xc)));
V1r = polar(V1);
V1arg = atan(imag(V1),real(V1))*180/%pi;
V2 = V-V1;
V2r = polar(V2);
V2arg = atan(imag(V2),real(V2))*180/%pi;
I = V2/R1;
Ir = polar(I);
Iarg =atan(imag(I),real(I))*180/%pi;
I1 = V1/R2;
I1r = polar(I1);
I1arg =atan(imag(I1),real(I1))*180/%pi;
I2 = V1/Xc;
I2r = polar(I2);
I2arg =atan(imag(I2),real(I2))*180/%pi;
mprintf('Voltage across R2 and Xc = %0.0f arg(%0.0f degree) V \nVoltage across R1 = %0.0f arg(%0.0f degree) V \nCurrent through R1, I = %0.0f arg(%0.0f degree) A \nCurrent through R2, I1 = %0.0f arg(%0.0f degree) A \nCurrent through capacitor, I2 = %0.2f arg(%0.0f degree) A',V1r,V1arg,V2r,V2arg,Ir,Iarg,I1r,I1arg,I2r,I2arg);