summaryrefslogtreecommitdiff
path: root/671/CH4/EX4.28/4_28.sce
blob: 7faf4c7a3589c7bc498518fc22acd30c8412e07e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function [x,y]=polar_to_cart(r,theta)
    theta=theta/180*%pi
    x=r*cos(theta)
    y=r*sin(theta)
endfunction

I=4
w=500
[Ir,Ic]=polar_to_cart(3,40)
Ix=complex(Ir,Ic)
C=1E-3
L=10E-3
Xl=w*L*%i
Xc=1/(w*C*%i)

Il=I-Ix
Ic=Ix
Vc=Ic*Xc
Vl=Il*Xl
Vx=Vl-Vc
disp(Vx)  //answer wrong in the book