Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

(McGraw-Hill) (Instructors Manual) Electric Machinery Fundamentals 4th Edition Episode 1 Part 6 pps
Nội dung xem thử
Mô tả chi tiết
95
% 10 V.
for ii = 1:length(t)
vin(ii) = 10 * sin(2*pi*50*t(ii));
end
% Now calculate vout
for ii = 1:length(t)
[vout(ii) vu(ii) vv(ii)] = vout(vin(ii), vx(ii), vy(ii));
end
% Plot the reference voltages vs time
figure(1)
plot(t,vx,'b','Linewidth',1.0);
hold on;
plot(t,vy,'k--','Linewidth',1.0);
title('\bfReference Voltages for fr = 500 Hz');
xlabel('\bfTime (s)');
ylabel('\bfVoltage (V)');
legend('vx','vy');
axis( [0 1/30 -10 10]);
hold off;
% Plot the input voltage vs time
figure(2)
plot(t,vin,'b','Linewidth',1.0);
title('\bfInput Voltage');
xlabel('\bfTime (s)');
ylabel('\bfVoltage (V)');
axis( [0 1/30 -10 10]);
% Plot the output voltages versus time
figure(3)
plot(t,vout,'b','Linewidth',1.0);
title('\bfOutput Voltage for fr = 500 Hz');
xlabel('\bfTime (s)');
ylabel('\bfVoltage (V)');
axis( [0 1/30 -120 120]);
% Now calculate the spectrum of the output voltage
spec = fft(vout);
% Calculate sampling frequency labels
len = length(t);
df = fs / len;
fstep = zeros(size(t));
for ii = 2:len/2
fstep(ii) = df * (ii-1);
fstep(len-ii+2) = -fstep(ii);
end
% Plot the spectrum
figure(4);
plot(fftshift(fstep),fftshift(abs(spec)));
title('\bfSpectrum of Output Voltage for fr = 500 Hz');
xlabel('\bfFrequency (Hz)');
ylabel('\bfAmplitude');
96
% Plot a closeup of the near spectrum
% (positive side only)
figure(5);
plot(fftshift(fstep),fftshift(abs(spec)));
title('\bfSpectrum of Output Voltage for fr = 500 Hz');
xlabel('\bfFrequency (Hz)');
ylabel('\bfAmplitude');
set(gca,'Xlim',[0 1000]);
When this program is executed, the input, reference, and output voltages are: