summaryrefslogtreecommitdiff
path: root/269/CH4/EX4.2/ex2.sce
diff options
context:
space:
mode:
Diffstat (limited to '269/CH4/EX4.2/ex2.sce')
-rw-r--r--269/CH4/EX4.2/ex2.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/269/CH4/EX4.2/ex2.sce b/269/CH4/EX4.2/ex2.sce
new file mode 100644
index 000000000..bdd1ade4b
--- /dev/null
+++ b/269/CH4/EX4.2/ex2.sce
@@ -0,0 +1,16 @@
+disp("chap 4")
+disp("ex 2")
+disp("the current equations obtained by solving diff eqn are")
+disp("i1=v/r1(1-r2/(r1+r2))e^(-r1t/L)")
+disp("i2=v/(r1+r2)(1+r2/r1e^(-(r1+r2)t/L))")
+v=5//assumed supply=5v
+r1=10//assumed r1=10ohms
+r2=50
+L=500//inductance=500 henry
+t=0:0.1:500
+i1=v/r1*(1-(r2/r1+r2*exp(-r1*t/L)))
+subplot(221)
+plot(i1)
+i2=v/(r1+r2)*(1+r2/r1*exp(-(r1+r2)*t/L))
+subplot(222)
+plot(i2) \ No newline at end of file