summaryrefslogtreecommitdiff
path: root/1109/CH6/EX6.21/6_21.sce
blob: 56258948c0bb8ca5d186b4aa184f1285694db9a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
clear;
clc;
Ymin=18*(10^-2);S=2.5;dmin=20*(10^-2);l=52*(10^-2);Zo=300;
//dmin=distance betweeen adjacent voltage minimas
ampK=round(((S-1)/(S+1))*100)/100;
ZR=fix(Zo*(1+ampK)/(1-ampK));
printf("Input impedance = %f ohms\n",ZR);
lo=2*dmin; //lo=wavelength
b=(2*%pi)/lo;
phi=(2*b*Ymin)-%pi;
theta=-fix((phi-(2*b*l)));
Zm=Zo*(round((1+(ampK*exp(%i*theta)))*100)/100)/(round((1-(ampK*exp(%i*theta)))*100)/100);
printf("Load impedance = %f + j(%f) ohms",round(real(Zm*100))/100,round(imag(Zm*100))/100);
//the difference in result  is due to erroneous value in textbook.
disp("The difference in result is due to erroneous value in textbook")