Trying to plot a frequency response (magnitude and angle) using the equation of a forced vibration
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am meant to take the equation
x(t) = 0.016499i*w*exp(1).^(i*w*t); where w=3, t goes from 0 to 1 with increments of 0.01
and find the magnitude and the angle. My graphs are outputing this and i dont know why. Please help.
clear; clc; clf;
t= 0:0.1:1;
w=3;
xt = 0.016499*i*w*exp(1).^(i*w*t);
M = abs(xt);
Ph = angle(xt);
Ph2 = atan2(imag(xt),real(xt));
subplot(2,1,1)
plot(t,M)
subplot(2,1,2)
plot(t,Ph)
0 Kommentare
Antworten (2)
Paul
am 26 Feb. 2022
According to the problem statement, the time increment should be 0.01
t = 0:0.01:1;
Other than that, the Matlab code implements the equation as written. Note that exp(1).^(..) can be replace with just exp(...)
t= 0:0.01:1;
w=3;
xt = 0.016499*1i*w*exp(i*w*t); % typical way to compute e^(iwt)
M = abs(xt);
Ph = angle(xt);
subplot(2,1,1)
plot(t,M)
subplot(2,1,2)
plot(t,Ph)
0 Kommentare
David Goodmanson
am 26 Feb. 2022
Bearbeitet: David Goodmanson
am 26 Feb. 2022
Hi Bryanna,
The problem statement asks for delta_t of .01, but you have .1 instead. Changing to .01 makes things clearer.
The expresson exp(1).^(i*w*t) is technically correct, but it's preferred to use the shorter version, exp(i*w*t)
The magnitude is indeed a constant, since all the factors of xt are constant when t is varied.
After going to delta_t = .01, it's fairly clear that the phase increases up to 2*pi and then takes an immediate jump down to -2*pi. That's because the output of atan2 is -pi< theta <= pi. The same is true of the angle function, so Ph and Ph2 are identical.
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!