Skip to content
Snippets Groups Projects
Commit c0c80f03 authored by zhang's avatar zhang
Browse files

30/06/2011

Correct the bug to get COD and one turn map for the lattice with negative momentum compact factor.
parent e506cc23
No related branches found
No related tags found
No related merge requests found
......@@ -792,11 +792,17 @@ bool Cell_GetCOD_M(long imax, double eps, double dP, long &lastpos)
Comments:
Called by getCOD, Ring_Pass
27/06/11 Correct the bug for the negative momentum compact factor; if the momentum
compact is negative, then switch the Stable Fixed Point to Unstable Fixed Point.
For Cell_GetCOD_M, the tracking is in 4D, so there is no switch of
fixed point for the lattice with negative momentum compact factor.
28/06/11 Correct the one turn map for the lattice with negative momentum compact factor, now the one turn map is
tracked around the COD.
****************************************************************************/
bool Cell_getCOD(long imax, double eps, double dP, long &lastpos)
{
long j, n, n_iter;
double dxabs;
long j = 0, n = 0, n_iter = 0, h_RF = 0;
double dxabs = 0.0;
iVector jj;
ss_vect<double> x0, x1, dx;
ss_vect<tps> I, dx0, map;
......@@ -875,6 +881,20 @@ bool Cell_getCOD(long imax, double eps, double dP, long &lastpos)
}
} while ((dxabs >= eps) && (n_iter <= imax));
//if momentum compact factor is negative, then swtich the fixed point(SFP->UFP)
h_RF = Cell[Elem_GetPos(globval.cav, 1)].Elem.C->Ph;
if(globval.Alphac < 0)
x0[ct_] = -0.5*Cell[globval.Cell_nLoc].S/h_RF- x0[ct_]; //since the value of x0[ct_] is negative, so use "-0.5"
if(0)
cout<< " c*tau0 is: " << x0[ct_] <<endl;
//get the one turn map for the close orbit
map.identity();
map += x0;
Cell_Pass(0, globval.Cell_nLoc, map, lastpos);
status.codflag = dxabs < eps;
if (status.codflag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment