L17E104 Control Systems Lecture 17 Exercise 104: Bode plot with Matlab

Опубликовано: 03 Октябрь 2020
на канале: bioMechatronics Lab
1,650
9

MECE3350 Control System. Lecture 17, Exercise 104: Bode plots with complex poles.

Lecture here:    • Video  
Lecture notes here: https://www.biomechatronics.ca/teaching/


See the Matlab code posted below.

%Lecture 17, exercise 104
clear all
close all

%define the range of frequencies
w = 10^(-3):10^(-3):10^3;

%calculate the magnitude of the transfer function
Magnitude = 20*log10(30)-20*log10(((30-w.^2).^2+w.^2).^0.5);

%calculate the phase of the transfer function
Phase = 0 - atan2(w,(30-w.^2));
%convert rad to deg
Phase = Phase*180/(2*pi);

%plot phase and magnitude
subplot(3,1,1)
semilogx(w, Magnitude); %or plot(20*log10(x), Magnitude)
xlabel('Frequency [rad/s]');
ylabel('Magnitude [dB]');

subplot(3,1,2)
semilogx(w, Phase); %or plot(20*log10(x), Phase)
xlabel('Phase [deg]');
ylabel('Magnitude [dB]');

%plot Bode using the pre-built function
subplot(3,1,3)
s= tf([1 0],[1]);
G = 30/(s^2+s+30);
bode(G)

%display the maximum value of G(s)
max(Magnitude)


Смотрите видео L17E104 Control Systems Lecture 17 Exercise 104: Bode plot with Matlab онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь bioMechatronics Lab 03 Октябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,650 раз и оно понравилось 9 людям.