summaryrefslogtreecommitdiff
path: root/3809/CH9/EX9.1/EX9_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '3809/CH9/EX9.1/EX9_1.sce')
-rw-r--r--3809/CH9/EX9.1/EX9_1.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/3809/CH9/EX9.1/EX9_1.sce b/3809/CH9/EX9.1/EX9_1.sce
new file mode 100644
index 000000000..00ca3cc42
--- /dev/null
+++ b/3809/CH9/EX9.1/EX9_1.sce
@@ -0,0 +1,15 @@
+//Chapter 9, Example 9.1
+
+clc
+//Initialisation'
+C=100*10**3 //capacitance in farad
+R=100*10**-6 //resistance in ohm
+t=25 //time in seconds
+V=20 //voltage
+//Calculation
+T=C*R //time constant in sec
+v=V*(1-exp(-t/T)) //output voltage
+
+//Results
+printf("Output Voltage = %.2f V",v)
+