Changeset 9 in TRACY3 for trunk/tracy/tracy/src/t2elem.cc
- Timestamp:
- Jan 10, 2013, 3:05:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tracy/tracy/src/t2elem.cc
r3 r9 660 660 661 661 (exact form of the H of the drift) 662 A(x,y,-l,px,py,dP) = -sqrt( (1 + delta)^2 + px^2 +py^2 ) + delta662 A(x,y,-l,px,py,dP) = -sqrt( (1 + delta)^2 - px^2 - py^2 ) + delta 663 663 664 664 (exact form of the H of the kick from the magnet) 665 B(x,y,-l,px,py,dP) = -h*x*sqrt( (1 + delta)^2 + px^2 +py^2 ) + h x + h^2*x^2/2 + int(Re(By+iBx)/Brho)665 B(x,y,-l,px,py,dP) = -h*x*sqrt( (1 + delta)^2 - px^2 - py^2 ) + h x + h^2*x^2/2 + int(Re(By+iBx)/Brho) 666 666 667 667 so this is the exact Hamitonian for small ring. … … 670 670 The kick is given by 671 671 e 672 Dp_x = L* (h_ref*sqrt( (1 + delta)^2 + px^2 + py^2 ) - h_bend - x^2*h_bend*h_ref/2 ----- B_y )672 Dp_x = L* (h_ref*sqrt( (1 + delta)^2 - (px^2 + py^2) ) - h_bend - x*h_bend*h_ref - ---- B_y ) 673 673 p_0 674 674 Dp_y = L* e/p_0 * B_x 675 675 676 x = L* h*x_ref / sqrt( (1 + delta)^2 + px^2 +py^2) * p_x676 x = L* h*x_ref / sqrt( (1 + delta)^2 - px^2 - py^2) * p_x 677 677 678 y = L* h*x_ref / sqrt( (1 + delta)^2 + px^2 +py^2) * p_y678 y = L* h*x_ref / sqrt( (1 + delta)^2 - px^2 - py^2) * p_y 679 679 680 CT = L* h*x_ref / sqrt( (1 + delta)^2 + px^2 +py^2) * (1+delta)680 CT = L* h*x_ref / sqrt( (1 + delta)^2 - px^2 - py^2) * (1+delta) 681 681 682 682 where … … 826 826 // x[ct_]+= (1+x0[delta_])*L*h_bend*h_ref + (1+x0[delta_])*h_ref*(asin(n1) - asin(n2)); 827 827 // 828 829 830 828 }//approximate Hamiltonian 829 else { 830 x[px_] -= L * (ByoBrho + (h_bend - h_ref) / 2.0 + h_ref * h_bend 831 831 * x0[x_] - h_ref * x0[delta_]); 832 x[ct_] += L * h_ref * x0[x_]; 833 834 // second order of the h_ref835 u = L * h_ref * x0[x_] /(1.0+x[delta_]);836 x[x_] += u * x0[px_];837 x[y_] += u * x0[py_];838 x[ct_] += u*(sqr(x0[px_])+sqr(x0[py_]))/(2.0*(1.0+x0[delta_]));832 x[ct_] += L * h_ref * x0[x_]; 833 834 // second order of the h_ref 835 u = L * h_ref * x0[x_] /(1.0+x[delta_]); 836 x[x_] += u * x0[px_]; 837 x[y_] += u * x0[py_]; 838 x[ct_] += u*(sqr(x0[px_])+sqr(x0[py_]))/(2.0*(1.0+x0[delta_])); 839 839 } 840 840 … … 922 922 if (true) { 923 923 924 //cout << "With Alex's correction: " << endl;924 //cout << "With Alex's correction: " << endl; 925 925 926 926 //with the contribution from the entrance angle of the particle at the edge … … 1308 1308 EdgeFocus(M->Pirho, M->PTx1, M->Pgap, x,true); 1309 1309 } else {//small and big rings 1310 1311 1312 1313 1310 if(M->PTx1!=0){ 1314 1311 EdgeFocus(M->Pirho, x); 1315 p_rot(M->PTx1, x);1312 //p_rot(M->PTx1, x); 1316 1313 //rotate from cartesian cooridnate to curlinear curved beam coordinate; 1317 1314 // since the map of a sector dipole is used in Tracy 3 1318 1315 } 1316 p_rot(M->PTx1, x); 1319 1317 bend_fringe(M->Pirho, M->Pgap, x); //fringe field 1320 1321 1322 1323 1318 } 1324 1319 } … … 1431 1426 1432 1427 bend_fringe(-M->Pirho, M->Pgap,x); //fringe field of the dipole 1428 p_rot(M->PTx2, x); 1433 1429 if(M->PTx2!=0){ 1434 p_rot(M->PTx2, x); //rotate back to the cartesian cooridinate1430 //p_rot(M->PTx2, x); //rotate back to the cartesian cooridinate 1435 1431 EdgeFocus(M->Pirho, x); 1436 1432 }
Note: See TracChangeset
for help on using the changeset viewer.