Course: Learn Laser Interferometry


3.Advanced topics > 1. Reduced order modelling

1.Making a reduced order model of a mirror map

Author: Daniel Brown

This notebook demonstrates how you can take a mirror map you are using in Finesse and make a reduced order model (ROM) of it. In the end this allows us to make a reduced order quadrature rule for efficiently calculating the modal scattering of an incoming beam. The output of this process will be the weights for this quadrature rule which can be used in both Finesse or Pykat. This assumes that you already have:

  • A processed mirror map
  • A suitable empirical interpolant to make your reduced order model
  • Finesse v2.1 or more recent
  • Pykat v1.0 or more recent

These topics are covered in other notebooks. In this tutorial we will be using a previously generated empirical interpolant for the advanced LIGO arm cavities. These have been generated for both the ITM and ETM for a range of cavity states likely to be seen in the aLIGO arm cavities. You can get these for yourself here.

First we need to import some basics:

In [1]:
import pykat
import pickle
from pykat.optics.maps import read_map
from pykat.optics.romhom import read_EI

pykat.init_pykat_plotting()
                                              ..-
    PyKat 1.0.4           _                  '(
                          \`.|\.__...-""""-_." )
       ..+-----.._        /  ' `            .-'
   . '            `:      7/* _/._\    \   (
  (        '::;;+;;:      `-"' =" /,`"" `) /
  L.        \`:::a:f            c_/     n_'
  ..`--...___`.  .    ,  
   `^-....____:   +.      www.gwoptics.org/pykat

Then we need to define what map, output and empirical interpolant we will be using:

In [2]:
map_file     = "etm08_virtual.map" 
outfile_file = "etm08_virtual"          # Code will append the '.rom' file extension
EI_file      = "aligo_arm/ETM_14_EI.p"

Reading the map in we should double check we have the correct map:

In [3]:
m = read_map(map_file)
fig = m.plot()
/Users/ddb/miniconda3/envs/py3/lib/python3.5/site-packages/matplotlib/collections.py:590: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  if self._edgecolors == str('face'):

It is a good idea to check the limits and ranges of the empirical interpolant you are using. This can be done with the helper function to read an EI in:

In [4]:
ei = read_EI(EI_file, verbose=True)
Map data this ROM was made for in one dimension:
    Map separation dx = 0.000267111853088
    x range = -0.16m to 0.16m
    Data points = 1200

Parameter limits:
    w0 = 0.00475760053546656m to 0.0120370407341722m
    z  = 2110.4275m to 2202.60826923077m
    max order  = 14

ROM contains 28 basis modes
In [7]:
print(m.size)
print(m.x.max(), m.x.min())
(1199, 1199)
0.16 -0.16

Above we can see the map size and also the map size that the ROM was produced for. The map we are using doesn't have the same number of points but has the same range. Small differences like this can easily be fixed by interpolating our current map data. This is done internally in the code when using the interpolate=True argument as seen below.

We are now ready to generate the weights for an efficient quadrature rule:

In [5]:
m.generateROMWeights(EI_file, verbose=True, interpolate=True)
Computing weights: 100%|#########################################|Time: 0:00:06
Computing weights: 100%|#########################################|Time: 0:00:05
Computing weights: 100%|#########################################|Time: 0:00:02
Computing weights: 100%|#########################################|Time: 0:00:04
Out[5]:
<pykat.optics.maps.MirrorROQWeights at 0x10db3acf8>

Finally, we can just write these weights to a file:

In [6]:
m.ROMWeights.writeToFile(outfile_file)

This weights file can then be used in Finesse instead of the original map file. This will result in faster numerical integration that is required to compute higher order mode scattering.

 

© Andreas Freise 2009 onwards. The css design is based on a free template from Free CSS Templates.