Changeset 28 in MML
- Timestamp:
- Mar 12, 2014, 3:34:59 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LOGFILE_thomx.m
r27 r28 177 177 the names of the 4 first initials as "BEND...". 178 178 *************** 179 180 **************** 181 05/03/2014 182 183 Modified "setpvmodel.m" and "getpvmodel.m", now the values of TL ... 184 dipoles can be modified or read back by the bending angles 185 with the physics unit [rad], through the functions "setsp()" 186 or "getsp()". While the dipoles in the storage ring are still 187 connected to the beam energy as before. 188 *************** 189 -
trunk/at/atphysics/findorbit4.m
r4 r28 74 74 end 75 75 RMATf = linepass(RING,RMATi); 76 Rf = RMATf(:,5); 76 Rf = RMATf(:,5); %energy 77 77 % compute the transverse part of the Jacobian 78 78 J4 = [RMATf(1:4,1:4)-RMATf(1:4,5)*ones(1,4)]/d; -
trunk/at/simulator/track/linepass.m
r4 r28 27 27 % to different REFPTS 28 28 % FOR EXAMPLE: 29 % if Rin is 6-by-2 ma id of two 6-by-1 column vectors [Rin1, Rin2]29 % if Rin is 6-by-2 mad of two 6-by-1 column vectors [Rin1, Rin2] 30 30 % and REFPTS = [N1 N2 N3] so that N1<N2<N3 31 31 % the output is [Rout1(N1) Rout2(N1) Rout1(N2) Rout2(N2) Rout1(N3) Rout2(N3)] -
trunk/machine/THOMX/StorageRing/Lattices/CDR_017_064_r56_02_sx_Dff_1_cro0_NoDipFF.m
r5 r28 1 function varargout = CDR_017_064_r56_02_sx_Dff_1_cro0_NoDipFF 1 2 %************************************************ 2 3 % … … 39 40 % NAME L U[V] f[Hz] h method 40 41 %CAV = rfcavity('CAV' , 0.0 , 0*300.0e+3 , HarmNumber*C0/L0, HarmNumber ,'CavityPass'); 41 CAV = rfcavity('CAV' , 0.0 , 0 , HarmNumber*C0/L0, HarmNumber,'CavityPass'); 42 42 RF = rfcavity('RF' , 0.0 , 0 , HarmNumber*C0/L0, HarmNumber,'CavityPass'); 43 44 %!------------------------------------} 45 %! DRIFT } 46 %!------------------------------------} 43 47 SD0 =drift('SD0',0.1000000E+00, 'DriftPass'); 44 48 SD1 =drift('SD1',0.1300000E+00, 'DriftPass'); … … 52 56 SD3S =drift('SD3S', 0.6000000E-01, 'DriftPass'); 53 57 SD3S1 =drift('SD3S1', 0.1400000E+00, 'DriftPass'); 54 58 59 %!------------------------------------} 60 %! DIPOLE } 61 %!------------------------------------} 55 62 L = 0.27646; 56 63 theta = 0.785398; … … 62 69 COE = drift('COE',0.0,'DriftPass'); 63 70 COS = drift('COS',0.0,'DriftPass'); 64 %DIP = rbend2('DIP', L, theta, thetae, thetas, K, 0.0,...65 %'BndMPoleSymplectic4Pass');71 BEND = rbend2('BEND', L, theta, thetae, thetas, K, 0.0,... 72 'BndMPoleSymplectic4Pass'); 66 73 67 DIP = rbend3('DIP', L, theta, thetae, thetas, K, 0.0,... 68 edge_effect1,edge_effect2,'BndMPoleSymplecticNew4Pass'); 69 74 % DIP = rbend3('DIP', L, theta, thetae, thetas, K, 0.0,... 75 % edge_effect1,edge_effect2,'BndMPoleSymplecticNew4Pass'); 76 77 78 %!------------------------------------} 79 %! QUADRUPOLE } 80 %!------------------------------------} 70 81 LQP = 0.15; % quadrupole length 71 82 QPassMethod = 'StrMPoleSymplectic4Pass'; % tracking method … … 76 87 QP31=quadrupole('QP31',LQP,-.1192025E+02,QPassMethod); 77 88 QP41=quadrupole('QP41',LQP,0.9056717E+01,QPassMethod); 89 78 90 91 %!----------------------------------} 92 %! SEXTUPOLE } 93 %!----------------------------------} 79 94 LSX = 0.1000000E-05; 80 95 SPassMethod = 'StrMPoleSymplectic4Pass'; … … 84 99 SX3 =sextupole('SX3', LSX, -.1901670E+07*1, SPassMethod); 85 100 101 %% ======================= 102 % BPM 103 %======================== 104 % horizontal 105 BPMx = marker('BPMx', 'IdentityPass'); 106 % vertical 107 BPMz = marker('BPMz', 'IdentityPass'); 108 109 %% ======================= 110 % correctors 111 %========================= 112 % 113 HCOR = corrector('HCOR',1.0e-6,[0.0, 0],'CorrectorPass'); 114 115 VCOR = corrector('VCOR',1.0e-6,[0, 0.0],'CorrectorPass'); 86 116 87 ELIST=[... 88 SD5 QP1 SD2 QP2 SD31 COE... 89 DIP COS SD3S1 SX1 SD3S QP31... 90 SD3S SX3 SD3S1 QP41 SD1S1 SX2... 91 SD1S QP4 SD2 QP3 SD3 COE... 92 DIP COS SD0 SD0 COE DIP... 93 COS SD3 QP3 SD2 QP4 SD1S... 94 SX2 SD1S1 QP41 SD3S1 SX3 SD3S... 95 QP31 SD3S SX1 SD3S1 COE DIP... 96 COS SD31 QP2 SD2 QP1 SD5... 97 SD5 QP1 SD2 QP2 SD31 COE... 98 DIP COS SD3S1 SX1 SD3S QP31... 99 SD3S SX3 SD3S1 QP41 SD1S1 SX2... 100 SD1S QP4 SD2 QP3 SD3 COE... 101 DIP COS SD0 SD0 COE DIP... 102 COS SD3 QP3 SD2 QP4 SD1S... 103 SX2 SD1S1 QP41 SD3S1 SX3 SD3S... 104 QP31 SD3S SX1 SD3S1 COE DIP... 105 COS SD31 QP2 SD2 QP1 SD5... 106 ]; 117 %===================================== 118 % !MARKER 119 %===================================== 120 DEBUT = marker('DEBUT','IdentityPass'); 121 FIN = marker('FIN','IdentityPass'); 122 123 124 %!=====================================} 125 %! RING LATTICE } 126 %!=====================================} 127 128 ELIST=[DEBUT, ... 129 SD5 BPMx BPMz QP1 SD2... 130 QP2 SD31 COE... 131 BEND COS SD3S1 SX1 HCOR... 132 VCOR SD3S QP31... 133 SD3S SX3 HCOR VCOR SD3S1... 134 QP41 BPMx BPMz SD1S1 SX2... 135 HCOR VCOR... 136 SD1S QP4 SD2 QP3 SD3... 137 BPMx BPMz COE... 138 BEND COS SD0 SD0 COE... 139 BEND... 140 COS SD3 BPMx BPMz QP3 SD2 QP4... 141 SD1S HCOR VCOR... 142 SX2 SD1S1 BPMx BPMz QP41 SD3S1 SX3... 143 HCOR VCOR SD3S... 144 QP31 SD3S HCOR VCOR SX1... 145 SD3S1 COE... 146 BEND... 147 COS SD31 QP2 SD2 QP1... 148 BPMx BPMz SD5... 149 SD5 BPMx BPMz QP1 SD2 QP2 SD31... 150 COE... 151 BEND COS SD3S1 SX1 HCOR... 152 VCOR SD3S... 153 QP31... 154 SD3S SX3 HCOR VCOR SD3S1... 155 QP41 BPMx BPMz SD1S1... 156 HCOR VCOR SX2... 157 SD1S QP4 SD2 QP3 SD3... 158 BPMx BPMz COE... 159 BEND COS SD0 SD0 COE... 160 BEND... 161 COS SD3 BPMx BPMz QP3 SD2 QP4... 162 SD1S HCOR VCOR... 163 SX2 SD1S1 BPMx BPMz QP41 SD3S1 SX3... 164 HCOR VCOR SD3S... 165 QP31 SD3S SX1 HCOR VCOR... 166 SD3S1 COE... 167 BEND... 168 COS SD31 QP2 SD2 QP1... 169 BPMx BPMz SD5... 170 RF, FIN]; 107 171 108 172 buildlat(ELIST); … … 110 174 % Set all magnets to same energy 111 175 THERING = setcellstruct(THERING,'Energy',1:length(THERING),GLOBVAL.E0); 112 113 114 176 115 177 -
trunk/machine/THOMX/StorageRing/Lattices/CDR_017_064_r56_02_sx_Dff_corrSX_BPMIP.m
r13 r28 18 18 disp(['** Loading THOMX ring lattice ',mfilename]); 19 19 20 L0 = 16.789703999999997; % the 6D COD of ThomX ring is very sensitive to the20 L0 = 16.800115999999992; % the 6D COD of ThomX ring is very sensitive to the 21 21 % longitudinal setting, so defind the 22 22 % value of L0 as the value getting from "getcircumfenrence"!!! … … 95 95 % SX3 = sextupole('SX3', 0.06e-10, -0.1903113E+07*sx_on*0, SPassMethod); 96 96 97 SX1 = sextupole('SX1', 0.1000000E-05, -0.8375307E+07* 1, SPassMethod);97 SX1 = sextupole('SX1', 0.1000000E-05, -0.8375307E+07*sx_on, SPassMethod); 98 98 SX2 = sextupole('SX2', 0.1000000E-05, 0.2405303E+07*sx_on, SPassMethod); 99 99 SX3 = sextupole('SX3', 0.1000000E-05, -0.1903113E+07*sx_on, SPassMethod); -
trunk/machine/THOMX/StorageRing/Lattices/CDR_017_072_r56_02_sx_Dff_corrSX_BPMIP_SEP.m
r27 r28 144 144 %%================================ 145 145 % septum and injection kickers 146 % Pulsed magnets147 146 % 147 % Pulsed magnets 148 148 %%================================ 149 % 160 mrad --- 170 mrad 149 150 SEP = corrector('SEP', 1.0e-10,[0.0,0.0],'CorrectorPass'); 150 151 151 152 % These two kickers are only connected to TANGO, not connected to AT 153 % 11 mrad --- 15 mrad 152 154 % injection kicker 153 155 KICKERIN = corrector('KICKERIN', 1.0e-10,[0.0,0.0],'CorrectorPass'); -
trunk/machine/THOMX/StorageRing/setoperationalmode.m
r25 r28 17 17 % CDR_017_072_r56_02_sx_Dff_corrSX_BPMIP 18 18 % but with the definitions of septums and inj.&extr. kickers 19 % 20 % 21 % ModeNumber 100 = 22 % CDR_017_064_r56_02_sx_Dff_1_cro0_NoDipFF 23 % without dipole fringe field. 24 % 19 25 % 20 26 % See also aoinit, updateatindex, thomxinit, setmmldirectories, lattice_prep … … 62 68 63 69 % Defaults RF for dispersion and chromaticity measurements (must be in Hardware units) 64 AD.DeltaRFDisp = 100e-6; % machine unit, 100 Hz; called by measdisp.m 70 % minimum orbit change 14 micro meter. 71 AD.DeltaRFDisp = 100e-6*1e1; % machine unit, 100 Hz; called by measdisp.m 65 72 % the mcf of ThomX ring is 1.37e-2, so must have a relative large deltaRF, 66 % otherwise the change of energy offset is too small 67 AD.DeltaRFChro = [-100 -50 0 50 100] * 1e-6*1e1; % machine unit; -50*1e2 Hz 73 % otherwise the change of energy offset is too small, and BPMs can't 74 % detect such a small orbit (BPM resolution is about 5 micro meters in ThomX ring). 75 76 77 AD.DeltaRFChro = [-100 -50 0 50 100] * 1e-6*1e2; % machine unit; -50*1e2 Hz 68 78 69 79 … … 175 185 %AO = local_setmagnetcoefficient(AO, @magnetcoefficients); 176 186 %setao(AO); 177 187 elseif ModeNumber == 100 188 AD.OperationalMode = '50e-3 GeV, 3.175 1.64'; 189 AD.Energy = 50e-3; % Make sure this is the same as bend2gev at the production lattice! 190 ModeName = 'CDR_017_064_r56_02_sx_Dff_1_cro0_NoDipFF'; 191 OpsFileExtension = '_CDR_017_064_r56_02_sx_Dff_1_cro0_NoDipFF'; 192 193 % AT lattice 194 AD.ATModel = 'CDR_017_064_r56_02_sx_Dff_1_cro0_NoDipFF'; 195 eval(AD.ATModel); %run model for compiler; 196 197 % Golden TUNE is with the TUNE family 198 AO = getao; 199 AO.TUNE.Monitor.Golden = [ 200 0.175 201 0.640 202 NaN]; 203 204 % Golden chromaticity is in the AD (Physics units) 205 AD.Chromaticity.Golden = [0.0; 0.0]; 206 207 % Status factory 208 % don't need for ThomX ????? 209 %local_set_config_mode('normalconfig120'); d 210 %AO = local_setmagnetcoefficient(AO, @magnetcoefficients); 211 %setao(AO); 212 178 213 else 179 214 error('Operational mode unknown'); -
trunk/machine/THOMX/StorageRing/thomxringgui.m
r26 r28 24 24 % Edit the above text to modify the response to help operationgui 25 25 26 % Last Modified by GUIDE v2.5 2 1-Feb-2014 12:33:5126 % Last Modified by GUIDE v2.5 25-Feb-2014 14:59:25 27 27 28 28 % Begin initialization code - DO NOT EDIT … … 111 111 measbeta; 112 112 113 % --- Executes on button press in pushbutton_ FBNU.114 function pushbutton_ FBNU_Callback(hObject, eventdata, handles)115 % hObject handle to pushbutton_ FBNU(see GCBO)116 % eventdata reserved - to be defined in a future version of MATLAB 117 % handles structure with handles and user data (see GUIDATA) 118 119 % to be updated for ThomX 120 tuneFBgui;113 % --- Executes on button press in pushbutton_meas. 114 function pushbutton_meas_Callback(hObject, eventdata, handles) 115 % hObject handle to pushbutton_meas (see GCBO) 116 % eventdata reserved - to be defined in a future version of MATLAB 117 % handles structure with handles and user data (see GUIDATA) 118 119 % to be updated for ThomX 120 measmcf; 121 121 122 122 % --- Executes on button press in pushbutton_setoperationalmode. … … 355 355 356 356 357 % --- Executes on button press in meas_mcf. 358 function meas_mcf_Callback(hObject, eventdata, handles) 359 % hObject handle to meas_mcf (see GCBO) 360 % eventdata reserved - to be defined in a future version of MATLAB 361 % handles structure with handles and user data (see GUIDATA) 362 363 measmcf; 357 364 358 365 359 -
trunk/machine/THOMX/readme
r27 r28 48 48 49 49 ********************************************** 50 ---- 05/03/2014 51 In AT model, the TL dipoles are set up and read back 52 by the physics units [rad]. 53 While the storage ring dipoles are set up and read 54 back by the beam energy through "bend2gev.m" & "gev2bend.m". 55 56 The set up and read back of the TL dipoles needs to be 57 checked in the connections through Tango. 58 50 59 60 ---- Need to check the basic values setting using MML 61 through TANGO: 62 63 setsp(), getsp() 51 64 65 dipole, quadrupole, sextupole, kicker, BPM, etc. 52 66 67 ---- Set element properties using CHANEL names through TANGO. -
trunk/mml/at/getpvmodel.m
r26 r28 56 56 % add in bpm and corrector other names (machine dependent?) 57 57 % 58 % Need to customized for ThomX in the future...(with the real devices (mangets...) parameters)59 % by Jianfeng Zhang @ LAL,60 % 07/10/201361 58 % 59 % Jianfeng Zhang @ LAL, 07/10/2013 60 % Need to customized for ThomX in the future...(with the real devices (mangets...), 61 % bend2gev.m, gev2bend.m, k2amp.m, amp2k,m, etc. and other parameters) 62 % 63 % Jianfeng Zhang @ LAL, 05/03/2014 64 % Return the TL dipole bending angles, while still to return 65 % the corresponding energy of the dipoles in storage ring. 66 % 67 % 68 %% 69 62 70 63 71 global THERING THERINGCELL … … 802 810 elseif strcmpi(AT.ATType, 'BEND') 803 811 % BEND 804 for i = 1:length(ATIndexList) 805 AM(i,1) = THERING{ATIndexList(i)}.BendingAngle; 812 813 % return the TL bending angle while energy in storage ring 814 % by Jianfeng Zhang @ LAL, 05/03/2014 815 machinetype = getfamilydata('SubMachine'); 816 817 if(strcmp(machinetype,'TL')) 818 for i = 1:length(ATIndexList) 819 AM(i,1) = THERING{ATIndexList(i)}.BendingAngle; 820 end 821 822 UnitsFlag = 'Physics'; 823 fprintf('The machine type is: %s. \nThe bending angles are returned in physics unit [rad]', machinetype); 824 else 806 825 % Modif: Laurent to be consistent, has to return an energy 826 for i = 1:length(ATIndexList) 807 827 AM(i,1) = getenergymodel; 828 end 808 829 end 809 830 … … 992 1013 % Change to hardware units if requested % 993 1014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1015 1016 % only return the bending angle [rad] for the TL dipoles 1017 994 1018 if strcmpi(UnitsFlag, 'Hardware') 995 1019 if isfamily(Family, Field) -
trunk/mml/at/plotcod_alex.m
r4 r28 33 33 orbit = findorbit4(RING,DP,1:length(RING)+1); 34 34 %orbit = findorbit6(RING,1:length(RING)+1); 35 35 subplot(2,1,1); 36 36 plot(localspos,orbit(1,:)*1e3,'.-r'); 37 37 title('Closed Orbit Distortion') 38 hold on 38 %hold on 39 subplot(2,1,2) 39 40 plot(localspos,orbit(3,:)*1e3,'.-b'); 40 41 hold off … … 44 45 axis(A); 45 46 46 legend('Horizontal','Vertical');47 %legend('Horizontal','Vertical'); 47 48 xlabel('s - position [m]'); 48 49 ylabel('orbit [mm]'); -
trunk/mml/at/setpvmodel.m
r25 r28 44 44 % Roll commented for correctors 45 45 % Add new family names for BPM and correctors (machine dependent?) 46 46 % 47 % 48 % Jianfeng Zhang @ LAL, 05/03/2014 49 % Set the TL dipoles by the bending angle in the AT simulator [rad], 50 % while still set the corresponding beam energy of the storage ring 51 % dipoles. 52 % 53 % 54 % 55 56 %% 47 57 ErrorFlag = 0; 48 58 … … 603 613 return 604 614 end 605 615 616 machinetype = getfamilydata('SubMachine'); 617 618 % set the TL dipoles by the bending angle in the AT simulator 619 % by Jianfeng Zhang @ LAL, 05/03/2014 620 if(strcmp(machinetype,'TL')) 621 fprintf('The machine type is: %s. \nThe bending angles will be set in physics unit: [rad]', machinetype); 622 for i = 1:size(NewSP,1) 623 THERING{ATIndexList(i)}.BendingAngle = NewSP(i); 624 end 625 626 % keep to set the ring dipoles by the beam energy 627 else 606 628 % Get the energy of the model 607 629 GeVPresent = getenergy('Simulator'); … … 639 661 640 662 setmachineconfig(SP, 'Hardware', 'Simulator'); 663 664 end 641 665 642 666 elseif strcmpi(AT.ATType, 'Roll')
Note: See TracChangeset
for help on using the changeset viewer.