## ph237 Caltech 2018
### Gravitational Radiation
#### Assignment #1


```python
# standard preamble for ph237 notebooks
%matplotlib notebook
from __future__ import division, print_function
import numpy as np

#from mpl_toolkits.mplot3d import Axes3D

import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import cm
plt.style.use('seaborn-paper')
#plt.style.use('fivethirtyeight')

import scipy.constants as const
from astropy.constants import M_sun

mpl.rcParams.update({'text.usetex': False,
                     'lines.linewidth': 2.5,
                     'font.size': 18,
                     'xtick.labelsize': 'medium',
                     'ytick.labelsize': 'medium',
                     'axes.labelsize': 'small',
                     'axes.grid': True,
                     'grid.alpha': 0.73,
                     'lines.markersize': 12,
                     'legend.borderpad': 0.2,
                     'legend.fancybox': True,
                     'legend.fontsize': 13,
                     'legend.framealpha': 0.7,
                     'legend.handletextpad': 0.1,
                     'legend.labelspacing': 0.2,
                     'legend.loc': 'best',
                     'savefig.dpi': 100,
                     'figure.figsize': (9,6),
                     'pdf.compression': 9})
```

## Problem 1: Fabry-Perot Cavity

**There exists a Fabry-Perot cavity with a length of 4000\,m. The power transmission, $T_I$, of the input mirror is 1% and the transmission of the end mirror, $T_E$, is 10 ppm. The cavity is illuminated from the input side with a 100 W laser having a wavelength of 437 nm.**

### Part (a)

** Using the steady state fields approach, solve for the transmitted power as a function of cavity length.**

The Fabry-Perot Cavity is schematically drawn below



To use the steady state fields approach, we make the ansatz that the field is a superposition of a left-going wave and a right going wave to the left of the cavity (with amplitudes $E_{\rm in}$ and $E_{\rm R}$ in the figure), a superposition of a left-going wave and a right going wave inside the cavity  (with amplitudes $E_{1}$ and $E_{2}$ in the figure) and a right-going wave to the right of the cavity ( (with amplitude $E_{\rm T}$).

To use the steady state field approach we have to make sure the ansatz is consistent with the reflectivity and transmissivity at each mirror. This means we solve the system of equations (for $E_1$, $E_2$, $E_{\rm R}$ and $E_{\rm T}$ as a function of L , $\omega$, and $E_{\rm In}$)
\begin{align}
E_{\rm R}&=-r_I E_{\rm In} \\
E_1&=t_I E_{\rm In}-r_I E_2 \\
E_2& =-r_E e^{-2i\phi}E_1 \\
E_{\rm T}&=t_E e^{-i\phi}E_1,
\end{align}
where the phase $\phi =\omega_0L/c$ and the lower case $t$ and $r$ are the amplitude transmissivity and reflectivity (which are the square roots of the energy transmissivity and reflectivity). 
This solution for the transmitted field is 
\begin{align}
E_{\rm T}=\frac{t_Et_I e^{-i\phi}}{1-r_Ir_E e^{-2i\phi}}E_{\rm In}
\end{align}

The power is proportional to the field modulus squared $P\propto |E|^2$; Hence the transmitted power is
\begin{align}
P_T&=\left |\frac{t_Et_I e^{-i\phi}}{1-r_Ir_E e^{-2i\phi}} \right |^2P_{\rm In} \nonumber \\
&=\frac{T_ET_I}{1+R_IR_E-2r_Ir_E\cos(2\phi)}
,
\end{align}
where $P_{\rm In}$ is the laser power,

### Part b

Draw a diagram of the cavity, label each of the nodes, and write down the Adjacency Matrix, $A$, for the Fabry-Perot cavity. Solve for the System Matrix, $G$ using Mathematica or Python or otherwise, and show how one of the elements of $G$ can be used to find the solution in part a)

We translate the optical system into a directed graph



and then write down the adjacency matrix, defined as

$A_{ij}=\text{value of connection connecting node j to node i}$

