Sunday 17 September 2017

MATLAB Program for Response of a 2nd order system


Program:
% transfar function & response of a 2nd order system
% zeta is tha damping factor
% wn is natural frequency
zeta=input('enter zeta ');
wn=input('enter wn in rad/sec ');
num=[wn^2];
den=[1 2*zeta*wn wn^2];
G=tf(num,den)                  %% get transfar function
subplot(2,2,1),step(G)      %% step response response of system
subplot(2,2,2),impulse(G)  %% impulse response of system
subplot(2,2,3),bode(G)     %% bode plot of system
subplot(2,2,4),nyquist(G)  %% nyquist plot of system

Output:

No comments:

Post a Comment