- 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?
55 次查看(过去 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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1376789/image.png)
0 个评论
回答(1 个)
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!!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classical Control Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!