Plotting Frequency Characteristics of a Second-Order System with Different Damping Ratios Using MATLAB

First, write out the fractional expression of the second-order system, determine the frequency range to be plotted, and then use the bode function to plot the frequency characteristic curves of the system for different damping values. % Plotting frequency characteristics for different damping ratios wn1=10; zeta1=0.2:0.1:1.2; w1=logspace(-1,2,100); num1=wn1*wn1; figure(1); for k1=zeta1 den1=[1.0 2*k1*wn1 wn1*wn1 ]; … Read more

Calculating Performance Metrics of Second-Order Systems Using MATLAB

Calculating Performance Metrics of Second-Order Systems Using MATLAB

Input the transfer function of a second-order system to output the system’s rise time, peak time, maximum overshoot, and settling time. % Transfer function coefficients num1=[0 0 16]; den1=[1 5 16]; timeStep1=0.001; t1=0:timeStep1:10; [y1,x1,t1]=step(num1,den1,t1); i1=1; while y1(i1)<1.0001 i1=i1+1;end % Rise time riseTime=(i1-1)*timeStep1; [yMax1,tPeak1]=max(y1); % Peak time timePeak1=(tPeak1-1)*timeStep1; % Maximum overshoot overShoot1=yMax1-1; Len1=length(t1); k1=Len1; while y1(k1)>0.98 … Read more