Changeset 5 in MML for trunk/at/atphysics
- Timestamp:
- Dec 18, 2013, 12:39:15 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:ignore
set to
chromMML.txt
-
Property
svn:ignore
set to
-
trunk/at/atphysics/fitchrom2.m
r4 r5 1 function varargout = fitchrom2(newchrom, sextfam1, sextfam2, varargin) 1 function [FinalS1,FinalS2] = fitchrom2(newchrom, sextfam1, sextfam2, varargin) 2 %function varargout = fitchrom2(newchrom, sextfam1, sextfam2, varargin) 2 3 %FITCHROM2 fits chromaticity of THERING using 2 sextupole families 3 4 % FITCHROM2(NEWCHROM,SEXTUPOLEFAMILY1,SEXTUPOLEFAMILY2) … … 23 24 % MARCH 25, 2005 - Take into account thin sextupoles 24 25 % - Display Flag 26 % 27 % 28 % Modified by Jianfeng Zhang 30/09/2013 @ LAL 29 % Display the sextupole strengths after correction. 30 % 31 25 32 26 33 DisplayFlag = 1; … … 107 114 end 108 115 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 109 121 %% Display how good is the fit 110 122 if DisplayFlag … … 112 124 [tune xi] = tunechrom(THERING,0,'chrom'); 113 125 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)); 114 129 end -
trunk/at/atphysics/linopt.m
r4 r5 39 39 % [2] E.Courant, H.Snyder 40 40 % [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 42 45 43 46 … … 120 123 cos_mu_y = trace(B)/2; 121 124 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 122 134 end 123 135 -
trunk/at/atphysics/tunechrom.m
r4 r5 34 34 % 35 35 % 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 % 37 41 DDP_default = 1e-8; 38 42 … … 112 116 TUNE = acos([cos_mu_x,cos_mu_y])/2/pi; 113 117 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 114 128 115 129 if TUNEGUESSFLAG
Note: See TracChangeset
for help on using the changeset viewer.