#!/usr/bin/gnuplot # plots the result of an FPI-scan of the LASER as seen on an oscilloscope # created by Michael G. Hansen # released under the GNU GPL # we plot using the frequency, hence nu is a dummy set dummy nu # m(nu) describes the LASER-medium-gain: nu_medium_0 = 30 nu_medium_width = 10 m(nu)=2*exp(-(nu-nu_medium_0)**2/nu_medium_width**2) # r(nu) describes the resonance of the resonator (LASER): nu_resonator_0 = 10 nu_resonator_0 = 6 nu_resonator_width = 1 # shift the resonator a few resonances to the left, so it coincidences with the LASER-medium: nu_resonator_basemult = 5 # we plot 1 peaks in both directions from the center: r(nu) = exp(-((nu-nu_resonator_basemult*nu_resonator_0)/nu_resonator_width)**2) \ +exp(-((nu-(nu_resonator_basemult+1)*nu_resonator_0)/nu_resonator_width)**2) \ +exp(-((nu-(nu_resonator_basemult-1)*nu_resonator_0)/nu_resonator_width)**2) # combined effect: medium and resonator b(nu)=m(nu)*r(nu)/2 # now plot the LASER-spectrum separated by the FSR of the FPI: fpi_fsr = 40 fpi_shift = 20 fpi_result(nu) = b(nu+fpi_shift) + b(nu-fpi_fsr+fpi_shift) + b(nu-2*fpi_fsr+fpi_shift) # configure the plot: set yrange[0:1] set xrange[0:100] set xtics 10 set mxtics 5 # make sure we have enough samples so that the Gaussians display nicely: set samples 1000 set xlabel "Time / A.U." set ylabel "Voltage / A.U." # plot the three functions: set terminal svg set output "fpi_oscilloscope.svg" plot fpi_result(nu) w lines smooth csplines title "" set output