summaryrefslogtreecommitdiff
path: root/671/CH4/EX4.47/4_47.sce
diff options
context:
space:
mode:
Diffstat (limited to '671/CH4/EX4.47/4_47.sce')
-rwxr-xr-x671/CH4/EX4.47/4_47.sce37
1 files changed, 20 insertions, 17 deletions
diff --git a/671/CH4/EX4.47/4_47.sce b/671/CH4/EX4.47/4_47.sce
index b765ddb30..61d56e636 100755
--- a/671/CH4/EX4.47/4_47.sce
+++ b/671/CH4/EX4.47/4_47.sce
@@ -1,18 +1,21 @@
-V=10*%i
-w=1000
-R=2
-L=2E-3
-C=500E-6
-Xl=w*L*%i
-Xc=1/(w*C*%i)
-
-Zeq=Xl+Xc+parallel(R,Xl)
-disp(Zeq)
-
-I=V/Z
-Ir=I*Xl/(R+Xl)
-Il2=I-Ir
-Vl=I*Xl
-Vc=I*Xc
-
+function a = parallel(b,c)
+a = b*c/(b+c)
+endfunction
+V=10*%i
+w=1000
+R=2
+L=2E-3
+C=500E-6
+Xl=w*L*%i
+Xc=1/(w*C*%i)
+
+Zeq=Xl+Xc+parallel(R,Xl)
+disp(Zeq)
+
+I=V/Zeq
+Ir=I*Xl/(R+Xl)
+Il2=I-Ir
+Vl=I*Xl
+Vc=I*Xc
+
disp(I,Ir,Il2,Vl,Vc) \ No newline at end of file