Changeset 9 in TRACY3 for trunk/tracy/tracy/src/t2elem.cc


Ignore:
Timestamp:
Jan 10, 2013, 3:05:06 PM (11 years ago)
Author:
zhangj
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tracy/tracy/src/t2elem.cc

    r3 r9  
    660660                 
    661661                 (exact form of the H of the drift)
    662                  A(x,y,-l,px,py,dP) = -sqrt( (1 + delta)^2 + px^2 + py^2 )  + delta
     662                 A(x,y,-l,px,py,dP) = -sqrt( (1 + delta)^2 - px^2 - py^2 )  + delta
    663663                                     
    664664                 (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)   
    666666                 
    667667                 so this is the exact Hamitonian for small ring.
     
    670670        The kick is given by
    671671                                                                                                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 )
    673673                                                                                               p_0                 
    674674         Dp_y = L* e/p_0 * B_x
    675675         
    676          x    = L* h*x_ref / sqrt( (1 + delta)^2 + px^2 + py^2) * p_x
     676         x    = L* h*x_ref / sqrt( (1 + delta)^2 - px^2 - py^2) * p_x
    677677         
    678          y    = L* h*x_ref / sqrt( (1 + delta)^2 + px^2 + py^2) * p_y
     678         y    = L* h*x_ref / sqrt( (1 + delta)^2 - px^2 - py^2) * p_y
    679679         
    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)
    681681                                                                                           
    682682    where
     
    826826//          x[ct_]+= (1+x0[delta_])*L*h_bend*h_ref + (1+x0[delta_])*h_ref*(asin(n1) - asin(n2));
    827827// 
    828           }//approximate Hamiltonian
    829           else {
    830           x[px_] -= L * (ByoBrho + (h_bend - h_ref) / 2.0 + h_ref * h_bend
     828          }//approximate Hamiltonian
     829          else {
     830            x[px_] -= L * (ByoBrho + (h_bend - h_ref) / 2.0 + h_ref * h_bend
    831831                    * x0[x_] - h_ref * 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_]));
     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_]));
    839839         }
    840840         
     
    922922    if (true) {
    923923     
    924       //  cout << "With Alex's  correction: " << endl;
     924        //cout << "With Alex's  correction: " << endl;
    925925     
    926926      //with the contribution from the entrance angle of the particle at the edge
     
    13081308                 EdgeFocus(M->Pirho, M->PTx1, M->Pgap, x,true);
    13091309         } else {//small and big rings
    1310          
    1311          
    1312          
    13131310          if(M->PTx1!=0){
    13141311            EdgeFocus(M->Pirho, x);
    1315            p_rot(M->PTx1,  x);
     1312           //p_rot(M->PTx1,  x);
    13161313             //rotate from cartesian cooridnate to curlinear curved beam coordinate;
    13171314             // since the map of a sector dipole is used in Tracy 3
    13181315          }
     1316           p_rot(M->PTx1,  x);
    13191317           bend_fringe(M->Pirho, M->Pgap, x); //fringe field
    1320        
    1321 
    1322        
    13231318         }
    13241319       }
     
    14311426             
    14321427             bend_fringe(-M->Pirho, M->Pgap,x); //fringe field of the dipole
     1428              p_rot(M->PTx2, x);
    14331429             if(M->PTx2!=0){
    1434               p_rot(M->PTx2, x); //rotate back to the cartesian cooridinate
     1430              //p_rot(M->PTx2, x); //rotate back to the cartesian cooridinate
    14351431            EdgeFocus(M->Pirho, x);
    14361432             }
Note: See TracChangeset for help on using the changeset viewer.