summaryrefslogtreecommitdiff
path: root/3754/CH12/EX12.9/12_9.sce
diff options
context:
space:
mode:
Diffstat (limited to '3754/CH12/EX12.9/12_9.sce')
-rw-r--r--3754/CH12/EX12.9/12_9.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/3754/CH12/EX12.9/12_9.sce b/3754/CH12/EX12.9/12_9.sce
new file mode 100644
index 000000000..77fab8003
--- /dev/null
+++ b/3754/CH12/EX12.9/12_9.sce
@@ -0,0 +1,16 @@
+clear//
+
+//Variables
+
+R = 330 //Resistance (in ohm)
+VS = 5 //Source voltage (in volts)
+
+//Calculation
+
+VD = VS //Voltage drop across diode (in volts)
+VR = 0 //Voltage drop across the resistance (in volts)
+I = 0 //Current through circuit
+
+//Result
+
+printf("\n Voltage drop across the diode is %0.3f V.\nVoltage drop across the resistance is %0.3f V.\nCurrent through the circuit is %0.3f A.",VD,VR,I)