blob: 85c55d552c1a29f47cf8274ca1e61f90d5df0c50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
//Chapter 2: Antenna Basics
//Example 2-7.2
clc;
clear;
//Variable Initialization
theta_hp = 90
phi_hp = 90
//Calculation
X=[0 0;%pi %pi;%pi 0];
Y=[0 0;0 %pi;%pi %pi];
function z = f(x,y), z=sin(x)*sin(x)*sin(x)*sin(y)*sin(y),endfunction
[I,err]=int2d(X,Y,f) //Exact Directivity(No unit)
direct_e=4*%pi/I //Exact Directivity(Unitless)
direct_apprx=41253.0/(theta_hp * phi_hp) //Approximate Directivity(Unitless)
db_diff=10*log10(direct_e/direct_apprx) //Difference(dB)
//Result
mprintf("The exact directivity is %.1f",direct_e)
mprintf("\nThe approximate directivity is %.1f",direct_apprx)
mprintf("\nThe decibel difference is %.1f dB",db_diff)
|