9.17.1 Beam parameter tracing
This example illustrates a possible use of the beam_property_detector ‘bp’: the beam radius of the laser beam is plotted as a function of distance to the laser. For this simulation, the interferometer matrix does not need to be solved. ‘bp’ merely returns the results from the beam tracing algorithm of Finesse (Fig. 95, generated here).
import finesse
from finesse.analysis.actions import Xaxis
import matplotlib.pyplot as plt
finesse.init_plotting()
base = finesse.Model()
base.parse(
"""
laser l1 # laser with P=1W at the default frequency
# Initializing the Gaussian beam with beam waist 1mm at 2m away from the laser.
gauss g1 l1.p1.o w0=1m z=-2
modes(maxtem=0) # we need only the u_00 mode
s s1 l1.p1 nothing1.p1 L=1 # a space of 1m length
nothing nothing1 # a nothing element to connect the detector
bp width nothing1.p1.i w # beam property detector to measure the beam width
"""
)
# tuning the length of s1
out = base.run(Xaxis(base.s1.L, 'lin', 0.1, 8, 200))
plt.figure()
plt.plot(out.x1, out['width']*1e3)
plt.xlabel('s1.L [m]')
plt.ylabel('Beam size [mm]')
plt.show()