How can I get system transfer function from Bode plot data?

44 次查看(过去 30 天)
Bode plot of a system is depicted in the picture.
a) How can I find the system transfer function?
b) How can I plot step response of the system?

回答(1 个)

Mahesh Chilla
Mahesh Chilla 2023-6-25
编辑:Mahesh Chilla 2023-6-26
Hi Serdar!
To get system transfer function and plot of step response of this system using bode plot data, You need to extract magnitude, phase and frequeny from bode plot data and calculate the frequency response of the system using magnitude and phase (note: convert the phase from degrees to radians). To estimate the transfer function using tfest you would need frd and idfrd functions. In case of an unstable system, set tfestoptions Focus property to "prediction".
The following code will estimate a transfer function based on bode plot data.
tf1 = tf([1 0], [1 2 1]); % Create a transfer function tf1
[magnitude, phase, frequency] = bode(tf1);
% Using squeeze function to remove dimensions of length 1
gain = squeeze(magnitude);
ph = squeeze(phase);
w = squeeze(frequency);
response = gain .* exp(1i * ph * pi / 180); % To calculate frequency response
sys = frd(response, w);% To create a frequency response data (FRD) model sys using the complex response and frequency values
gfr = idfrd(sys); % To create an identified FRD model gfr based on the FRD model sys
Options = tfestOptions; % Set up options for system identification
tf2 = tfest(gfr, 2, 1, Options); % Estimate a transfer function model tf2 from gf
step(tf2); % Plot the step response of tf2
To learn more about the functions used in the code, refer the MATLAB's documentation.
Hope this helps,
Thank you!!

类别

Help CenterFile Exchange 中查找有关 Classical Control Design 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by