Changeset 27 in MML for trunk/machine/THOMX/common


Ignore:
Timestamp:
Feb 25, 2014, 10:52:57 AM (10 years ago)
Author:
zhangj
Message:

(1) Fix the bug to define all sextupole members in one family in AO. (2) Fix the bug to get and define the conversions between the dipole current and beam energy, for the two types dipoles in the transfer line.

Location:
trunk/machine/THOMX/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/machine/THOMX/common/bend2gev.m

    r25 r27  
    11function [GeV B] = bend2gev(varargin)
    22%
    3 %
    4 % Need to be updated...
    5 % Custmized for ThomX machine by Jianfeng Zhang @ LAL, 21/06/2013
    63%
    74%
     
    96% BEND2GEV - Compute the energy based on the ramp tables
    107% GeV = bend2gev(Family, Field, Amps, DeviceList, BranchFlag)
     8%
     9% The dipole currents are connected to the beam energy (TL & Ring & EL)
     10%  Change the beam energy then the dipole currents need to be adjusted!!!!
     11%
    1112%
    1213%  INPUTS
     
    2728%
    2829%  See Also bend2gev
    29 
     30%
     31%
     32%
     33%
    3034
    3135%
     
    3539% TODO Need BLeff = function of the dipole current
    3640
    37 % Default
     41%
     42%
     43% Need to be updated...
     44% Custmized for ThomX machine by Jianfeng Zhang @ LAL, 21/06/2013
     45%
     46%
     47%  25/02/2014  by Jianfeng Zhang @ LAL
     48%     Fix the bug to discriminate the two types dipoles in the TL, then to
     49%     get the correct beam energy.
     50%
     51
     52%% Default
    3853Family = '';
    3954Field = '';
     
    217232            % k(i,1) = polyval(C, Amps(i)) / brho;
    218233
    219             theta = 0.785398163397448; % rad <--> 45 degrees
     234            % There are two types of dipole in ThomX TL.
     235            if(strcmp(Family,'BEND1'))
     236                theta = 0.785398163397448; % rad <--> 45 degrees
     237            elseif(strcmp(Family,'BEND2'))
     238                theta = 0.1690000; %rad <--> 9.68 degrees
     239            else
     240                error('Error! The dipole family in the ThomX TL is either "BEND1" or "BEND2" ');
     241            end
     242           
    220243           
    221244            % need to customized for ThomX
    222             BLeff = 1.7780;
     245            BLeff = 0.1684;  % 50 MeV of ThomX machine
    223246           
    224247           
  • trunk/machine/THOMX/common/gev2bend.m

    r5 r27  
    11function Amps = gev2bend(varargin)
    2 %GEV2BEND - Converts beam energy TO BEND current
     2%GEV2BEND - Converts beam energy TO BEND (ring) or BEND1 (TL), or BEND2 currents
    33%
    44% beam energy/dipole bending angle (BL/Brho) ---> dipole current
     
    4040% Modified by Jianfeng Zhang @ LAL, 18/09/2013
    4141% Need to be modified when the magnet is ready...
     42%
     43%
     44% 24/02/2014 Jianfeng Zhang @ LAL
     45%      Fix the bugs to turn on/off the dipole current in TL, since
     46%      there are two types of dipoles in TL: BEND1, BEND2.
     47%
     48%
     49%
     50
    4251
    4352%  Default
     
    188197            r1inear = (A(end)-BL) / A(end-1);
    189198           
    190         case { 'TL'}
     199     case { 'TL'}
    191200   
    192             brho = getbrho(GeV1);
    193             theta = 0.785398163397448; %rad <--> 45 degrees
    194             BL = brho*theta;
    195             p  = A;
    196             p(end)  = A(end) - BL;
    197             r1inear = (A(end)-BL) / A(end-1);
    198            
     201      % BEND1 & BEND2 have different field strength
     202      % main dipoles
     203      if(strcmp(Family,'BEND1'))
     204       
     205        brho = getbrho(GeV1);
     206        theta = 0.785398163397448; %rad <--> 45 degrees
     207        BL = brho*theta;
     208        p  = A;
     209        p(end)  = A(end) - BL;
     210        r1inear = (A(end)-BL) / A(end-1);
     211           
     212        % injection dipole
     213      elseif(strcmp(Family,'BEND2'))
     214        brho = getbrho(GeV1);
     215        theta = 0.1690000; %rad <--> 9.68 degrees
     216        BL = brho*theta;
     217        p  = A;
     218        p(end)  = A(end) - BL;
     219        r1inear = (A(end)-BL) / A(end-1);
     220      else
     221        error('Error! The dipole in the transfer line is either "BEND1" or "BEND2"');
     222            end
     223           
    199224           
    200225        case 'EL'
Note: See TracChangeset for help on using the changeset viewer.