Changeset 10 in TRACY3 for trunk


Ignore:
Timestamp:
Jan 29, 2013, 10:41:21 AM (11 years ago)
Author:
zhangj
Message:
 
Location:
trunk/tracy
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tracy/tools/soltracy.cc

    r9 r10  
    55*************************************/
    66#define ORDER 1   
    7 
    87//#define ORDER 4   
    98
     
    832831          UserCommandFlag[i]._Phase_ctau,
    833832          UserCommandFlag[i]._Phase_nturn);
    834     printf("the simulation time for phase space in tracy 3 is \n");
     833    printf("6D phase space tracking: \n the simulation time for phase space in tracy 3 is \n");
    835834    stop = stampstop(start);
    836835
  • trunk/tracy/tracy/doc/soltracy3_userManual_developer.tex

    r3 r10  
    10011001Obtain phase space by tracking \\
    10021002
    1003   To calculate phase space, use the command: 
    1004 PhaseSpaceFlag      Phase\_phase\_file      Phase\_Dim     Phase\_X      Phase\_Px
     1003  To calculate phase space, use the command:  \\
     1004\textbf{PhaseSpaceFlag}      Phase\_phase\_file      Phase\_Dim     Phase\_X      Phase\_Px
    10051005                                           Phase\_Y     Phase\_Py   Phase\_delta   Phase\_ctau               
    10061006                                           Phase\_nturn     damping\_flag
     1007
    10071008For example:
    1008 PhaseSpaceFlag   phasespace.out    6D   1e-6    0.0    1e-6   0.0   0.012   0.0   1000   false
    1009 The meanings of parameters and defaults values of PhaseSpaceFlag are shown in table Table . If user uses PhaseSpaceFlag without parameters, then the code will use the default values.
    1010 Table   Parameters of the command PhaseSpaceFlag to calculate phase space.
    1011 Parameter
    1012 Meaning
    1013 Default value
    1014 Phase\_phase\_file
    1015 File to save tracked phase space; saved in the current directory.
    1016 phase.out
    1017 Phase\_Dim
    1018 4D/6D tracking
    1019 4D
    1020 Phase\_X
    1021 Horizontal coordinate at the start point of tracking
    1022 0.0
    1023 Phase\_Px
    1024 Horizontal canonical momentum/derivative at the start point of tracking
    1025 0.0
    1026 Phase\_Y
    1027 vertical coordinate at the start point of tracking
    1028 0.0
    1029 Phase\_Py
    1030 vertical canonical momentum/derivative at the start point of tracking
    1031 0.0
    1032 Phase\_delta
    1033 Energy at the start point of tracking
    1034 0.0
    1035 Phase\_ctau
    1036 Longitudinal position at the start point of tracking
    1037 0.0
    1038 Phase\_nturn
    1039 number of turns for tracking
    1040 512
    1041 Damping\_flag
    1042 Boolean flag to turn on/off the radiation damping during the tracking
    1043 false
     1009\textbf{PhaseSpaceFlag}   phasespace.out    6D   1e-6    0.0    1e-6   0.0   0.012   0.0   1000   false
     1010
     1011The meanings of parameters and defaults values of PhaseSpaceFlag are shown in Table \ref{tab:phasespace-para}.
     1012If user uses PhaseSpaceFlag without parameters, then the code will use the default values.
     1013
     1014\begin{table}[h]
     1015\centering
     1016\caption{Parameters of the command \textbf{PhaseSpaceFlag} to calculate phase space.}
     1017\label{tab:phasespace-para}
     1018\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} p{0.2\linewidth}  p{0.5\linewidth}   p{0.15\linewidth} }
     1019\hline
     1020\hline
     1021\textbf{Symbol}    &  \textbf{Units}               & \textbf{Parameter}    \\
     1022\hline
     1023\textbf{Phase\_phase\_file} & File to save tracked phase space;
     1024                              saved in the current directory.     &    phase.out \\
     1025\textbf{Phase\_Dim}  &  4D~/~6D tracking                            &    4D \\
     1026\textbf{Phase\_X}    &  Horizontal coordinate at the start
     1027                        point of tracking.                        &    0.0 \\
     1028\textbf{Phase\_Px}   &  Horizontal canonical momentum~/~derivative
     1029                        at the start point of tracking.           &    0.0 \\
     1030\textbf{Phase\_Y}    &  Vertical coordinate at the start point
     1031                        of tracking.                              &    0.0 \\
     1032\textbf{Phase\_Py}   &  Vertical canonical momentum~/~derivative
     1033                        at the start point of tracking.           &    0.0 \\
     1034\textbf{Phase\_delta}&  Energy at the start point of tracking     &    0.0 \\
     1035\textbf{Phase\_ctau} &  Longitudinal position at the start point
     1036                        of tracking.                              &    0.0 \\
     1037\textbf{Phase\_nturn}&  Number of turns for tracking              &    512 \\
     1038\textbf{Damping\_flag}& Boolean flag to turn on~/~off the radiation
     1039                        damping during the tracking.              &    false \\
     1040\hline
     1041\hline
     1042\end{tabular*}
     1043\end{table}
     1044
    10441045
    10451046\subsection{IDCorrFlag (Tested for TaiWan light source; TO BE CONTINUE DEVELOPPED.)}
  • trunk/tracy/tracy/src/naffutils.cc

    r3 r10  
    1818
    1919/****************************************************************************/
    20 /* void Trac_Simple4DCOD(double x, double px, double y, double py, double dp, long nmax,
    21                  double Tx[][NTURN], bool *status)
     20/* void Trac_Simple4DCOD(double x, double px, double y, double py, double dp,
     21                 double ctau, long nmax, double Tx[][NTURN], bool *status2)
    2222
    2323   Purpose:
    2424       Single particle tracking around the closed orbit for NTURN turns
    25        The 6D phase trajectory is saved in a array
     25       The 6D phase trajectory is saved in a array, but the
     26       tracked dp and ctau is not about the COD.
    2627
    2728   Input:
  • trunk/tracy/tracy/src/soleillib.cc

    r3 r10  
    16671667 
    16681668  Trac_Simple6DCOD(x,xp,y,yp,energy,ctau,Nbtour,Tab,&status);
     1669
    16691670  for (i = 0; i < Nbtour; i++) {
    16701671    fprintf(outf,"% .5e % .5e % .5e % .5e % .5e % .5e\n",
    16711672            Tab[0][i],Tab[1][i],Tab[2][i],Tab[3][i],Tab[4][i],Tab[5][i]);
    16721673  }
     1674  //  cout << "status is: " << status << endl;
    16731675  fclose(outf);
    16741676}
  • trunk/tracy/tracy/src/t2elem.cc

    r9 r10  
    8989    ps = 1+delta   
    9090   
     91   
    9192    For exact hamitonian:
    9293   
    93     ps = sqrt((1+delta)^2 - px_^2 - py_^2)
     94    (1) ps = sqrt((1+delta)^2 - px_^2 - py_^2)
     95   
     96    (2) using the check of TEAPOT to check ps < 0
    9497 **********************************************************/
    9598template<typename T>
     
    827830// 
    828831          }//approximate Hamiltonian
    829           else {
     832          else {//first order map
    830833            x[px_] -= L * (ByoBrho + (h_bend - h_ref) / 2.0 + h_ref * h_bend
    831834                    * x0[x_] - h_ref * x0[delta_]);
    832835            x[ct_] += L * h_ref * x0[x_];
    833836 
    834          //  second order of the h_ref
    835             u = L * h_ref * x0[x_] /(1.0+x[delta_]);
     837            //  second order of the h_ref; has problem when do tracking...
     838           u = L * h_ref * x0[x_] /(1.0+x[delta_]);
    836839            x[x_] += u * x0[px_];
    837840            x[y_] += u * x0[py_];
    838841            x[ct_] += u*(sqr(x0[px_])+sqr(x0[py_]))/(2.0*(1.0+x0[delta_]));
    839          }
     842           
     843            }
    840844         
    841845        }//from other straight magnets
     
    11161120template<typename T>
    11171121void bend_fringe(double hb, double gap, ss_vect<T> &x) {
    1118    
     1122 
     1123  bool track=false;
     1124 
     1125  if(track) cout << "bend_fringe(): Forest's model"<<endl;
     1126 
    11191127    T coeff1,coeff2,coeff3,coeff4;
    11201128    T ps, ps2, ps3, ps5;
     
    13061314       if (M->Pirho != 0.0 && M->dipEdge_effect1 == 1){
    13071315         if (!globval.H_exact) { //big ring */
    1308                  EdgeFocus(M->Pirho, M->PTx1, M->Pgap, x,true);
    1309          } else {//small and big rings
     1316           //            EdgeFocus(M->Pirho, M->PTx1, M->Pgap, x,true);
     1317           //} else {//small and big rings
    13101318          if(M->PTx1!=0){
    13111319            EdgeFocus(M->Pirho, x);
     
    14211429             if (M->Pirho != 0.0 && M->dipEdge_effect2 == 1){
    14221430            if (!globval.H_exact) { //big ring
    1423                  EdgeFocus(M->Pirho, M->PTx2, M->Pgap, x,false);
    1424             }else{
     1431              //                 EdgeFocus(M->Pirho, M->PTx2, M->Pgap, x,false);
     1432              // }else{
    14251433             
    14261434             
Note: See TracChangeset for help on using the changeset viewer.