as well as the system matrix $G=(1-A)^{-1}$


```python
# Define adjacency matrix for FP
def A(w):
    M = np.zeros([7,7],complex)
    prop = np.exp(-1j*ph(w))
    M[1,0] =  tI
    M[1,5] = -rI
    M[2,1] =  prop
    M[3,2] =  tE
    M[4,2] = -rE
    M[5,4] =  prop
    M[6,0] =  rI
    M[6,5] =  tI
    return M

# function that calculates system matrix G = (1-A)^(-1) for FP
def G(w):
    return np.linalg.inv(np.identity(7,complex) - A(w))

```

Recall that the vector of fields $\vec E =(E_0, \dots, E_6)^T$ obeys
\begin{align}
\vec E =A \vec E +\vec E_{\rm Inj},
\end{align}
where  the vector of injected fields is (in this case) $\vec E_{\rm Inj}=(E_{\rm In},\dots)^T$. This means that we can use the system matrix $G=(1-A)^{-1}$ to find the field at any of the node locations via
\begin{align}
\vec E =G \vec E_{\rm Inj} .
\end{align}
Performing the matrix multiplication, we see that
\begin{align}
E_i=G_{i0}E_{\rm In}.
\end{align}


# Problem 2: Frequency Respons

**In this problem we will compute the frequency response of a LIGO-like interferometer to gravitational waves. Assume that the results from above still hold.**

## Part (a)

**Assume that we now drive the end mirror with a sinusoidal modulation having an amplitude of $x_0$ and a frequency, $\omega$. Write down an expression for the fields reflected from the mirror, utilizing the Jacobi-Anger expansion.**

As is shown below,



suppose the central location of the mirror is $x=L$ and it is driven so that is position becomes $x=L+\delta L$, with $\delta L =x_0 \cos \omega t$. We calculate the values of the reflected field $E_{\rm R}$ (referred to at $x=0$) in terms of the ingoing field $E_{\rm In}$ (also referred to at $x=0$).

At the mirror location $x=L+\delta L$ the reflected field is simply $-r$ times the ingoing field evaluated at the mirror. The propagation to the mirror from $x=0$ contributes a phase factor $e^{-i\phi}$ and the propagation from the mirror to $x=0$, also contributes a phase factor of $e^{-i\phi}$, where $\phi=\omega_0(L+\delta L)/c=\omega_0(L+x_0\cos\omega t)/c$ and $\omega_0$ is the light frequency. Hence the reflected field is
\begin{align}
E_R&=-r_E e^{-2i\phi}E_{\rm In} 
=-r_E e^{-2i\omega_0L/c}e^{-2i x_0 \cos (\omega t)/c} E_{\rm In}
\end{align}
Taylor expanding in small $x_0$ (at fancy restaurants they call this utilizing the Jacobi-Anger expansion)
\begin{align}
E_R=-r_E e^{-2i\omega_0 L/c}\left[1-i\frac{x_0\omega_0}{c}(e^{i\omega t}+e^{-i\omega t})\right]E_{\rm In} \label{eq:side}
\end{align}

Note if we restore the time dependent factor $e^{i\omega_0t}$ that the first term has a time dependence $e^{i\omega_0t}$ (and is simply the reflected field when there is no modulation) while the second two terms are sideband fields with the time dependence $e^{i(\omega_0\pm\omega)t}$.

## Part b

**Use your knowledge of the frequency dependent System Matrix derived above to compute an expression for the transmitted power. Make a plot of the transfer function of the transmitted power as a function of modulation frequency (the y-axis should be in units of Watts/meter).
Hint Remember that the transmitted field will be the sum of the DC fields (computed above) and the AC fields}**

