Changeset 5 in MML
- Timestamp:
- Dec 18, 2013, 12:39:15 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 126 added
- 5 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:ignore
set to
chromMML.txt
-
Property
svn:ignore
set to
-
trunk/at/atmexall.m
r4 r5 7 7 % For Linux platform -ldl is need (personal laptop) 8 8 % PLATFORMOPTION = ['-ldl -D',computer,' ']; 9 % 10 % 11 % Modified by Jianfeng Zhang @ LAL, 13/02/2013 12 % Added the mex compile for 64 bit linux platform. 13 % 9 14 10 15 StartDir = pwd; … … 37 42 PLATFORMOPTION = ['-D',computer,' ']; 38 43 case 'GLNX86' 39 PLATFORMOPTION = ['-ldl -D',computer,' ']; % added by Laurent April 6th, 2007 44 PLATFORMOPTION = ['-ldl -D',computer,' ']; % added by Laurent April 6th, 2007; 32 bit 45 case 'GLNXA64' 46 PLATFORMOPTION = ['-ldl -D',computer,' ']; % added by Jianfeng ZHANG Feb. 13th, 2012; 64 bit platform 40 47 case 'PCWIN' 41 PLATFORMOPTION = ['-D',computer,' ']; 48 PLATFORMOPTION = ['-D',computer,' '];%windows 42 49 case 'MACI64' 43 PLATFORMOPTION = ['-D',computer,' LDFLAGS=''-pthread -shared -m64'' ']; 50 PLATFORMOPTION = ['-D',computer,' LDFLAGS=''-pthread -shared -m64'' ']; %added by L. Nadolski for MAC 44 51 otherwise 45 52 error('Platform not defined'); -
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 -
trunk/at/simulator/element/DriftPass.c
r4 r5 13 13 r_in - 6-by-N matrix of initial conditions reshaped into 14 14 1-d array of 6*N elements 15 16 map from the first order expanded Hamiltonian, the same 17 as in Tracy3 Drift() in t2elem.cc 15 18 */ 16 19 { int c, c6; -
trunk/at/simulator/element/StrMPoleSymplectic4Pass.c
r4 r5 54 54 i = 0 .. MaxOrder 55 55 56 57 The same kick map as in Tracy 3 for straight magnets: 58 px = L*(-By/Brho); 59 py = L*(Bx/Brho); 56 60 ******************************************************************************/ 57 61 { int i; … … 59 63 double ImSum = A[max_order]; 60 64 double ReSumTemp; 65 /* get the effective field strength; the same routine as in TRACY*/ 61 66 for(i=max_order-1;i>=0;i--) 62 67 { ReSumTemp = ReSum*r[0] - ImSum*r[2] + B[i]; … … 74 79 in the loop if momentum deviation (delta) does not change 75 80 such as in 4-th order symplectic integrator w/o radiation 81 82 The same kick map as in TRACY: (approximate expended Hamiltonian H ~= H1+H2+o(3)) 83 x += L*px/(1+delta) 84 y += L*py/(1+delta) 85 (-CT) += -L*(px^2+py^2)/2/(1+delta)^2 76 86 */ 77 87 78 { double dx = NormL*r[1]; 79 double dy = NormL*r[3]; 88 { double dx = NormL*r[1]; /*px/(1+delta)*/ 89 double dy = NormL*r[3];/*px/(1+delta)*/ 80 90 r[0]+= dx; 81 91 r[2]+= dy; … … 83 93 } 84 94 95 /* 96 4th order symplectic map, using the expanded Hamiltonian as in TRACY 3: H = H1 + H2 + O(3) 97 */ 85 98 void StrMPoleSymplectic4Pass(double *r, double le, double *A, double *B, 86 99 int max_order, int num_int_steps, -
trunk/at/simulator/element/atlalib.c
r4 r5 2 2 Matrix and Vector algebra operations for Accelerator Toolbox 3 3 A.Terebilo 8/14/00 4 4 5 Math library 5 6 6 7 1. Use mxCalloc, mxMalloc , mxFree for memory allocation/deallocation … … 64 65 } 65 66 67 /* 68 drift kick from the first order of expended Hamiltonian H1. 69 The same as in Tracy 3 Drift(double L, ss_vect<T> &x) in t2elem.cc 70 */ 66 71 void ATdrift6(double* r, double L) 67 72 /* Input parameter L is the physical length -
trunk/at/simulator/element/atphyslib.c
r4 r5 6 6 April 29, 2011: According to note SSC-141 by E. Forest, energy dependance in only in V-plane 7 7 But series is diverging (close to mad8 results for LNLS) 8 9 Comments: 10 (1) Jianfeng Zhang @ LAL, 03/2013 11 Add the second order dipole fringe field model for ThomX. 8 12 */ 9 13 -
trunk/at/simulator/element/elempass.h
r4 r5 1 /* Header file for the element pass-functions */ 1 /* Header file for the element pass-functions 2 3 4 Set up for 64 bit linux platform. 5 Modified by Jianfeng ZHANG @ LAL, 12/02/2013 6 */ 7 8 2 9 3 10 #if defined(PCWIN) 4 #define ExportMode __declspec(dllexport) 11 #define ExportMode __declspec(dllexport) /*windows version matlab*/ 5 12 #include <float.h> 6 #elif defined(GLNX86) 13 #elif defined(GLNX86) /*32 bit linux version matlab*/ 14 #define ExportMode 15 #elif defined(GLNXA64) /*64 bit linux version matlab, added by Jianfeng Zhang for ubuntu 12.04, Mac Pro. 8.2*/ 7 16 #define ExportMode 8 17 #elif defined(ALPHA) … … 10 19 #elif defined(SOL2) 11 20 #define ExportMode 12 #elif defined(MACI64) /* added by L SNfor MAC Snow Leopard */21 #elif defined(MACI64) /* added by L.S. Nadolski for MAC Snow Leopard */ 13 22 #define ExportMode 14 23 #else -
trunk/at/simulator/element/mexpassmethod.m
r4 r5 35 35 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m32 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNX86.map''',' ']; 36 36 case 'GLNXA64' 37 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNXA64.map''',' ']; 37 %PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNXA64.map''',' ']; 38 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64 -Wl''',' ']; 38 39 case 'MACI64' 39 40 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64''',' ']; -
trunk/at/simulator/element/user/elempass.h
r4 r5 1 /* Header file for the element pass-functions */ 1 /* Header file for the element pass-functions 2 3 4 Add the mex compile for 64 bit linux platform. 5 By Jianfeng ZHANG @ LAL, 13/02/2013. 6 */ 7 2 8 3 9 #if defined(PCWIN) … … 5 11 #include <float.h> 6 12 #elif defined(GLNX86) 13 #define ExportMode 14 #elif defined(GLNXA64) /*64 bit linux version matlab, added by Jianfeng Zhang for ubuntu 12.04, Mac Pro. 8.2*/ 7 15 #define ExportMode 8 16 #elif defined(ALPHA) -
trunk/at/simulator/element/user/mexuserpassmethod.m
r4 r5 9 9 % The second argument is a list of options passed to the 'mex' script 10 10 % 11 % Examples: mexpassmethod('DriftPass','-v') 11 % Examples: 12 12 13 % mexpassmethod('all','-argcheck') 13 14 % mexpassmethod({'DriftPass','BendLinearPass'}) … … 20 21 % 21 22 % See also: file:elempass.h 23 % 24 % 25 % Modified the mex compiler options for 64 bit linux platform. 26 % Modified by Jianfeng Zhang @ LAL, 13/02/2013. 27 % 28 22 29 23 30 PLATFORMOPTION = ['-D',computer,' ']; … … 34 41 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m32 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNX86.map''',' ']; 35 42 case 'GLNXA64' 36 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNXA64.map''',' ']; 43 % PLATFORMOPTION = [PLATFORMOPTION,['LDFLAGS=''-pthread -shared ' ... 44 % '-m64 -Wl,--version-script,'],atroot,'/simulator/element/mexFunctionGLNXA64.map''',' ']; 45 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64 -Wl''',' ']; 37 46 case 'MACI64' 38 47 PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m64''',' ']; -
trunk/at/simulator/element/user/rbend3.m
r4 r5 1 function z=rbend3(fname,L,A,A1,A2,K, gap, FF1, FF2, method)2 % BEND2('FAMILYNAME', Length[m], BendingAngle[rad], EntranceAngle[rad],1 function z=rbend3(fname,L,A,A1,A2,K,gap,EdgeEffect1,EdgeEffect2, method) 2 %RBEND2('FAMILYNAME', Length[m], BendingAngle[rad], EntranceAngle[rad], 3 3 % ExitAngle[rad], K, gap, F1, F2, 'METHOD') 4 4 % creates a new family in the FAMLIST - a structure with fields 5 % FamName family name 6 % Length length of the arc for an on-energy particle [m] 7 % BendingAngle total bending angle [rad] 8 % EntranceAngle [rad] (0 - for sector bends) 9 % ExitAngle [rad] (0 - for sector bends) 10 % ByError error in the dipole field relative to the design value 11 % K quadrupole K-value for combined funtion bends 12 % gap FullGap 13 % PassMethod name of the function to use for tracking 5 % FamName family name 6 % Length length of the arc for an on-energy particle [m] 7 % BendingAngle total bending angle [rad] 8 % EntranceAngle [rad] (0 - for sector bends) 9 % ExitAngle [rad] (0 - for sector bends) 10 % ByError error in the dipole field relative to the design value 11 % K quadrupole K-value for combined funtion bends 12 % gap FullGap 13 % EdgeEffect1 flag to turn on (1) or off (0) the dipole 14 % fringe field and edge focus at the entrance 15 % of the dipole 16 % EdgeEffect2 flag to turn on (1) or off (0) the dipole 17 % fringe field and edge focus at the exit 18 % of the dipole 19 % PassMethod name of the function to use for tracking 14 20 % returns assigned address in the FAMLIST that is uniquely identifies 15 21 % the family 16 17 22 % 18 23 % Added by Laurent S. Nadolski, SOLEIL, 03/04 24 % 25 % 26 % Modified by Jianfeng Zhang @ LAL, 29/04/2013 27 % to fix the bug to turn on/off dipole FF and edge effects in 28 % sector dipoles. 19 29 20 30 ElemData.FamName = fname; % add check for identical family names … … 28 38 ElemData.K = K; 29 39 ElemData.FullGap = gap; 30 ElemData.FringeInt1 = 0.5*FF1; % same convention as in Tracy II 31 ElemData.FringeInt2 = 0.5*FF2; % same convention as in Tracy II 40 ElemData.FringeInt1 = 0.5; % same convention as in Tracy II 41 ElemData.FringeInt2 = 0.5; % same convention as in Tracy II 42 ElemData.EdgeEffect1 = EdgeEffect1;% flag to turn on (1) or off (0) edge 43 % effects and fringe field at the 44 % entrance of the dipole. 45 % Added by Jianfeng Zhang @ LAL, 46 % 29/04/2013 47 ElemData.EdgeEffect2 = EdgeEffect2;% flag to turn on (1) or off (0) edge 48 % effects and fringe field at the 49 % exit of the dipole. 50 % Added by Jianfeng Zhang @ LAL, 51 % 29/04/2013 32 52 33 ElemData.R1 = diag(ones(6,1)); 53 54 ElemData.R1 = diag(ones(6,1)); %rotation error 34 55 ElemData.R2 = diag(ones(6,1)); 35 ElemData.T1 = zeros(1,6); 56 ElemData.T1 = zeros(1,6); %displacement error 36 57 ElemData.T2 = zeros(1,6); 37 58 38 ElemData.PolynomA = [0 0 0 0]; 39 ElemData.PolynomB = [0 K 0 0]; 59 ElemData.PolynomA = [0 0 0 0]; %skew component of field 60 ElemData.PolynomB = [0 K 0 0]; %normal component of field 40 61 ElemData.PassMethod = method; 41 62 -
trunk/at/simulator/track/atpass.c
r4 r5 1 1 /* Tracking engine ATPASS for Accelerator Toolbox 1.3 */ 2 2 3 /* Modification: Laurent S. Nadolski, April 7th, 2007 3 /*(1) 4 Modification: Laurent S. Nadolski, April 7th, 2007 4 5 * Add check on argument otherwise it crashes with no argument 5 6 * April 22nd, 2011. Removed Limit for coordinates ctau 7 8 (2) 9 Add the platform for 64 bit computer. 10 %Modified by Jianfeng Zhang @ LAL, 13/02/2013. 11 6 12 */ 7 13 … … 10 16 #include <string.h> 11 17 18 /* windows platform */ 12 19 #if defined(PCWIN) 13 20 #include <windows.h> … … 28 35 #define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction") 29 36 37 /* 32 bit linux platform */ 30 38 #elif defined(GLNX86) 31 39 #include <dlfcn.h> … … 37 45 #define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction") 38 46 47 /* 64 bit linux platform */ 48 #elif defined(GLNXA64) 49 #include <dlfcn.h> 50 #define MEXEXTENSIONSTRING ".mexglxa64" 51 #define PASSMETHODSUBDIRSTRING "/simulator/element/" 52 #define LIBRARYHANDLETYPE void* 53 #define FREELIBFCN(libfilename) dlclose(libfilename) 54 #define LOADLIBFCN(libfilename) dlopen((libfilename),RTLD_LAZY) 55 #define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction") 56 39 57 #elif defined(SOL2) 40 58 #include <dlfcn.h> … … 46 64 #define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction") 47 65 66 /* MAC platform */ 48 67 #elif defined(MACI64) 49 68 #include <dlfcn.h> … … 294 313 default: 295 314 296 mexPrintf("Element #%d\tPassMethod: '%s'\n", n, method_names[n]);315 mexPrintf("Element #%d\tPassMethod: '%s '\n", n, method_names[n]); 297 316 mexErrMsgTxt("Specified PassMethod is not on MATLAB search path"); 298 317 } -
trunk/machine/SOLEIL/LT2/LT2init.m
r4 r5 407 407 AO.(ifam).DeviceList = family2dev(ifamQ); 408 408 AO.(ifam).ElementList = family2elem(ifamQ); 409 AO.(ifam).GroupId = tango_group_create('Dipole');409 %AO.(ifam).GroupId = tango_group_create('Dipole'); 410 410 AO.(ifam).DeviceName = 'LT2/AE/cycleD.1'; 411 411 %add devices to group 412 tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName);412 %tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName); 413 413 %AO.(ifam).Inom = 180; 414 414 AO.(ifam).Imax = 580; … … 436 436 AO.(ifam).ElementList = family2elem(ifamQ); 437 437 %add devices to group 438 AO.(ifam).GroupId = tango_group_create('COR');439 tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName');438 %AO.(ifam).GroupId = tango_group_create('COR'); 439 %tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName'); 440 440 AO.(ifam).Inom = [1 2 3]; 441 441 AO.(ifam).Imax = 7.9*ones(1,3); … … 461 461 AO.(ifam).ElementList = family2elem(ifamQ); 462 462 %add devices to group 463 AO.(ifam).GroupId = tango_group_create('COR');464 tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName');463 %AO.(ifam).GroupId = tango_group_create('COR'); 464 %tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName'); 465 465 %AO.(ifam).Inom = [1 2 3]; 466 466 AO.(ifam).Imax = 7.9*ones(1,5); … … 486 486 AO.(ifam).ElementList = family2elem(ifamQ); 487 487 %add devices to group 488 AO.(ifam).GroupId = tango_group_create('Quadrupole');489 tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName');488 %AO.(ifam).GroupId = tango_group_create('Quadrupole'); 489 %tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName'); 490 490 nb = length(AO.(ifam).ElementList); 491 491 AO.(ifam).Imax = [274 -349 -274 274 274 -274 274 ]; -
trunk/machine/SOLEIL/LT2/aoinit.m
r4 r5 26 26 addpath(fullfile(MMLROOT, 'mml'),'-begin'); 27 27 28 disp(['TANGO/MATLAB binding version: ' tango_version])28 %disp(['TANGO/MATLAB binding version: ' tango_version]) 29 29 disp('Startup file for Matlab Middle Layer read with success'); 30 30 -
trunk/machine/SOLEIL/StorageRing/aoinit.m
r4 r5 71 71 else 72 72 % Dedicated directory for development (not operation) modes on Hyperion 73 addpath(fullfile(getdvptdirectory, 'StorageRingDvptData'));73 %addpath(fullfile(getdvptdirectory, 'StorageRingDvptData')); 74 74 addpath(fullfile(MMLROOT, 'machine', 'SOLEIL', 'StorageRing', 'RadiaMapGui')); 75 75 end -
trunk/mml/at/atsummary.m
r4 r5 12 12 % Written by Eugene Tan 13 13 % Revised by Laurent S. Nadolski 14 14 % 15 % Customize the default values for ThomX ring 16 % by Jianfeng Zhang @ LAL, 03/2013 15 17 16 18 global THERING GLOBVAL … … 58 60 H1 = beta(i,1)*D_x_(i)*D_x_(i)+2*alpha(i)*D_x(i)*D_x_(i)+gamma(i)*D_x(i)*D_x(i); 59 61 H0 = beta(i+1,1)*D_x_(i+1)*D_x_(i+1)+2*alpha(i+1)*D_x(i+1)*D_x_(i+1)+gamma(i+1)*D_x(i+1)*D_x(i+1); 60 sum.integrals(5) = sum.integrals(5) + THERING{i}.Length*(H1+H0)*0.5/( rho^3);62 sum.integrals(5) = sum.integrals(5) + THERING{i}.Length*(H1+H0)*0.5/(abs(rho)^3); 61 63 % if H1+H0 < 0 62 64 % fprintf('%f %i %s\n', H1+H0, i, THERING{i}.FamName) … … 83 85 84 86 % Slip factor 85 sum.etac = sum.gamma^(-2) - sum.compactionFactor;87 sum.etac = sum.gamma^(-2) - sum.compactionFactor; 86 88 87 89 cavind = findcells(THERING,'HarmNumber'); … … 91 93 else 92 94 % Default 93 freq = 352.202e6;94 v_cav = 3 e6;95 freq = 499.96092; 96 v_cav = 300e3; 95 97 end 96 98 sum.harmon = sum.circumference/(2.99792458e8/freq); % Assuming 499.654MHz RF … … 124 126 fprintf(' V: \t\t%+4.5f\n', sum.chromaticity(2)); 125 127 fprintf(SeparatorString); 126 fprintf(' Synchrotron Integral 1: \t% 4.5e [m]\n', sum.integrals(1));127 fprintf(' 128 fprintf(' 129 fprintf(' 130 fprintf(' 131 fprintf(' 128 fprintf(' Radiation Integral 1: \t% 4.5e [m]\n', sum.integrals(1)); 129 fprintf(' 2: \t% 4.5e [m^-1]\n', sum.integrals(2)); 130 fprintf(' 3: \t% 4.5e [m^-2]\n', sum.integrals(3)); 131 fprintf(' 4: \t% 4.5e [m^-1]\n', sum.integrals(4)); 132 fprintf(' 5: \t% 4.5e [m^-1]\n', sum.integrals(5)); 133 fprintf(' 6: \t% 4.5e [m^-1]\n', sum.integrals(6)); 132 134 fprintf(' Damping Partition H: \t% 4.5f\n', sum.damping(1)); 133 135 fprintf(' V: \t% 4.5f\n', sum.damping(2)); … … 142 144 fprintf(SeparatorString); 143 145 fprintf(' Assuming cavities Voltage: \t% 4.5f [kV]\n', v_cav/1e3); 144 fprintf(' Frequency: \t%4. 5f [MHz]\n', freq/1e6);146 fprintf(' Frequency: \t%4.6f [MHz]\n', freq/1e6); 145 147 fprintf(' Harmonic Number: \t% 4.5f\n', sum.harmon); 146 148 fprintf(' Overvoltage factor: \t\t% 4.5f\n', sum.overvoltage); 147 fprintf(' Synchronous Phase: \t\t% 4. 5f [rad] (%4.5f [deg])\n', sum.syncphase, sum.syncphase*180/pi);149 fprintf(' Synchronous Phase: \t\t% 4.10f [rad] (%4.10f [deg])\n', sum.syncphase, sum.syncphase*180/pi); 148 150 fprintf(' Linear Energy Acceptance: \t% 4.5f%%\n', sum.energyacceptance*100); 149 151 fprintf(' Synchrotron Tune: \t\t% 4.5f (%4.5f kHz or %4.2f turns) \n', sum.synctune, sum.synctune/sum.revTime*1e-3, 1/sum.synctune); -
trunk/mml/at/getcod.m
r4 r5 4 4 % deviation DP. It calls FINDORBIT4 which assumes a lattice 5 5 % with NO accelerating cavities and NO radiation 6 6 % 7 % By Jianfeng Zhang @ LAL, 10/2013 8 % Modified to get 6D COD 9 % 7 10 8 11 if nargin < 1 … … 15 18 %localspos = findspos(THERING,1:length(RING)+1); 16 19 orbit = findorbit4(THERING,DP,1:length(THERING)+1); 20 %orbit = findorbit6(THERING,DP,1:length(THERING)+1); -
trunk/mml/at/getpvmodel.m
r4 r5 55 55 % 12/12/05 BPMx, BPMz, HCOR and VCOR getroll and getcrunch commented since too slow 56 56 % add in bpm and corrector other names (machine dependent?) 57 % 58 % Need to customized for ThomX in the future...(with the real devices (mangets...) parameters) 59 % by Jianfeng Zhang @ LAL, 60 % 07/10/2013 61 % 57 62 58 63 global THERING THERINGCELL … … 800 805 AM(i,1) = THERING{ATIndexList(i)}.BendingAngle; 801 806 % Modif: Laurent to be consistent, has to return an energy 802 %AM(i,1) = getenergymodel;807 AM(i,1) = getenergymodel; 803 808 end 804 809 -
trunk/mml/at/gotoat.m
r4 r5 1 1 function gotoat 2 % 3 % 4 % modified by Jianfeng Zhang @ LAL, 26/09/2013 5 % Fix the bug to get atroot. 6 % 7 % 2 8 3 cd(getenv('ATROOT')); 9 cd(atroot); 10 11 %cd(getenv('ATROOT')); 4 12 5 13 % if strcmp(computer,'PCWIN') == 1 -
trunk/mml/measchro.m
r4 r5 84 84 % 85 85 % Written by Greg Portmann and Jeff Corbett 86 87 86 % 88 87 % Written by Gregory J. Portmann 89 88 % Modified by Laurent S. Nadolski 89 % 90 % 91 % Modified by Jianfeng Zhang for ThomX ring @ LAL, 10/2013 92 % Change the RF step to a large value for ThomX ring to get 93 % a reasonal energy offset. 94 % 95 % 90 96 91 97 NRFSteps = 1; … … 296 302 end 297 303 elseif strcmpi(RFUnitsString, 'Hz') 298 if abs(max(DeltaRF)-min(DeltaRF)) > 1000 ; % Hz304 if abs(max(DeltaRF)-min(DeltaRF)) > 1000*1e2; % Hz 299 305 tmp = questdlg(sprintf('%f Hz is a large RF change. Do you want to continue?', abs(max(DeltaRF)-min(DeltaRF))),'Dispersion Measurement','YES','NO','YES'); 300 306 if strcmp(tmp,'NO') -
trunk/mml/measchroresp.m
r4 r5 91 91 StructOutputFlag = 0; 92 92 MatrixFlag = 1; 93 DisplayFlag = -1;93 DisplayFlag = 1; 94 94 ArchiveFlag = -1; 95 95 FileName = -1; -
trunk/mml/setpathmml.m
r4 r5 13 13 % Written by Greg Portmann 14 14 % Updated by Igor Pinayev 15 15 % 16 % Update for ThomX by Jianfeng Zhang @ LAL 17 % (1) set linkflag for ThomX 18 % 16 19 17 20 % Inputs: MachineName, SubMachineName, MachineType, LinkFlag, MMLROOT … … 154 157 case {'VUV','XRAY'} 155 158 LinkFlag = 'UCODE'; 156 case {' ALBA','SOLEIL'}159 case {'THOMX','ALBA','SOLEIL'} 157 160 LinkFlag = 'Tango'; 158 161 otherwise … … 244 247 %addpath(fullfile(MMLROOT,'links','tango'),'-begin'); 245 248 versionName = version('-release'); 249 %need to set for THOMX in the future (17/07/2013 by ZHANG) 246 250 TANGOROOT = getenv('SOLEIL_ROOT'); 247 251 %need to set for THOMX in the future (17/07/2013 by ZHANG) 248 252 [statuss WHO] = system('whoami'); 249 253 % system gives back an visible character: carriage return! … … 305 309 306 310 % Machine directory 307 if ~isempty(MachineName) && ~isempty(SubMachineName)311 if ~isempty(MachineName) && ~isempty(SubMachineName) 308 312 % New MML path 309 313 addpath(fullfile(MMLROOT, 'machine', MachineName, SubMachineName),'-begin'); -
trunk/mml/steptune.m
r4 r5 35 35 % Modified by Laurent S. Nadolski 36 36 % 06/01/06 - Introduction of ActuatorFamily as a input 37 % 37 38 38 39 % Initialize … … 128 129 129 130 130 % 2. Square matrix solution 131 %DelQuad = inv(TuneResponseMatrix) * DeltaTune;131 % 2. Square matrix solution; 132 %DelQuad = inv(TuneResponseMatrix) * DeltaTune; 132 133 133 134
Note: See TracChangeset
for help on using the changeset viewer.