- 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?
49 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Mahesh Chilla
am 25 Jun. 2023
Bearbeitet: Mahesh Chilla
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Uncertainty Analysis 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!