Now consider the Fabry Perot Cavity of problem one and imagine that we modulate the end mirror with $\delta L =x_0 \cos\omega t$. From part (a), we know that this produces sideband fields at node 4, i.e
\begin{align}
E_4=-r_E E_2+ir_E\frac{x_0\omega_0}{c}(e^{i\omega t}+e^{-i\omega t})E_{2},
\end{align}
As we are working to first order in the amplitude modulation, we can take $x_0=0$ when we evaluate $E_2$ the second term. From problem 1, when $x_0=0$, we know how to evaluate $E_2$ in terms of $E_{\rm In}$ and the system matrix $E_2=G_{20}(\omega_0)E_{\rm in}$. Hence
\begin{align}
E_4=-r_E E_2+ir_E\frac{x_0\omega_0}{c}(e^{i\omega t}+e^{-i\omega t})G_{20}(\omega_0)E_{\rm in}.
\end{align}
Here we are now writing the system matrix $G(\omega)$ as a function of frequency, with the frequency dependence coming from the frequency dependent phase $\phi(\omega)=\omega L/c$. Thus we see that we are effectively injecting fields at the sideband frequencies $\omega_0\pm \omega$ at node 4. The system matrix evaluated at the sideband frequencies also governs how light at the sideband frequencies propagates through the optical system. Thus we can write the complete field (with it's time dependence) as 
\begin{align}
\vec E(t)&=G(\omega_0)
\begin{bmatrix}
E_{\rm In} \\ 0 \\0 \\0 \\0 \\0 \\0
\end{bmatrix}
e^{i\omega_0 t} \nonumber \\
&+G(\omega_0 +\omega)
\begin{bmatrix}
0 \\ 0 \\ 0 \\0 \\ ir_EG_{20}(\omega_0)E_{\rm In}x_0\omega_0/c \\ 0 \\0
\end{bmatrix}
e^{i(\omega_0+\omega)t}
+G(\omega_0 -\omega)
\begin{bmatrix}
0 \\ 0 \\ 0 \\0 \\ ir_EG_{20}(\omega_0)E_{\rm In}x_0\omega_0/c \\ 0 \\0
\end{bmatrix}
e^{i(\omega_0-\omega)t}
\end{align}

Performing the matrix multiplication yields a transmitted field (including all of the time dependence) of
\begin{align}
E_T(t)&=G_{30}(\omega_0)E_{\rm In}e^{i\omega_0 t} \nonumber \\
&+G_{34}(\omega_0+\omega)ir_EG_{20}(\omega_0)x_0\frac{\omega_0}{c}E_{\rm In}e^{i(\omega+\omega_0)t}
+G_{34}(\omega_0-\omega)ir_EG_{20}(\omega_0)x_0\frac{\omega_0}{c}E_{\rm In}e^{i(-\omega+\omega_0)t} \label{eq:ETmod}
\end{align}

Thus we see that the transmitted field also has components at the carrier frequency $\omega_0$ and and the sideband frequencies $\omega_0\pm \omega$.

This produces an output power with a DC component  (computed in problem 1) and a slowly varying (relative to the carrier frequency) modulation at $\omega$. Namely, anytime the complex electric field is of the form
\begin{align}
E(t)=E_0e^{i\omega_0 t}+E_+e^{i(\omega_0+\omega)t}+E_-e^{i(\omega_0-\omega)t},
\end{align}
with $E_\pm\ll E_0$, then
the power is
\begin{align}
P&\propto |E|^2 \nonumber \\
&=|E_0|^2+E_0 e^{i\omega_0 t}(E_+^*e^{-i(\omega_0+\omega)t}+E_-^*e^{i(\omega_0+\omega)t}) +E_0^* e^{-i\omega_0 t}(E_+e^{i(\omega_0+\omega)t}+E_-e^{-i(\omega_0+\omega)t}) +\mathcal{O}(E_\pm^2) \nonumber \\
&=|E_0|^2+e^{i\omega t}\left[E_0^*E_++E_0E_-^*\right]+e^{-i\omega t}\left[E_0E_+^*+E_0^*E_-\right] \nonumber \\
&=|E_0|^2 +2A\cos(\omega t+\delta),
\end{align}
where $A$ and $\delta$ are the amplitude and phase of $E_0^*E_++E_0E_-^*=Ae^{i\delta}$.

The transmitted field is of this form with 
\begin{align}
&E_0=G_{30}(\omega_0)E_{\rm In},& &E_{\pm}=ir_Ex_0\frac{\omega_0}{c}G_{34}(\omega_0\pm \omega)G_{20}(\omega_0)E_{\rm In}&
\end{align}
Note both $E_0$ and $E_{\pm}$ are proportional to $E_{\rm in}$. Note that both $A$ and $|E_0|^2$ are proportional to $|E_{\rm In}|^2$ or equivalently the input power $P_{\rm In}$. Hence, we can write
\begin{align}
P_T=|G_{30}(\omega_0)|^2P_{\rm In}+\Delta P\cos(\omega t+\Phi),
\end{align}
where 
\begin{align}
\Delta P e^{i\Phi}&=2G^*_{30}(\omega_0)ir_Ex_0\frac{\omega_0}{c}G_{34}(\omega_0+\omega)G_{20}(\omega_0)+2G_{30}(\omega_0)(ir_Ex_0\frac{\omega_0}{c}G_{34}(\omega_0-\omega)G_{20}(\omega_0))^*P_{\rm In} \nonumber \\
&=2ir_Ex_0\frac{\omega_0}{c}\left[G^*_{30}(\omega_0)G_{34}(\omega_0+\omega)G_{20}(\omega_0)-G_{30}(\omega_0)G^*_{34}(\omega_0-\omega)G^*_{20}(\omega_0)\right]P_{\rm in},
\end{align}
We consider the transfer function from modulation amplitude to power to be $\Delta P/x_0$. 

The constants characterizing the Fabry-Perot Cavity in this probelm are below. Note that the length of the cavity is micro-tuned to be slightly off resonance.


```python
#Defining constants
c      = const.c    # speed of light
lam    = 437e-9           # laser wavelength
w0     = 2*np.pi*c/lam    # laser frequency
L0     = 4000             # initial length guess
L      = round(L0/lam)*lam # length of Fabry Perot cavity (tuned to int # of waves)
L     += 10e-12            # add small offset so that there is a linear readout

TI     = 0.014             # power transmissivity of input mirror
TE     = 1e-5            # power transmissivity of end mirror
tI     = np.sqrt(TI)      # amplitude transmissivity of input mirror
tE     = np.sqrt(TE)      # amplitdue transmissivity of end mirror
RI     = 1-TI             # energy reflectivity of input mirror
RE     = 1-TE             # energy reflectivity of end mirror
rI     = np.sqrt(RI)      # amplitude reflectivity of input mirror
rE     = np.sqrt(RE)      # amplitude reflectivity of end mirror
Pin    = 1                # laser power
def ph(w):                # phase accumaled over a half round trip in the FP cavity
        return w*L/c
```

A function that computes $\frac{\Delta P}{x_0} e^{i\Phi}$. The transfer function for the modulation amplitude is the absolute value of this function and the transfer function for the phase is the arguement.


```python
# define a function that computes Delta P/ x_0 in eq. 22 for FP
def P_trans(w):
    wc = w0
    z = 2j*rE*(2*np.pi/lam)*Pin * (np.conj(G(wc)[3,0]) *        (G(wc+w)[3,4] * G(wc)[2,0]) - 
                                           G(wc)[3,0]  * np.conj(G(wc-w)[3,4] * G(wc)[2,0]))
    
    return z
```

Bode plots for magnitude of the tranfer function


```python
#plot (zoomed out) for FP
f = np.logspace(0, 5, 1300)

omega = 2*np.pi*f
#y = list(map(Transfer, omega))
y = np.zeros_like(omega, complex)
for i in range(len(omega)):
    y[i] = P_trans(omega[i])
```


```python
fig1,ax = plt.subplots(2,1, sharex=True, figsize=(8,7))
ax[0].loglog(f, np.abs(y),
            rasterized=True)
ax[0].set_title(r'Single Fabry-Perot transfer function')
ax[0].set_ylabel(r'$\Delta P/x_0 [W/m]$')

ax[1].semilogx(f, np.angle(y, deg=True),
            rasterized=True)
ax[1].set_ylabel(r'Phase [deg]')
ax[1].set_xlabel(r'Frequency [Hz]')
ax[1].set_yticks(np.arange(-180,181,45))

plt.savefig("Figures/2bwide.pdf", bbox_inches='tight')
```

A close up of the resonances. The yellow lines denote the resonances frequency of the static cavity


```python
# plot (zoomed in) for FP
f = np.linspace(0, 1e5, 1000)

y = np.zeros_like(f, complex)
for i in range(len(f)):
    y[i] = P_trans(2*np.pi*f[i])

plt.figure(221)
plt.semilogy(f/1000, np.abs(y),
            rasterized=True)
plt.axvline(c/2/L/1000, color='xkcd:tangerine', alpha=0.5, lw=5)
plt.axvline(c/1/L/1000, color='xkcd:shit', alpha=0.5, lw=5)

plt.xlabel(r'Frequency [kHz]')
plt.ylabel(r'$\Delta P/x_0 [W/m]$')
plt.savefig("Figures/2bclose.pdf", bbox_inches='tight')

```

## Part c

**Now write down a larger Adjacency Matrix which represents a Michelson interferometer with Fabry-Perot cavities in place of the usual end mirrors. Assume that there is a small asymmetry in the Michelson, such that the distance from the beamsplitter to one of the FP cavities is 100 pm larger than the distance to the other cavity.
Make a Bode plot of the transfer function as in part b), but instead of the transmission of the FP cavity, use the anti-symmetric (detection) port as the readout.**

