# script to show damped oscillator traces set terminal postscript eps enhanced color font "Times-Italic,24pt" size 15cm,4cm dashlength 2.0 set output 'transients.eps' set multiplot set border 0 #set tics nomirror set xrange [0:18] set yrange [-.7:1.1] unset xtics unset ytics abschi(om)=1/sqrt((om**2-om0**2)**2+2*beta**2*om**2) delta(om)=atan2(beta*om,om0**2-om**2) # first plot: fast frequency set size 0.5,1; set origin 0,0 om0=1; beta=.5; A=500; B=1.5; del2=pi/3; om=8; del=delta(om); chi=abschi(om) om2=sqrt(om0**2-beta**2) # print del, chi yp(t)=A*chi*cos(om*t-del)*chi yc(t)=B*cos(om2*t-del2)*exp(-beta*t) set arrow 1 from 0,-.9 to 0,1.3 filled set arrow 2 from 0,0 to 19,0 filled set arrow 3 from 3.2,.85 to 1.7,.65 filled lc rgb 'red' set label 3 " x_c(t)" at 3.2,.85 set arrow 4 from 2,-.5 to 1,-.2 filled lc rgb '#c000c0' set label 4 " x_p(t)" at 2,-.53 set arrow 5 from 13,.4 to 12,.2 filled lc rgb 'blue' set label 5 " x(t)" at 13,.4 set label 6 "{/Symbol w} {/Times-Roman >} {/Symbol w}_{/Times-Roman 0} {/Times-Roman >} {/Symbol b}" at 10,-.6 set label 1 "t" at 18.5,-.2 plot yc(x) notitle lt 1 lc rgb 'red',\ yp(x) notitle lt 1 lc rgb '#c000c0',\ yc(x)+yp(x) notitle lt 1 lc rgb 'blue' # second plot: fast frequency set size 0.5,1; set origin 0.5,0 om0=6; beta=.5; A=500; B=.5; del2=pi/3; om=1; del=delta(om); chi=abschi(om) om2=sqrt(om0**2-beta**2) set arrow 3 from 3,.35 to 3,.1 filled lc rgb 'red' set label 3 " x_c(t)" at 2.5,.45 set arrow 4 from 3.3,-.7 to 3.3,-.45 filled lc rgb '#c000c0' set label 4 " x_p(t)" at 2,-.8 set arrow 5 from 15,.4 to 14,.2 filled lc rgb 'blue' set label 5 " x(t)" at 15,.4 set label 6 "{/Symbol w}_{/Times-Roman 0} {/Times-Roman >} {/Symbol w} {/Times-Roman >} {/Symbol b}" at 10,-.6 plot yc(x) notitle lt 1 lc rgb 'red',\ yp(x) notitle lt 1 lc rgb '#c000c0',\ yc(x)+yp(x) notitle lt 1 lc rgb 'blue'