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

138 ビュー (過去 30 日間)
Serdar IPEK
Serdar IPEK 2023 年 5 月 7 日
編集済み: Mahesh Chilla 2023 年 6 月 26 日
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 Center および File ExchangeUncertainty Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by