The optical layout of the Michelson interferometer is



The corresponding directed graph is



We take the mirrors in each Fabry-Perot cavity to be identical. We assume the y-axis FP cavity is located a distance d from the beam splitter\footnote{The field at the antisymmetric port depends on d when $\Delta \neq 0$, but that the power does not. Hence we will set $d=0$ in our numerical computations of the power.} and the the x-cavity is located a distance $d+\Delta$ from the beam splitter with $\Delta =100\,pm$. We take the transmissivity and reflectivity of the beam splitter to be $t_{\rm BS}=r_{\rm BS}=1/\sqrt{2}$.



```python
# part 2c
# extra parameters for 2c
TBS = 0.5
tBS = np.sqrt(TBS) #beam splitter tranmissivity
rBS = np.sqrt(1 - TBS) #beam splitter reflectivity

# distance to the y FP cavity. 
# The field at the antisymmetric port depends on d when Del is not zero, but the power doesn't
d = 0 

Del = 1e-10 #difference between distance to x cavity and the distance to the y cavity
```

We now imagine that the x-axis end mirror is shaken about its central location with $\delta L= x_0\cos\omega t$. Using the results of problem 2 (a) and the logic of 2 (b), this means that the field at the anti-symmetric port is now the field at the carrier frequency plus the result of injecting the field (including the full time dependence)
\begin{align}
E_{side}(t)=ir_E\frac{x_0\omega_0}{c}(e^{i(\omega_0 +\omega)t}+e^{+i(\omega_0-\omega )t})G_{20}(\omega_0)E_{\rm in}
\end{align}
in node 3. Again using the system matrix to propagate the fields, the field at the antisymmetric port is
\begin{align}
E_{AS}(t)&=G_{12,0}(\omega_0)E_{\rm In}e^{i\omega_0 t} \nonumber \\
&+G_{12,3}(\omega_0+\omega)ir_EG_{20}(\omega_0)x_0\frac{\omega_0}{c}E_{\rm In}e^{i(\omega+\omega_0)t}
+G_{12,3}(\omega_0-\omega)ir_EG_{20}(\omega_0)x_0\frac{\omega_0}{c}E_{\rm In}e^{i(-\omega+\omega_0)t}, \label{eq:EASmod}
\end{align}
which is exactly of the same form of the field as the transmitted field from the modulated Fabry-Perot Cavity, with the exception that we have relabeled the elements of the system matrix to correspond to the correct nodes. Hence, the same logic as above reveals that the power at the antisymmetric port is
\begin{align}
P_T=|G_{12,0}(\omega_0)|^2P_{\rm In}+\Delta P\cos(\omega t+\Phi),
\end{align}
where 
\begin{align}
\Delta P e^{i\Phi}&=2G^*_{12,0}(\omega_0)ir_Ex_0\frac{\omega_0}{c}G_{12,3}(\omega_0+\omega)G_{20}(\omega_0)+2G_{12,0}(\omega_0)(ir_Ex_0\frac{\omega_0}{c}G_{12,3}(\omega_0-\omega)G_{20}(\omega_0))^*P_{\rm In} \nonumber \\
&=2ir_Ex_0\frac{\omega_0}{c}\left[G^*_{12,0}(\omega_0)G_{12,3}(\omega_0+\omega)G_{20}(\omega_0)-G_{12,0}(\omega_0)G^*_{12,3}(\omega_0-\omega)G^*_{20}(\omega_0)\right]P_{\rm in},
\end{align}

