8.17.2 Cavity power and slope
Figure 74 (generated here, same as Fig. 65) shows a plot of the analytical functions describing the power inside a cavity and its differentiation by the cavity tuning. This example recreates the plot using a numerical model in Finesse.
import finesse
from finesse.analysis.actions import Xaxis
import numpy as np
import matplotlib.pyplot as plt
finesse.init_plotting()
base = finesse.Model()
base.parse(
"""
l l1 P=1 # laser with P=1W at the default frequency
s s1 l1.p1 m1.p1 L=1 # space of 1m length connecting laser to input mirror
m m1 R=0.9 T=0.1 # cavity input mirror
s scav m1.p2 m2.p1 L=1200 # cavity length of 1200m
m m2 R=1 T=0 # cavity output mirror
pd pd1 m2.p1.i # photo diode measuring the intra-cavity power
"""
)
out = base.run(Xaxis(base.m2.phi, 'lin', -50, 250, 1000))
fig, ax = plt.subplots(2, 1, sharex=True)
ax[0].semilogy(out.x1, out['pd1'])
ax[0].set_ylim(1e-2, 1e2)
ax[0].set_ylabel(r'$P$ [W]')
ax[1].plot(out.x1, np.gradient(out['pd1'], out.x1))
ax[1].set_ylim(-20, 20)
ax[1].set_xlabel('phi (m2) [deg]')
ax[1].set_ylabel(r'$\mathrm{d}P/\mathrm{d}\phi$ [W/deg]')
plt.show()