summaryrefslogtreecommitdiff
path: root/3773/CH2/EX2.5/Ex2_5.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3773/CH2/EX2.5/Ex2_5.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3773/CH2/EX2.5/Ex2_5.sce')
-rw-r--r--3773/CH2/EX2.5/Ex2_5.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/3773/CH2/EX2.5/Ex2_5.sce b/3773/CH2/EX2.5/Ex2_5.sce
new file mode 100644
index 000000000..d28b6bd8d
--- /dev/null
+++ b/3773/CH2/EX2.5/Ex2_5.sce
@@ -0,0 +1,28 @@
+//Chapter 2: Antenna Basics
+//Example 2-7.1
+clc;
+clear;
+
+//Variable declaration
+n = 10 //Number of isotropic point sources
+dr = %pi/2 //Distance(radians)
+hpbw = 40 //Half power beamwidth (degrees)
+
+//Calculation
+deff('z=f(x,y)','z=(sin(%pi/20)*(sin((%pi/2)*(5*cos(y)-6))/sin((%pi/20)*(5*cos(y)-6))))**2')
+X=[0 0;%pi/2 %pi/2;%pi/2 0];
+Y=[0 0;2*%pi 2*%pi;0 2*%pi];
+[g1,err]=int2d(X,Y,f)
+gain = (4*%pi)/g1 //Gain (unitless)
+gain_db = 10*log10(gain)//Gain (dB)
+gain_hpbw = 40000/(hpbw**2) //Gain from approx. equation (unitless)
+gain_hpbw_db = 10*log10(gain_hpbw) //Gain from approx. equation (dB)
+gain_diff = gain_hpbw_db - gain_db //Difference in gain (dB)
+
+//Result
+mprintf("The Gain G is %.2f dB",gain_db)
+mprintf("\nThe Gain from approx. equation is %.0f dB",gain_hpbw_db)
+mprintf("\nThe Difference is %.2f dB",gain_diff)
+
+//An error arises due to incorrect integration of the normalized power pattern
+//Subsequently, the difference in gain is varying