The nonzero components of the adjacency matrix A are 
\begin{align}
&A_{10}=t_{BS}e^{-i\phi_x} & \nonumber \\
&A_{21}=t_I, & &A_{23}=-r_Ie^{-i\phi}&  \nonumber \\
&A_{32}=-r_Ee^{-i\phi}& \nonumber  \\
&A_{42}=t_Ee^{-i\phi}& \nonumber \\
&A_{51}=r_I, & &A_{53}=t_I e^{-i\phi}& \nonumber \\
&A_{60}=-r_{BS}e^{-i\phi_y}& \nonumber \\
&A_{76}=t_I,& &A_{7,9}=-r_Ie^{-i\phi}& \nonumber \\
&A_{87}=t_E e^{-i\phi},& \nonumber \\
&A_{97}=-r_E e^{-i\phi},& \nonumber \\
&A_{10,6}=r_I,& 
&A_{10,9}=t_I e^{-i\phi},& \nonumber \\
&A_{11,5}=t_{BS}e^{-i\phi_x},&
&A_{11,10}=-r_{BS}e^{-i\phi_y}& \nonumber \\
&A_{12,5}=r_{BS}e^{-i\phi_x},&
&A_{12,10}=t_{BS}e^{-i\phi_y}&,
\end{align}
where the phases are
\begin{align}
\phi(\omega)&=\omega L/c \nonumber \\ 
\phi_y(\omega)&=\omega d/c \nonumber  \\
\phi_x(\omega) &=\omega(d+\Delta)/c
\end{align}

