summaryrefslogtreecommitdiff
path: root/3809/CH2/EX2.1
diff options
context:
space:
mode:
Diffstat (limited to '3809/CH2/EX2.1')
-rw-r--r--3809/CH2/EX2.1/EX2_1.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/3809/CH2/EX2.1/EX2_1.sce b/3809/CH2/EX2.1/EX2_1.sce
new file mode 100644
index 000000000..f90640f81
--- /dev/null
+++ b/3809/CH2/EX2.1/EX2_1.sce
@@ -0,0 +1,16 @@
+//Chapter 2, Example 2.1
+clc
+//Initialisation
+t=0.02 //time period in sec, from graph
+v1=7 //position peak voltage, from graph
+v2=7 //negative peak voltage, from graph
+
+//Calculation
+f=1/t //frequency in hertz
+vpp=v1+v2 //peak to peak voltage
+
+//Result
+printf("Period T = %.2f sec\n",t)
+printf("Frequency F = %d Hz\n",f)
+printf("Peak Voltage, Vp = %d V\n",v1)
+printf("Peak to Peak Voltage, Vpp = %d V\n",vpp)