summaryrefslogtreecommitdiff
path: root/269/CH6/EX6.1/example1.sce
diff options
context:
space:
mode:
Diffstat (limited to '269/CH6/EX6.1/example1.sce')
-rw-r--r--269/CH6/EX6.1/example1.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/269/CH6/EX6.1/example1.sce b/269/CH6/EX6.1/example1.sce
new file mode 100644
index 000000000..0d703cf31
--- /dev/null
+++ b/269/CH6/EX6.1/example1.sce
@@ -0,0 +1,29 @@
+disp('by kvl')
+disp('Ldi/dt+Ri+1/c*integ(i)=V')
+disp('given')
+disp('V=1,R=3,L=1,C=0.5')
+disp('Replacing di/dt with s and (di/dt)^2 with s^2')
+disp('we get')
+disp('s^2+3s+2')
+s=poly(0,'s')
+p=s^2+3*s+2
+r=roots(p)
+disp(r)
+disp('therefore the current in general form is')
+disp('i(t)=k1exp(-t)+k2exp(-2t)')
+//k1 and k2 are constants and are evaluated by knowing inital conditions
+disp('initial conditions are')
+disp('di/dt at 0+ is V/L=1')
+disp('i(t) at 0+ is 0')
+disp('on solving we get k1=1,k2=-1')
+t=0:0.1:2
+i=exp(-t)-exp(-2*t)
+subplot(221)
+xtitle("exp(-t)")
+plot2d(exp(-t))
+subplot(222)
+xtitle("exp(-2t)")
+plot2d(exp(-2*t))
+subplot(223)
+xtitle("i")
+plot2d(i) \ No newline at end of file