We compute the adjacency matrix, the system matrix and the power transfer funciton $\frac{\Delta P}{x_0}e^{i\Phi}$


```python
def phx(w): #phase accumulated travelling to the x FP cavity
        return w*(d+Del)/c
    
def phy(w): #phase accumulated travelling to the y FP cavity
        return w*(d)/c#plot (zoomed out) for FP

# make x be a list of f rather than \omega, so we can plot transmitted power versus f
f = np.logspace(0, 5, 1000)

#y = list(map(Transfer, 2*np.pi*f))
```


```python
#Define adjacency matrix for Michelson
def A(w):
    M = np.zeros([13,13],complex)
    M[1,0]   = tBS*np.exp(-1j*phx(w))
    M[2,1]   = tI
    M[2,3]   = -rI*np.exp(-1j*ph(w))
    M[3,2]   = -rE*np.exp(-1j*ph(w))
    M[4,2]   = tE*np.exp(-1j*phx(w))
    M[5,1]   = +rI
    M[5,3]   = tI*np.exp(-1j*ph(w))
    M[6,0]   = -rBS*np.exp(-1j*phy(w))
    M[7,6]   = tI
    M[7,9]   = -rI*np.exp(-1j*ph(w))
    M[8,7]   = tE*np.exp(-1j*ph(w))
    M[9,7]   = -rE*np.exp(-1j*ph(w))
    M[10,6]  = +rI
    M[10,9]  = tI*np.exp(-1j*ph(w))
    M[11,5]  = tBS*np.exp(-1j*phx(w))
    M[11,10] = -rBS*np.exp(-1j*phy(w))
    M[12,5]  = rBS*np.exp(-1j*phx(w))
    M[12,10] = tBS*np.exp(-1j*phy(w))
    return M

# function that calculates system matrix G = (1-A)^(-1) for Michelson
def G(w):
    return np.linalg.inv(np.identity(13,complex) - A(w))

#define a function that computes Delta P/ x_0 in eq. 26 for Michelson
def P_dark(w):
    z = 2j * rE * Pin* (w0/c) * (np.conj(G(w0)[12,0])*         G(w0+w)[12,3] * G(w0)[2,0] - 
                                         G(w0)[12,0] * np.conj(G(w0-w)[12,3] * G(w0)[2,0]))
    return z
```

