Changeset 5 in MML for trunk/at/atphysics


Ignore:
Timestamp:
Dec 18, 2013, 12:39:15 PM (11 years ago)
Author:
zhangj
Message:

ThomX MML version on the LAL server @ 17/12/2013

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      chromMML.txt
  • trunk/at/atphysics/fitchrom2.m

    r4 r5  
    1 function varargout =  fitchrom2(newchrom, sextfam1, sextfam2, varargin)
     1function [FinalS1,FinalS2] =  fitchrom2(newchrom, sextfam1, sextfam2, varargin)
     2%function varargout =  fitchrom2(newchrom, sextfam1, sextfam2, varargin)
    23%FITCHROM2 fits chromaticity  of THERING using 2 sextupole families
    34%  FITCHROM2(NEWCHROM,SEXTUPOLEFAMILY1,SEXTUPOLEFAMILY2)
     
    2324%  MARCH 25, 2005 - Take into account thin sextupoles
    2425%                 - Display Flag
     26%
     27%
     28%   Modified by Jianfeng Zhang 30/09/2013 @ LAL
     29%   Display the sextupole strengths after correction.
     30%
     31
    2532
    2633DisplayFlag = 1;
     
    107114end
    108115
     116%% Get the final value of the correction sextupole
     117
     118   FinalS1 = getcellstruct(THERING,'PolynomB',S1I,3);
     119   FinalS2 = getcellstruct(THERING,'PolynomB',S2I,3);
     120 
    109121%% Display how good is the fit
    110122if DisplayFlag
     
    112124    [tune xi] = tunechrom(THERING,0,'chrom');
    113125    fprintf('Reached chromaticities xix=%f xiz=%f\n',xi);
     126   
     127    fprintf('before correction: %s = %f, %s = %f\n', sextfam1,InitialS1(1),sextfam2,InitialS2(1));
     128    fprintf('after correction:  %s = %f, %s = %f\n', sextfam1,FinalS1(1),sextfam2,FinalS2(1));
    114129end
  • trunk/at/atphysics/linopt.m

    r4 r5  
    3939%   [2] E.Courant, H.Snyder
    4040%   [3] D.Sagan, D.Rubin Phys.Rev.Spec.Top.-Accelerators and beams, vol.2 (1999)
    41 
     41%
     42%
     43% Fix the bug to avoid the mirror tunes.
     44% By Jianfeng Zhang @ LAL, 04/10/2013
    4245 
    4346
     
    120123   cos_mu_y = trace(B)/2;
    121124   varargout{1} = acos([cos_mu_x cos_mu_y])/2/pi;
     125   
     126   %avoid the mirror tune using the value of sin(phi)
     127   % By Jianfeng Zhang @ LAL, 04/10/2013
     128   if A(1,2)<0
     129       varargout{1}(1) = 1 -varargout{1}(1);
     130   end
     131    if B(1,2)<0
     132       varargout{1}(2) = 1 -varargout{1}(2);
     133   end
    122134end
    123135
  • trunk/at/atphysics/tunechrom.m

    r4 r5  
    3434%   
    3535% See also LINOPT, TWISSRING, TWISSLINE, NUMDIFPARAMS
    36 
     36%
     37%
     38%  %  07/10/2013 by Jianfeng Zhang @ LAL
     39%  Fix the bug to avoid the mirror tunes.
     40%
    3741DDP_default = 1e-8;
    3842
     
    112116TUNE = acos([cos_mu_x,cos_mu_y])/2/pi;
    113117
     118%avoid the mirror tune using the value of sin(phi)
     119   % By Jianfeng Zhang @ LAL, 04/10/2013
     120   if M44(1,2)<0
     121       TUNE(1) = 1 -TUNE(1);
     122   end
     123    if M44(3,4)<0
     124       TUNE(2) = 1 -TUNE(2);
     125   end
     126
     127
    114128
    115129if TUNEGUESSFLAG
Note: See TracChangeset for help on using the changeset viewer.