Bode Plot for two different sinusoidal inputs

조회 수: 11 (최근 30일)
Michael
Michael 2024년 4월 2일
I want to create bode plot comparing two different sine inputs with different frequencies (.1 and 7.5), but same transfer function (8.008/s^2+.54s+7.95). Any help would be greatly appreciated.

채택된 답변

Athanasios Paraskevopoulos
Athanasios Paraskevopoulos 2024년 4월 2일
% Define the transfer function coefficients
numerator = 8.008;
denominator = [1 0.54 7.95]; % Coefficients of s^2, s, and the constant term
% Create the transfer function
sys = tf(numerator, denominator);
% Create the Bode plot
figure;
bode(sys);
grid on;
title('Bode plot of the system');
% Evaluate the frequency response at specific frequencies
f1 = 0.1; % frequency in Hz
f2 = 7.5; % frequency in Hz
w1 = 2 * pi * f1; % Convert to rad/s
w2 = 2 * pi * f2; % Convert to rad/s
response1 = evalfr(sys, 1j*w1);
response2 = evalfr(sys, 1j*w2);
% Display the magnitude and phase of the frequency responses
disp(['Frequency response at ' num2str(f1) ' Hz:']);
Frequency response at 0.1 Hz:
disp(['Magnitude: ' num2str(abs(response1)) ', Phase: ' num2str(angle(response1) * 180/pi) ' degrees']);
Magnitude: 1.0589, Phase: -2.5713 degrees
disp(['Frequency response at ' num2str(f2) ' Hz:']);
Frequency response at 7.5 Hz:
disp(['Magnitude: ' num2str(abs(response2)) ', Phase: ' num2str(angle(response2) * 180/pi) ' degrees']);
Magnitude: 0.0036189, Phase: -179.3411 degrees
  댓글 수: 2
Michael
Michael 2024년 4월 2일
이동: Voss 2024년 4월 2일
Thank you Athanasios. Your help is greatly appreciated!
Athanasios Paraskevopoulos
Athanasios Paraskevopoulos 2024년 4월 2일
@Michael You are welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by