summaryrefslogtreecommitdiff
path: root/1529/CH18/EX18.4
diff options
context:
space:
mode:
Diffstat (limited to '1529/CH18/EX18.4')
-rwxr-xr-x1529/CH18/EX18.4/18_04.sce10
1 files changed, 10 insertions, 0 deletions
diff --git a/1529/CH18/EX18.4/18_04.sce b/1529/CH18/EX18.4/18_04.sce
new file mode 100755
index 000000000..424ddb9ce
--- /dev/null
+++ b/1529/CH18/EX18.4/18_04.sce
@@ -0,0 +1,10 @@
+//Chapter 18, Problem 4
+clc;
+t=12e-3; //time constant
+v=10; //supply voltage
+t1=7e-3; //time period of capacitor
+C=0.5e-6; //capacitance
+R=t/C; //calculating resistance
+vc=v*(1-exp(-t1/t)); //calculating capacitor voltage
+printf("(a) Resistor = %d K.ohm\n\n",R/1000);
+printf("(b) Capacitor voltage = %f V",vc);