blob: d28b6bd8dfcb34f6fce9b06017c7de0f035b9918 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
|