- https://www.mathworks.com/help/control/ref/tf.html
- https://www.mathworks.com/help/control/ref/frd.html
- https://www.mathworks.com/help/ident/ref/idfrd.html
- https://www.mathworks.com/help/ident/ref/tfest.html
How can I get system transfer function from Bode plot data?
138 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Mahesh Chilla
on 25 Jun 2023
Edited: Mahesh Chilla
on 26 Jun 2023
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!!
0 Comments
See Also
Categories
Find more on Uncertainty Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!