Frequency domain analysis of linear systems for beginners in matlab

***Frequency domain analysis method is a classic method of applying frequency domain characteristics to study control systems. It is the best way to analyze the system by studying the steady state and dynamic response characteristics of the system to the sinusoidal signal.

#Analysis: As one of the three major methods for analyzing system stability, frequency domain analysis is very important for analyzing linear systems.

#Method: Frequency domain analysis is realized based on Fourier transform and complex variable function. Here we directly introduce matlab related codes and examples. The specific conversion can be obtained from the textbook.

1. Nyquist diagram of frequency curve

***The Nyquist diagram is based on the Nyquist criterion to analyze the system, and the specific criterion can be found in the textbook***

1. Drawing and analysis of Nyquist diagram

  1 The open-loop transfer function of the known system is G(s)=(2s+6)/(s^3+2s^2+5s+2), try to draw the Nyquist diagram, and judge the stability of the
system

 #Analysis: As shown in the code on the right, 1 and 2 are used to define the numerator and denominator of the open-loop transfer function; 3 is to call the tf() function to construct the complete transfer function; 4 is the function command used to draw the nyquist diagram;

 

  #Analysis: As shown in the curve on the left, the number of points (-1,0j) contained in the system curve is 0, and the open-loop transfer function of the system, the position of the denominator root obtained by the roots() function in the figure below, does not have the right side of the imaginary axis poles, all poles - turns = 0, so the system is stable. (Note: The number of circles is a positive sign when rotating counterclockwise, and a negative sign when enclosing clockwise; the number of poles is an open-loop system; it is the number of poles minus the number of circles)

2. The bode diagram of the frequency curve

*** The Bode diagram of the system is also called the logarithmic coordinate diagram of the frequency characteristic of the system. The Bode diagram has two diagrams, which respectively draw
the relationship curves of the amplitude and phase of the open-loop frequency characteristic and the angular frequency, which are called the logarithmic amplitude-frequency characteristic curve and the logarithmic phase-frequency characteristic
curve***

1. Drawing and analysis of bode diagram 

 1) The call of the logspace(a,b,n) function: Create a row vector, the first one is 10^a, and the last one is 10^b, forming a geometric sequence with a total of n elements

 num=[0 0 15 30];      %声明开环系统的分子  1
den=[1 16 100 0];      %声明开环系统的分母  2
w=logspace(-2,3,100);  %设置自变量频率w,从10^-2~10^3,形成自变量个数为100个的等比数列  3
bode(num,den,w)        %bode图绘制  4
grid;                  %绘制表格   5

 

  #Analysis: As shown in the above curve, one is the amplitude-frequency characteristic and the other is the phase-frequency characteristic; the curve of amplitude and phase changing with W.

3. Nichols diagram of frequency curve

***Since drawing the Nichols diagram of the system is cumbersome, it is not easy for novices to learn and master. Here we use the concept of stability margin to analyze the stability of the system ***

1. Stability Margin

  Stability margin is composed of amplitude margin and phase margin. It is an important index to measure the relative stability of the control system. It needs to be obtained through complex calculations. Here we use matlab to solve it. According to the results, we can directly judge whether the system is stable or not. Stablize

2. The system transfer function is G(S)=10/(s^3+3s^2+9s), find the stability margin of the system, and judge the stability of the system according to the logarithmic criterion

num=[10];
den=[1 3 9 0];
g=tf(num,den)
[gm,pm,wcg,wcp]=margin(num,den)  %margin求幅值裕量和相位裕量,幅值裕度对应的频率Wx和相位裕度对应的频率Wc的函数

 

  #Analysis: According to the law of the logarithmic criterion, the phase margin is between 30 degrees and 60 degrees, and the amplitude margin >=2 means that the system is stable; it can be seen that the system is in a stable state .

 

Guess you like

Origin blog.csdn.net/qq_63863334/article/details/127944985