# set terminal pngcairo background "#ffffff" enhanced font "arial,8" fontscale 1.0 size 610, 480 # set output 'multiplt.1.png' set dummy wnt,y set grid nopolar set grid xtics nomxtics ytics nomytics noztics nomztics \ nox2tics nomx2tics noy2tics nomy2tics nocbtics nomcbtics set grid layerdefault linetype 0 linewidth 1.000, linetype 0 linewidth 1.000 unset key set label 1 "" at 0.14, 17, 0 left norotate back nopoint offset character 0, 0, 0 set samples 250, 250 set size ratio 0 0.5,0.5 set origin 0.5,0 set mxtics 10.000000 set mytics 5.000000 set xtics 0.00000,5,20.0000 norangelimit set ytics -1.00000,0.5,1.00000 norangelimit set title "Second Order System - Unit Impulse Response" set xlabel "Normalized Time (wnt)" set xrange [ 0.00000 : 20.0000 ] noreverse nowriteback set ylabel "Amplitude y(wnt)" set ylabel offset character 1, 0, 0 font "" textcolor lt -1 rotate by -270 set yrange [ -1.00000 : 1.00000 ] noreverse nowriteback mag(w) = -10*log10( (1-w**2)**2 + 4*(zeta*w)**2) tmp(w) = (-180/pi)*atan( 2*zeta*w/(1-w**2) ) tmp1(w)= w<1?tmp(w):(tmp(w)-180) phi(w)=zeta==1?(-2*(180/pi)*atan(w)):tmp1(w) wdwn(zeta)=sqrt(1-zeta**2) shift(zeta) = atan(wdwn(zeta)/zeta) alpha(zeta)=zeta>1?sqrt(zeta**2-1.0):0 tau1(zeta)=1/(zeta-alpha(zeta)) tau2(zeta)=1/(zeta+alpha(zeta)) c1(zeta)=(zeta + alpha(zeta))/(2*alpha(zeta)) c2(zeta)=c1(zeta)-1 y1(wnt)=zeta==1?1 - exp(-wnt)*(wnt + 1):0 y2(wnt)=zeta<1?(1 - (exp(-zeta*wnt)/wdwn(zeta))*sin(wdwn(zeta)*wnt + shift(zeta))):y1(wnt) y(wnt)=exp(-zeta*wnt) * sin(wdwn(zeta)*wnt) / wdwn(zeta) zeta = 2 GPFUN_mag = "mag(w) = -10*log10( (1-w**2)**2 + 4*(zeta*w)**2)" GPFUN_tmp = "tmp(w) = (-180/pi)*atan( 2*zeta*w/(1-w**2) )" GPFUN_tmp1 = "tmp1(w)= w<1?tmp(w):(tmp(w)-180)" GPFUN_phi = "phi(w)=zeta==1?(-2*(180/pi)*atan(w)):tmp1(w)" GPFUN_wdwn = "wdwn(zeta)=sqrt(1-zeta**2)" GPFUN_shift = "shift(zeta) = atan(wdwn(zeta)/zeta)" GPFUN_alpha = "alpha(zeta)=zeta>1?sqrt(zeta**2-1.0):0" GPFUN_tau1 = "tau1(zeta)=1/(zeta-alpha(zeta))" GPFUN_tau2 = "tau2(zeta)=1/(zeta+alpha(zeta))" GPFUN_c1 = "c1(zeta)=(zeta + alpha(zeta))/(2*alpha(zeta))" GPFUN_c2 = "c2(zeta)=c1(zeta)-1" GPFUN_y1 = "y1(wnt)=zeta==1?1 - exp(-wnt)*(wnt + 1):0" GPFUN_y2 = "y2(wnt)=zeta<1?(1 - (exp(-zeta*wnt)/wdwn(zeta))*sin(wdwn(zeta)*wnt + shift(zeta))):y1(wnt)" GPFUN_y = "y(wnt)=exp(-zeta*wnt) * sin(wdwn(zeta)*wnt) / wdwn(zeta)" plot zeta=.1,y(wnt), zeta=.2,y(wnt), zeta=.3,y(wnt), zeta=.4,y(wnt), zeta=.5,y(wnt), zeta=.707,y(wnt), zeta=1,y(wnt), zeta=2,y(wnt)