summaryrefslogtreecommitdiff
path: root/1430/CH10/EX10.2/exa10_2.sce
blob: d7eeffde144d439bcc7f56e061e880be83b12f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Example 10.2
// Calculations with Complex Frequency
L=1;
R=5;
C=1/10;
omega=4;
V=complex(0,20);// Voltage phasor
s=complex(-2,4);// complex frequency
//from s-domain diagram , figure 10.2(b)
Z=s*L+R/(s*C*R+1); // Terminal impedance
Y=1/Z; // Terminal Admittance
I=Y*V; // Current phasor
I_m=abs(I);
phase_I=atan(imag(I),real(I)); // in radian
t=0:0.1:10
i=I_m*exp(real(s)*t).*cos(omega*t-phase_I)
disp(I,"Current Phasor(Amps)=")
plot(t,i)
xlabel('t')
ylabel('i(t)')
title("Current Waveform")