I have modified Arbcav to be way cooler than it used to be.
Main modifications:
 Can now truly model an arbitrary cavity geometry
 The previous version could only handle a few different topologies. In each case, it would unfold the cavity into the equivalent linear cavity and use the gparameter method to calculate gouy phases, etc.
 The new model uses the closed cavity propagation matrix to find the supported mode, and then explicitly calculates the accumulated gouy phase by propagating the beam through the full cavity. This is done analytically with z_{R}, so there is negligible slowdown.
 Now plots a diagram of the cavity geometry, both to help you and for you to verify that it is calculating the right thing (< this is the cool part)
 Plots the beam path and mirror locations
 Specifies whether mirrors are curved or flat
 Prints mirror parameters next to them
 Finds all intracavity waist locations and plots them
 Gives waist information (size in X, Y)
Since the information is already there, I will have the output structure include things like the input beam q parameter, which could then be fed directly to mode matching tools like ModeMatchr.
The function takes as input the same arguments as before. Example for a square cavity:
out = arbcav([200e6 50e6 200e6 50e6],[0.75 0.75 0.75 0.75],[1e10 9 1e10 9],[45 45 45 45],29.189e6,10e6,1064e9,1000);
i.e.,
out = arbcav(transmissivity_list, length_list, RoC_list, angle_list, modulation_freq, loss_list_or_loss_per_mirror, wavelength, num_pts_for_plot);
If you don't give it a modulation frequency, it will just plot carrier HOMs. If you don't give it RoCs and angles, it will just plot the transmission spectrum.
I'm still finetuning some functionality, but I should have it up on the SVN relatively soon. Comments or suggestions are welcome!
Some screenshots:
Cavity geometry plots (linear, triangular, square, bowtie):
Transmission and HOM spectra (these correspond to the square cavity at lower left, above):
