summaryrefslogtreecommitdiff
path: root/215/CH13/EX13.2/ex13_2.sce
blob: ef2b56b7de3b76804e70d1024614bc7714cab2be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
clc
//Example 13.2
disp('Given')
disp('Input voltage is 10V')
Viamp=10
//From figure 13.7
//Writing the left mesh equations
disp('(1+10i)*I1-90i*I2=10')
//Writing the right mesh equations 
disp('(400+1000i)*I2-90i*I1=0')
i=%i
A=[1+10*i -90*i;-90*i 400+1000*i]
i2mat=[1+10*i 10; -90*i 0] 
//Find i2 
i2=det(i2mat)/det(A)
[mag Theta]=polar(i2)
Theta=(Theta*180)/%pi
//The value of resistor is 400 ohm
R=400;
//Let V=V2/V1
Vamp=R*mag/Viamp
printf("Ratio of output voltage to input is %3.2f with angle %3.2f degrees",Vamp,Theta);