summaryrefslogtreecommitdiff
path: root/1223/CH2/EX2.8/Ex2_8.sce
diff options
context:
space:
mode:
Diffstat (limited to '1223/CH2/EX2.8/Ex2_8.sce')
-rwxr-xr-x1223/CH2/EX2.8/Ex2_8.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/1223/CH2/EX2.8/Ex2_8.sce b/1223/CH2/EX2.8/Ex2_8.sce
new file mode 100755
index 000000000..2b432da18
--- /dev/null
+++ b/1223/CH2/EX2.8/Ex2_8.sce
@@ -0,0 +1,29 @@
+clear;
+clc;
+//Example 2.8
+R1=5;R2=10;//(KOhm)
+V_Y=0.7;//(V)diode cut in voltage
+V1=5;V2=-5;//(V)
+vt=0;//(V)
+//asssuming initially diode D1 is off
+//iR1=iD2=iR2=V1-V2-V_Y/(R1+R2)
+iD2=(V1-V2-V_Y)/(R1+R2);
+printf('\ndiode current=%0.2f mA\n',iD2)
+iR1=iD2;
+vo=V1-iR1*R1;
+printf('\noutput voltage=%0.2f V\n',vo)
+v=vo-V_Y;//v=v'
+printf('\nVoltage=%0.1f V\n',v)
+vt=4;//(V)fig.2.33
+//both D1 and D2 are on
+vo==vt;
+vo=4;
+iD2=(V1-vo)/R1;
+printf('\ndiode current=%.2f mA\n',iD2)
+iR1==iD2;
+v=vo-V_Y;
+printf('\nV=%.2f V\n',v)
+iR2=(v-V2)/R2;
+printf('\niR2=%.2f mA\n',iR2)
+iD1=iR2-iD2;
+printf('\ncurrent through D1=%.2f mA\n',iD1)