-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTarea1_antenas.m
145 lines (125 loc) · 3.42 KB
/
Tarea1_antenas.m
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
clear all;
clc;
%--------- Linea Tx sin perdias zo = 50 ohms y zl = 40 + 20j ohms ---------
%|v(s)|, |I(s)|, |Z(s)|
vo = 1;
zo = 50;
zl = 40 + 20*j;
bs = 0:0.01:3*pi;
ro = (zl-zo)./(zl+zo);
vs = vo.*( exp(1*j.*bs) + ro.*exp(-1*j.*bs) );
is = (vo/zo).*( exp(1*j.*bs) - ro.*exp(-1*j.*bs) );
zs = vs./is;
% zs = zo.*( (1 + ro.*exp(-2*j.*bs))./(1 - ro.*exp(-2*j.*bs)) ) ;
figure(1)
subplot(3,1,1);
plot(bs,abs(vs));
title('|V(s)|, Linea Tx sin pérdidas zo = 50 ohms, zl = 40 + 20i ohms ' );
xlabel('s');
ylabel('|V(s)|');
grid on;
subplot(3,1,2);
plot(bs,abs(is));
title('|I(s)|, Linea Tx sin pérdidas zo = 50 ohms, zl = 40 + 20i ohms ');
xlabel('s');
ylabel('|I(s)|');
grid on;
subplot(3,1,3);
plot(bs,abs(zs));
title('|Z(s)|, Linea Tx sin pérdidas zo = 50 ohms, zl = 40 + 20i ohms ');
xlabel('s');
ylabel('|Z(s)|')
grid on
%------------- Linea Tx sin perdias zo = 50 ohm y zl = 0 ro= -1-----------
%|v(s)|, |I(s)|, |Z(s)|
vo = 1;
zo = 50;
zl = 0;
bs = 0:0.01:3*pi;
ro = -1;
vs = vo.*( exp(1*j.*bs) + ro.*exp(-1*j.*bs) );
is = (vo/zo).*( exp(1*j.*bs) - ro.*exp(-1*j.*bs) );
zs = vs./is;
figure(2)
subplot(3,1,1);
plot(bs,abs(vs));
title('|V(s)|, Linea Tx sin perdias zo = 50 qohm y zl = 0 ro= -1 corto circuito(c.c)' );
xlabel('s');
ylabel('|V(s)|');
grid on;
subplot(3,1,2);
plot(bs,abs(is));
title('|I(s)|, Linea Tx sin perdias zo = 50 ohm y zl = 0 ro= -1 corto circuito(c.c) ');
xlabel('s');
ylabel('|I(s)|');
grid on;
subplot(3,1,3);
plot(bs,abs(zs));
title('|Z(s)|, Linea Tx sin perdias zo = 50 ohm y zl = 0 ro= -1 corto circuito(c.c) ');
xlabel('s');
ylabel('|Z(s)|');
grid on;
%------------- Linea Tx sin perdias zo = 50 ohm y zl = inf ro= 1-----------
%|v(s)|, |I(s)|, |Z(s)|
vo = 1;
zo = 50;
% zl = inf;
bs = 0:0.01:3*pi;
ro = 1;
vs = vo.*( exp(1*j.*bs) + ro.*exp(-1*j.*bs) );
is = (vo/zo).*( exp(1*j.*bs) - ro.*exp(-1*j.*bs) );
zs = vs./is;
figure(3)
subplot(3,1,1);
plot(bs,abs(vs));
title('|V(s)|, Linea Tx sin perdias zo = 50 ohm y zl = inf ro= 1 circuito abierto(c.a) ' );
xlabel('s');
ylabel('|V(s)|');
grid on;
subplot(3,1,2);
plot(bs,abs(is));
title('|I(s)|, Linea Tx sin perdias zo = 50 ohm y zl = inf ro= 1 circuito abierto(c.a) ');
xlabel('s');
ylabel('|I(s)|');
grid on;
subplot(3,1,3);
plot(bs,abs(zs));
title('|Z(s)|, Linea Tx sin perdias zo = 50 ohm y zl = inf ro= 1 circuito abierto(c.a) ');
xlabel('s');
ylabel('|Z(s)|');
grid on;
%------------Linea Tx con perdias zo = 50 ohm y zl = 40+20j -----------
%|v(s)|, |I(s)|, |Z(s)|
vo = 1;
zo = 50;
zl = 40 + 20*j;
b = 3*pi;
bs = 0:0.01:3*pi;
ro = (zl-zo)./(zl+zo);
% dbs = 6; %Atenuación
% alfa = (dbs*1)/8.68; %Convertir a neper
alfa = 0.6912;
gamma = alfa+(1*j*b);
vs = vo.*( exp(gamma.*bs) + ro.*exp(-gamma.*bs) );
is = (vo/zo).*( exp(gamma.*bs) - ro.*exp(-gamma.*bs) );
%zs = zo.*( (1+(ro.*exp(-2.*gamma.*bs)))./(1-(ro.*exp(-2.*gamma.*bs))) );
zs = vs./is;
figure(4)
subplot(3,1,1);
plot(bs,abs(vs));
title('|V(s)|, Linea Tx sin pérdidas zo = 50 ohms, zl = 40 + 20i ohms, Atenuacion 6db ' );
xlabel('s');
ylabel('|V(s)|');
grid on;
subplot(3,1,2);
plot(bs,abs(is));
title('|I(s)|, Linea Tx sin pérdidas zo = 50 ohms, zl = 40 + 20i ohms, Atenuacion 6db ');
xlabel('s');
ylabel('|I(s)|');
grid on;
subplot(3,1,3);
plot(bs,abs(zs));
title('|Z(s)|, Linea Tx sin pérdidas zo = 50 ohms, zl = 40 + 20i ohms, Atenuacion 6db ');
xlabel('s');
ylabel('|Z(s)|');
grid on;