summaryrefslogtreecommitdiff
path: root/887/CH6/EX6.2/6_2.sce
blob: ea53cc59a05cb2bcdbc03172cc5ca667f8e4654b (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clc
//ex6.2
//given V_in(t)=3+2*cos(2000*%pi*t)+cos(4000*%pi*t-A), A=70*%pi/180
//the three parts of V_in(t) are V_in_1=3, V_in_2=2*cos(2000*%pi*t),V_in_3=cos(4000*%pi*t-A)

//first component V_1
V_in_1=3;
f_1=0;      //as omega is zero
//equation of straight line of H_magnitude vs f is x+1000*y-4000=0
H_1_max=(4000-f_1)/1000;      //magnitude of H(traansfer function)
//equation of straight line of H_phase angle vs f is 6000*y=%pi*x (phase angle in radians)
H_1_phi=%pi*f_1/6000;      //phase angle of H
H_1=H_1_max*complex(cos(H_1_phi),sin(H_1_phi));
V_out_1=H_1*V_in_1;
V_out_1_R=real(V_out_1);      //real part
V_out_1_I=imag(V_out_1);      //imaginary part
V_out_1_max=sqrt((V_out_1_R^2)+(V_out_1_I^2));      //peak value
V_out_1_phi=atan(V_out_1_I/V_out_1_R);      //phase angle

//second component V_in_2
V_in_2=2*complex(cos(0),sin(0));      //V_in_2 phasor
w=2000*%pi;      //omega
f_2=w/(2*%pi);      //frequency
//equation of straight line of H_magnitude vs f is x+1000*y-4000=0
H_2_max=(4000-f_2)/1000;      //magnitude of H(traansfer function)
//equation of straight line of H_phase angle vs f is 6000*y=%pi*x (phase angle in radians)
H_2_phi=%pi*f_2/6000;      //phase angle of H
H_2=H_2_max*complex(cos(H_2_phi),sin(H_2_phi));
V_out_2=H_2*V_in_2;
V_out_2_R=real(V_out_2);      //real part
V_out_2_I=imag(V_out_2);      //imaginary part
V_out_2_max=sqrt((V_out_2_R^2)+(V_out_2_I^2));      //peak value
V_out_2_phi=atan(V_out_2_I/V_out_2_R);      //phase angle

//third component
A=-70*%pi/180;      //-70 degrees in radians
V_in_3=complex(cos(A),sin(A));      //V_in_3 phasor
w=4000*%pi;      //omega
f_3=w/(2*%pi);      //frequency
//equation of straight line of H_magnitude vs f is x+1000*y-4000=0
H_3_max=(4000-f_3)/1000;      //magnitude of H(traansfer function)
//equation of straight line of H_phase angle vs f is 6000*y=%pi*x (phase angle in radians)
H_3_phi=%pi*f_3/6000;      //phase angle of H
H_3=H_3_max*complex(cos(H_3_phi),sin(H_3_phi));
V_out_3=H_3*V_in_3;
V_out_3_R=real(V_out_3);      //real part
V_out_3_I=imag(V_out_3);      //imaginary part
V_out_3_max=sqrt((V_out_3_R^2)+(V_out_3_I^2));      //peak value
V_out_3_phi=atan(V_out_3_I/V_out_3_R);      //phase angle

disp('Output voltage is Vout1+Vout2+Vout3 where')
disp('')
disp('FOR Vout1:')
disp(V_out_1_max,'peak value in volts')
disp(V_out_1_phi*180/%pi,'phase angle in degrees')
disp(f_1,'with frequency in hertz')
disp('')
disp('FOR Vout2:')
disp(V_out_2_max,'peak value in volts')
disp(V_out_2_phi*180/%pi,'phase angle in degrees')
disp(f_2,'with frequency in hertz')
disp('')
disp('FOR Vout3:')
disp(V_out_3_max,'peak value in volts')
disp(V_out_3_phi*180/%pi,'phase angle in degrees')
disp(f_3,'with frequency in hertz')