-
Notifications
You must be signed in to change notification settings - Fork 1
/
question05.m
67 lines (56 loc) · 1.25 KB
/
question05.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
clear all
close all
f = 0:0.001:10;
parameters = load('question01parameters.mat');
%% Modeling Different Locations on Tube 2
l2tests = [38,25.33,12.67,0];
Zin2Real = cell(length(l2tests),1);
Zin2Imag = cell(length(l2tests),1);
for k = 1:length(l2tests);
parameters.l2 = l2tests(k);
[Zin2Real{k},Zin2Imag{k}] = ZvsFtube2(f,parameters);
end
figure
subplot(2,1,1)
ylim([1 600])
hold on
for k = 1:length(l2tests);
plot(f,Zin2Real{k})
end
title('Modulus vs. Frequency')
xlabel('Frequency (Hz)')
ylabel('Modulus')
legend('Point A','Point B','Point C','Point D')
subplot(2,1,2)
ylim([-2 2])
hold on
for k = 1:length(l2tests);
plot(f,-Zin2Imag{k})
end
plot(f,zeros([1,length(f)]),'k--')
title('Phase vs. Frequency')
xlabel('Frequency (Hz)')
ylabel('Phase (-radians)')
legend('Point A','Point B','Point C','Point D')
%% Modeling the Terminal Impedance
%
% scaleFactor = 0.1;
% omega = angFreq(f);
%
% j = sqrt(-1);
%
% Zt = parameters.Rc2 + j*omega*parameters.L + (parameters.R./(1 + j*omega*parameters.R*parameters.C2));
%
% for i = 1:length(Zt);
% ZtReal(i) = abs(Zt(i))*scaleFactor;
% ZtImag(i) = angle(Zt(i));
% end
%
% figure
% hold on
% subplot(2,1,1)
% ylim([1 600])
% plot(f,ZtReal)
% subplot(2,1,2)
% ylim([-2 2])
% plot(f,-ZtImag)