Commit 17b457f6 authored by Daniel Brown's avatar Daniel Brown

Removing phase 1 application on surface motion knm matrices. For negative knm...

Removing phase 1 application on surface motion knm matrices. For negative knm calculations the phase was being revereds on the motion to optic knm but not to the optic to motion matrices. This led to unexpected sign errors in the PI gain. Originally thought the phase 1 application also needed to be applied to the surface motion knms, as it is applied to the static knms. On further thought this shouldn't be the case. Phase 1 is applied to make tuning with maps easier, this doesn't apply for a sinusoidally varying surface motion.
parent a3caae5a
......@@ -14,13 +14,23 @@ changes before. Not every version number is listed.
main changes:
syntax change:
added features:
o added 'powers' command which prints the light power in all node
to the terminal
o added the ability to generate mutli-mode squeezing. This is done by using the `tem' command to set the mode content of a squeezer, like a normal laser component. The only difference being the amplitude part inputs the mode squeezing in dB and phase input sets the squeezing rotation.
o Introduced `--pykat=pipename` flag. This opens a pipe between Finesse and whatever else (typically Pykat) so that data can be sent and requested between the two.
o tf2: For each pole or zero added the funcion will automatically add the conjugate pole
so you don't need to specify each
added features:
o added 'powers' command which prints the light power in all node to the terminal
o added the ability to generate mutli-mode squeezing. This is done by using the `tem'
command to set the mode content of a squeezer, like a normal laser component. The
only difference being the amplitude part inputs the mode squeezing in dB and phase
input sets the squeezing rotation.
o Introduced `--pykat=pipename` flag. This opens a pipe between Finesse and whatever else (typically Pykat) so that data can be sent and requested between the two.
o mismatches [flag]: displays mismatching present in the model
o dbs: Directional beam splitter component
o Entangled carrier injection for EPR modelling using the sqz* command.
Generates a 0Hz field and another at the frequency specified in the command.
These two fields then have their upper and lower sidebands correllated.
o qNhd detector for combing quantum noise measurements at multiple nodes.
bug fixes:
o noxaxis no longer tries to call gnuplot/python plotting
o fixed roundtrip gouy phase sign
......@@ -29,6 +39,9 @@ bug fixes:
o Fixed error when using var, which would say that too many variables exist
o Fixed map scattering calculations when storing values for a certain maxtem but then rerunning with a larger one.
o Non-square maps causing segfault is fixed
o Functions names can be longer than 14 characters now
o Phase 1 was being incorrectly applied for surface motion maps, gave wrong sign errors for PI gains
in certain circumstances.
2.0 -> 2.1 (22/04/2016)
......
......@@ -1565,7 +1565,7 @@ int set_k_mirror(int mirror_index) {
memset(&(C[0][0]), 0, inter.num_fields * inter.num_fields * sizeof (complex_t));
int l = 0, _n1 = 0, _m1 = 0;
for (n = 0; n < inter.num_fields; n++) {
get_tem_modes_from_field_index(&_n1, &_m1, n);
......@@ -1576,6 +1576,7 @@ int set_k_mirror(int mirror_index) {
get_tem_modes_from_field_index(&n2, &m2, l);
z_inc_z(&C[n][m], z_by_z(B[n][l], A[l][m]));
}
//warn("surf %i%i -> %i%i %s %s\n", n1, m1, _n1, _m1, complex_form(A[n][m]), complex_form(B[n][m]));
}
}
......@@ -1617,9 +1618,10 @@ int set_k_mirror(int mirror_index) {
mirror->knm.k22[n][m] = rev_gouy(mirror->knm_no_rgouy.k22[n][m], n1, m1, n2, m2, knm_q.qxt1_22, knm_q.qxt2_22, knm_q.qyt1_22, knm_q.qyt2_22);
for (k = 0; k < mirror->num_surface_motions; k++) {
// for input beams the q value is reversed so the n1/n2 are the other way around here.
mirror->knm_surf_motion_1i[k][n][m] = rev_gouy(mirror->knm_surf_motion_1i[k][n][m], n2, m2, n1, m1, knm_q.qxt1_11, knm_q.qxt2_11, knm_q.qyt1_11, knm_q.qyt2_11);
mirror->knm_surf_motion_1o[k][n][m] = rev_gouy(mirror->knm_surf_motion_1o[k][n][m], n2, m2, n1, m1, knm_q.qxt1_22, knm_q.qxt2_22, knm_q.qyt1_22, knm_q.qyt2_22);
mirror->knm_surf_motion_2i[k][n][m] = rev_gouy(mirror->knm_surf_motion_2i[k][n][m], n1, m1, n2, m2, knm_q.qxt1_11, knm_q.qxt2_11, knm_q.qyt1_11, knm_q.qyt2_11);
mirror->knm_surf_motion_1o[k][n][m] = rev_gouy(mirror->knm_surf_motion_1o[k][n][m], n1, m1, n2, m2, knm_q.qxt1_11, knm_q.qxt2_11, knm_q.qyt1_11, knm_q.qyt2_11);
mirror->knm_surf_motion_2i[k][n][m] = rev_gouy(mirror->knm_surf_motion_2i[k][n][m], n2, m2, n1, m1, knm_q.qxt1_22, knm_q.qxt2_22, knm_q.qyt1_22, knm_q.qyt2_22);
mirror->knm_surf_motion_2o[k][n][m] = rev_gouy(mirror->knm_surf_motion_2o[k][n][m], n1, m1, n2, m2, knm_q.qxt1_22, knm_q.qxt2_22, knm_q.qyt1_22, knm_q.qyt2_22);
mirror->knm_surf_x_a_1[k][n][m] = rev_gouy(mirror->knm_surf_x_a_1[k][n][m], n1, m1, n2, m2, knm_q.qxt1_11, knm_q.qxt2_11, knm_q.qyt1_11, knm_q.qyt2_11);
......@@ -1627,7 +1629,7 @@ int set_k_mirror(int mirror_index) {
}
}
}
// Here we store the phases of the TEM00 so that we can 'zero' the phase, as
// typically we do not care for the exact phase here just the relative ones
// between the modes
......@@ -1638,25 +1640,6 @@ int set_k_mirror(int mirror_index) {
p12 = zphase(mirror->knm.k12[0][0]);
p21 = zphase(mirror->knm.k21[0][0]);
p22 = zphase(mirror->knm.k22[0][0]);
for (k = 0; k < mirror->num_surface_motions; k++) {
// At times the surface motion will have zero 00->00 coupling
// for example with tilt motions. Thus if it is zero then we don't
// compute a phase, otherwise we just get some phase of noise which
// gives weird results.
if (zmod(mirror->knm_surf_x_a_1[k][0][0]) > ZERO) {
psm1[k] = zphase(mirror->knm_surf_x_a_1[k][0][0]);
} else {
psm1[k] = 0.0;
}
if (zmod(mirror->knm_surf_x_a_2[k][0][0]) > ZERO) {
psm2[k] = zphase(mirror->knm_surf_x_a_2[k][0][0]);
} else {
psm2[k] = 0.0;
}
}
}
for (n = 0; n < inter.num_fields; n++) {
......@@ -1669,11 +1652,6 @@ int set_k_mirror(int mirror_index) {
mirror->knm.k12[n][m] = z_by_phr(mirror->knm.k12[n][m], -p12);
mirror->knm.k21[n][m] = z_by_phr(mirror->knm.k21[n][m], -p21);
mirror->knm.k22[n][m] = z_by_phr(mirror->knm.k22[n][m], -p22);
for (k = 0; k < mirror->num_surface_motions; k++) {
mirror->knm_surf_x_a_1[k][n][m] = z_by_phr(mirror->knm_surf_x_a_1[k][n][m], -psm1[k]);
mirror->knm_surf_x_a_2[k][n][m] = z_by_phr(mirror->knm_surf_x_a_2[k][n][m], -psm2[k]);
}
}
// check if we need to flip the left and right, like looking in a mirror
......@@ -1702,6 +1680,7 @@ int set_k_mirror(int mirror_index) {
// }
}
}
memset(mirror->k11_sqrd_sum, 0, sizeof (double) * inter.num_fields);
memset(mirror->k12_sqrd_sum, 0, sizeof (double) * inter.num_fields);
......
......@@ -756,10 +756,11 @@ void calc_mirror_knm_surf_motions_rom(mirror_t *mirror, double nr1, double nr2,
assert(zx11 <= rom->roq11.zmax && zx11 >= rom->roq11.zmin);
assert(wy11 <= rom->roq11.w0max && wy11 >= rom->roq11.w0min);
assert(zy11 <= rom->roq11.zmax && zy11 >= rom->roq11.zmin);
(void)wx11; //suppressing compiler warnings
(void)wy11;
(void)zx11;
(void)zy11;
(void)wx11; //suppressing compiler warnings
(void)wy11;
(void)zx11;
(void)zy11;
fill_unn_cache(&(ws11->ux_cache_11), acc_11_nr1_1->acc_n, acc_11_nr1_2->acc_n, true);
fill_unn_cache(&(ws11->uy_cache_11), acc_11_nr1_1->acc_m, acc_11_nr1_2->acc_m, true);
......@@ -770,10 +771,10 @@ void calc_mirror_knm_surf_motions_rom(mirror_t *mirror, double nr1, double nr2,
double wy22 = w0_size(qy22, nr2);
double zx22 = fabs(qx22.re);
double zy22 = fabs(qy22.re);
(void)wx22; //suppressing compiler warnings
(void)wy22;
(void)zx22;
(void)zy22;
(void)wx22; //suppressing compiler warnings
(void)wy22;
(void)zx22;
(void)zy22;
assert(wx22 <= rom->roq22.w0max && wx22 >= rom->roq22.w0min);
assert(zx22 <= rom->roq22.zmax && zx22 >= rom->roq22.zmin);
......
......@@ -7708,7 +7708,7 @@ int get_attribute_type(const char *parameter_name,
attribute_type = MASS;
} else if (strcasecmp("ix", parameter_name) == 0 ||
strcasecmp("moix", parameter_name) == 0||
strcasecmp("iyaw", parameter_name) == 0)) {
strcasecmp("iyaw", parameter_name) == 0) {
attribute_type = MOIX;
} else if (strcasecmp("iy", parameter_name) == 0 ||
strcasecmp("moiy", parameter_name) == 0 ||
......
......@@ -1395,7 +1395,7 @@ void fill_optic_motion_coupling(){
// TODO add index of refraction to these later
// phase that the carrier and sideband will pick up due to tuning
double phi_c = m->phi * (1.0 + fcar->f / inter.f0);
double phi_c = m->phi * (1.0 + fcar->f / inter.f0);
double phi_sl = m->phi * (1.0 + (fcar->f + fcar->sig_lower->f) / inter.f0);
double phi_su = m->phi * (1.0 + (fcar->f + fcar->sig_upper->f) / inter.f0);
......@@ -1474,8 +1474,9 @@ void fill_optic_motion_coupling(){
}
}
if(hasRotMotion)
if(hasRotMotion) {
fill_mirror_rot_motion_to_field(fcar, m, factor_x_a, x_a1, x_a2, y_a1, y_a2, ac_1i, ac_2i, tuning1u, tuning1l, tuning2u, tuning2l);
}
}
// lastly fill in any motion linking
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment