Better TO optimized coatings calculation is done. Now the Transmission, phase reflection, and TO noise are optimized.
From previous elog, these are explanation about the optimization codes.
Quote: 
The codes for optimizing Thermooptic noise in coatings are up on svn.
I adopt some codes that have been on svn for awhile and modified them for AlGaAs coatings. There are two main codes
.......
2) optAlGaAs.m
This file is the modification of optETM.m found in ../iscmodeling/coating/AlGaAs/optETM.m .It calculates the reflectivity and the TO coefficients from the given layer structure. The modifications are:
 (Line4145) Layer structure, the cap start with nH. The material for substrate is SiO2 with nsub = 1.45.
 (Line60) Desired transmission, as a test, I chose 200 ppm.
 (Line88) Calculation for TO coefficients (StoZ), I switched from getCoatThermoOptics.m to getCoatThermoOPticsAGS.m. Codes with AGS suffix in /GwincDev folder are fixed for AlGaAs coatings structure. This code calls many functions in /GwincDev folder.
.......

So optAlGaAs.m calculates a parameter y which is the cost function that is minimized in fmincon in doAlGaAs.m code. Originally the cost function y includes the difference between the expected transmission and the transmission from the given layer, and the level of TO noise which are:
y = [(T  <T>) / <T>]^2 + sTO (f0). The goal is to minimize y. Where
 T = transmission of the mirror with the optimized layers
 <T> is the required Transmission
 sTO(f0) is TO noise at f0
 Each effect is weighted differently
This cost function does not care about the total phase of the reflected beam. T is the absolute value of the transmission, so the information about the phase is removed, and the optmized coatings calculated from this cost function won't have phase close to 180 degree. The previous result showed 1801.2 degree.
So I added the phase of the reflection in the cost function, with appropriate weight, and ran the optimization.
==Phase calculation==
rCoat is the reflectivity of the coatings, by using atan(imag(rCoat)/real(rCoat)), we obtain the phase of the reflectivity. I tried to you atan2(y,x) to get the phase of 180, but it does not work well with the optimization. I'm not sure why. So I use atan function, and check the value of rCoat after the optimization to make sure that rCoat is close to 1 + 0i. The result is shown below.
above: the layer structure, optimized for 200ppm, y axis is in unit of lambda in the layer. The first layer is the 1/4 wave cap, the last layer is the layer just before the substrate.
above: noise budget for the optmized structure, the reflection phase is 180 1e6 degree.
The layer structure is attached below in .mat format. Note: the structure does not include 1/4 cap on top.
== summary of the modifications of optAlGaAs.m==
 (line 90  95) add calculation of the phase of the reflectivity
 line 97 the cost function includes phase of the reflectivity that is close to 180 degree (r is close to 1 + 0i). The weigh functions from TO noise/transmission/phase are chosen so that each factor are about the same, and the result looks reasonable ( coating thickness ~0.1  0.3 lamda, correct reflectivity, correct transmission).
