Written by Guido Mueller, April 8th 1999, Department of Physics, UF, Gainesville, Florida, USA. **************************************************************************** New Comment from April 24th 2000: The author highly recommends FINESSE to calculate the frequency response and the error signals. InterCal might be useful as a start if you are planning to include other effects like thermal deformations (for example using tools of MELODY) but if you are only interested in frequency responses, use FINESSE. **************************************************************************** This README can also be found in InterCal.tar.gz These MATLAB programs were written to calculate the frequency response and the error signals of an interferometer in a dual recycled cavity enhanced setup. It needs MATLAB Version 5.n. This project started while the author was involved in the debugging and testing of MELODY, a MATLAB code written by Ray Beausoleil to calculate the impact of thermal lensing in interferometers. Both codes make extensive use of MATLAB-objects using often similar names. But both codes are NOT compatible. To start the code you should first edit the ".matlab5rc.sh"-file. The MATLABPATH is set to "MATLABPATH="$MATLABPATH":$HOME/MATLAB/PUBLIC/:$HOME/MATLAB/PUBLIC/utilities/" several times in this file. Change the path to the directory where you have installed the code. To run the program start matlab. At the prompt type "frequency" and in less than a minute a window with a green and a red curve in a loglogplot should appear. The curves should have a low pass characteristic with a corner frequency of 180Hz. There should be also a text output in the MATLAB window: degree_freedom = FP_diff signal_port = dark_port Writing FP_diff_in_dark_port.dat ... done! Check the file FP_diff_in_dark_port.dat in the directory "freqoutput". It should contain the intensities and phases of the signals at the dark port for both modulation frequencies. After this, type "errorsig" at the prompt and in a few seconds a new plot should appear with a yellow, green, black, and blue curve. The yellow curve has a dispersive profile with an amplitude of 0.25 and the other curves should be close to 0 everywhere. The x-axis should start at -0.01 and end at 0.01. There should be also a text output in the MATLAB window: coupled_degree = FP_diff degree_freedom = FP_diff signal_port = dark_port Writing FP_diff_in_dark_port.dat ... done! Check the file FP_diff_in_dark_port.dat in the directory "erroutput". It should contain the Inphase and the Quadrature components of the signals at the dark port for both modulation frequencies. If this is the case: Congratulations, everything works so far. If not, something was going wrong. How to use the code ? Short version: The user needs to edit the following programs: To change the interferometer configuration (lengths, mirrors) and the input field (RF-frequencies, modulation-index): >ligo2_set_params.m >ligo1_set_fpi_1_params.m >ligo1_set_fpi_2_params.m To change the parameters of the run (degree of freedom, detectorport,...): >transfer_params.m >errorsig_params.m To change the output (intensities, Inphase-, Quad-signals, Amplitudes, Phases,...): >errorsig.m >frequency.m and maybe wants to write an additional "get_*.m" program for the detector object. However, there are already several different "get_*.m" programs for different requests. Or wants to write an additional "write_*.m" program different from the two programs in the utilities. NOTICE THAT IN BOTH "utilities/write_*.m" IS A COMMAND AT THE BEGINNING WHICH CHANGES THE DIRECTORY AND DELETES EVERY *.DAT-FILE FROM PREVIOUS RUNS. THERE IS ALSO A "cd.." AT THE END, WHICH BRINGS YOU BACK TO YOUR ORIGINAL DIRECTORY. YOU CAN UNCOMMENT THE "delete *.dat" COMMAND IF YOU WANT TO KEEP ALL RESULTS. Longer version: The main programs are FREQUENCY.M and ERRORSIG.M and you should look at these programs to get an idea how everything works: Both programs first read all parameters of the interferometer (->LIGO2_SET_PARAMS): RF-frequencies, modulation indices, distances, Reflectivities, Positions etc. and if you want to change the setup, you have to do it there. In the next steps they initialize the input field and the interferometer. The programs read then the informations about the actual run: FREQUENCY.M reads in (->TRANSFER_PARAMS.M) the degree of freedom which oscillates, the detector port, the frequency range, the type of frequency scan (log or lin), and the number of points. errorsig.m reads in (->ERRORSIG_PARAMS.M) the degree of freedom which is scanned, the coupled degree of freedom which defines the demodulation phase, the detector port, the tuning range, and the number of points. You will edit these two files very often. I found it convenient to write a command line for every allowed parameter and uncomment only the used lines. If you want to do it the same way, then just uncomment the right lines. In the next steps in FREQUENCY.M the 0-order fields (carrier and RF-sidebands) at several places are calculated. We need them as LO-fields at the photo detectors and as source fields at the moving mirrors. Also the demodulation phase is assigned. The LO-fields and the LO-phase are stored in the detector object. All fields called a (or in the detector d.a) are LO-fields (carrier, RF-sidebands). All fields called b (or d.b) are signal fields. In ERRORSIG.M the signal port (place of the photo detector) is assigned and the demodulation phase is calculated. In both programs the output-arrays (f_s or dl, I, A, N) are defined. They are used to store the noise frequency or the actual length offset and the intensities, amplitudes, phases or what ever you calculate. Then the slopes start: In FREQUENCY.M are two (if-else) questions about the kind of scan (log or lin) and if one or two mirrors move: for degrees of freedom: MIdiff, MIcomm, FPdiff, FPcomm, 2 mirrors have to move, for PR and SR only one mirror moves. The first question changes only the way the frequency increases. The second one decides if the calculation is done twice with different mirrors and the signal sidebands are added with the right phase later. If you want to know more about it look into (->set_sigfield.m). Between the different if-else combinations happens more or less the same. The noise frequency increases (-> s_h = s_0+f_s(step+1)) and that changes the propagators in the interferometer (-> SIG_PROP(ifo,s_h)). The signal fields for positive noise frequencies (b_p) at port (power or signal: between BS and PR or SR-mirror; NOT yet at the detector) are calculated using the appropriate transfer functions (->SET_SIGFIELD.M). After this the signal fields are propagated to the detector (->GET_SIGFIELD.M). This is repeated for the negative noise frequency (b_m) and finally both noise sidebands are assigned to the detector as (->SET_DETFIELD) d.b_p, d.b_m. After this step the LO-fields (carrier and RF-sidebands in d.a), the noise sidebands (carrier + f_s, carrier + RF + f_s, carrier - RF + f_s in d.b_p and carrier - f_s, carrier + RF - f_s, carrier - RF - f_s in d.b_m), and the demodulation phase in d_phi are assigned to the detector object. You can now get the amplitude of the carrier, the Inphase and Quad-signals and every other imaginable signal by writing your own (-> GET_WHAT_YOU_WANT.M) program or use the (-> GET_*.M) programs in the detector-object. After the 4 parts for the 4 different (if-else) combinations follows the output part. There are several plot routines and two WRITE_* functions. The WRITE_* functions write a .dat file in FREQOUTPUT/ . Edit this part by yourself. I don't know what you want. The slope in ERRORSIG.M changes the tuning length dl and updates the interferometer (->IFO_UPDATE), which means updates the mirror positions. After this it calculates the field at "pos"(->SET_FIELD), which is the position inside the interferometer just before the field leaves the ifo. (->GET_FIELD) propagates this field to the detector. (->SET_DETFIELD) assigns the field to the detector object. You can now get the amplitude of the carrier, the Inphase and Quad-signals and every other imaginable signal by writing your own (-> GET_WHAT_YOU_WANT.M) program or use the (-> GET_*.M) programs in the detector-object. There are several plot routines and two WRITE_* functions at the end. The WRITE_* functions write a .DAT file in ERROUTPUT/ . Edit this part by yourself. I don't know what you want.