code

zeta=[0.05; 0.1; 0.15; 0.25; 0.5; 1.25; 1.5]; % damping factors

r = [ 0:0.01:3]; % frequency ratio

for k=1: length(zeta)

A.r(k,:)=sqrt((1+(2*zeta(k)*r).^2)./((1-r.^2).^2+(2*zeta(k)*r).^2));

end

plot(r, A.r)

xlabel ('by Nirmala Tiwari - \omega/\omega_n')

ylabel ('Amplitude Ratio - |X/Y|')

grid

legend ('\zeta_1=0.05','\zeta_2=0.1','\zeta_3=0.15','\zeta_4=0.25','\zeta_5=0.5','\zeta_6=1.25','\zeta_7=1.5',)