Bode plots


```python
#plot (zoomed out) for Fabry-Perot Michelson
f = np.logspace(0, 5, 1000)

#y = list(map(Transfer, omega))
y = np.zeros_like(f, complex)
for i in range(len(f)):
    y[i] = P_dark(2*np.pi*f[i])
```


```python
fig23, ax = plt.subplots(2,1, sharex=True, figsize=(8,7))
ax[0].loglog(f, np.abs(y),
            rasterized=True, c='xkcd:Burple')
ax[0].set_title(r'Michelson w/ Fabry-Perot arms')
ax[0].set_ylabel(r'$\Delta P/x_0 [W/m]$')

ax[1].semilogx(f, np.angle(y, deg=True),
            rasterized=True, c='xkcd:primary blue')
ax[1].set_ylabel(r'Phase [deg]')
ax[1].set_xlabel(r'Frequency [Hz]')
ax[1].set_yticks(np.arange(-180,181,45))

plt.savefig("Figures/2cwide.pdf")
```

Close up of the resonances. The yellow lines denote the resonances frequency of the static Fabry Perot cavity


```python
#plot (zoomed in) for Michelson
# make x be a list of f rather than \omega, so we can plot transmitted power versus f
f = np.linspace(0, 1e5, 1000)

y = np.zeros_like(f, complex)
for i in range(len(f)):
    y[i] = P_dark(2*np.pi*f[i])

plt.figure(227)
plt.semilogy(f/1000, np.abs(y),
            rasterized=True)
plt.axvline(c/2/L/1000, color='xkcd:tangerine', alpha=0.5, lw=5)
plt.axvline(c/1/L/1000, color='xkcd:shit',      alpha=0.5, lw=5)

plt.xlabel(r'Frequency [kHz]')
plt.ylabel(r'$\Delta P/x_0 [W/m]$')

plt.savefig("Figures/2cclose.pdf")
```


```python

```

f6ac4d2db138152dcbf45d48ba482fff5cb1c091
ipynb
Jupyter Notebook
Assignments/2018/a1.ipynb
rxa254/ph237
a9b3b0360966268537e53b7cc073187596fc91ff
MIT
2020-04-05T22:58:54.000Z
2020-04-05T22:58:54.000Z
Assignments/2018/a1.ipynb
rxa254/ph237
a9b3b0360966268537e53b7cc073187596fc91ff
MIT
2018-04-16T01:10:34.000Z
2020-05-08T05:37:09.000Z
Assignments/2018/a1.ipynb
rxa254/ph237
a9b3b0360966268537e53b7cc073187596fc91ff
MIT
2018-04-05T17:37:09.000Z
2018-04-05T17:37:09.000Z
Qwen/Qwen-72B
1. YES
2. YES