Changeset 5 in MML


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

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

Location:
trunk
Files:
126 added
5 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r4 r5  
    77% For Linux platform -ldl is need (personal laptop)
    88% 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%
    914
    1015StartDir = pwd;
     
    3742        PLATFORMOPTION = ['-D',computer,' '];
    3843    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
    4047    case  'PCWIN'
    41         PLATFORMOPTION = ['-D',computer,' '];
     48        PLATFORMOPTION = ['-D',computer,' '];%windows
    4249    case  'MACI64'
    43         PLATFORMOPTION = ['-D',computer,' LDFLAGS=''-pthread -shared -m64'' '];
     50        PLATFORMOPTION = ['-D',computer,' LDFLAGS=''-pthread -shared -m64'' ']; %added by L. Nadolski for MAC
    4451    otherwise
    4552        error('Platform not defined');
  • 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
  • trunk/at/simulator/element/DriftPass.c

    r4 r5  
    1313   r_in - 6-by-N matrix of initial conditions reshaped into
    1414   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
    1518*/
    1619{       int c, c6;
  • trunk/at/simulator/element/StrMPoleSymplectic4Pass.c

    r4 r5  
    5454        i = 0 .. MaxOrder
    5555
     56
     57The same kick map as in Tracy 3 for straight magnets:
     58    px = L*(-By/Brho);
     59    py = L*(Bx/Brho);
    5660******************************************************************************/
    5761{  int i;
     
    5963        double ImSum = A[max_order];
    6064        double ReSumTemp;
     65        /* get the effective field strength; the same           routine as in TRACY*/
    6166        for(i=max_order-1;i>=0;i--)
    6267        {   ReSumTemp = ReSum*r[0] - ImSum*r[2] + B[i];
     
    7479     in the loop if momentum deviation (delta) does not change
    7580     such as in 4-th order symplectic integrator w/o radiation
     81
     82The 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
    7686*/
    7787
    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)*/
    8090    r[0]+= dx;
    8191    r[2]+= dy;
     
    8393}
    8494
     95/*
     96  4th order symplectic map, using the expanded Hamiltonian as in TRACY 3: H = H1 + H2 + O(3)
     97*/
    8598void StrMPoleSymplectic4Pass(double *r, double le, double *A, double *B,
    8699                                        int max_order, int num_int_steps,
  • trunk/at/simulator/element/atlalib.c

    r4 r5  
    22     Matrix and Vector algebra operations for Accelerator Toolbox
    33     A.Terebilo   8/14/00
    4 
     4     
     5    Math library
    56
    671. Use mxCalloc, mxMalloc , mxFree for memory allocation/deallocation
     
    6465}       
    6566
     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*/
    6671void ATdrift6(double* r, double L)
    6772/*   Input parameter L is the physical length
  • trunk/at/simulator/element/atphyslib.c

    r4 r5  
    66     April 29, 2011: According to note SSC-141 by E. Forest, energy dependance in only in V-plane
    77                     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.
    812 */
    913       
  • 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
     4Set up for 64 bit linux platform.
     5Modified by Jianfeng ZHANG @ LAL, 12/02/2013
     6*/
     7
     8
    29
    310#if defined(PCWIN)
    4 #define ExportMode __declspec(dllexport)
     11#define ExportMode __declspec(dllexport)  /*windows version matlab*/
    512#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*/
    716#define ExportMode
    817#elif defined(ALPHA)
     
    1019#elif defined(SOL2)
    1120#define ExportMode
    12 #elif defined(MACI64) /* added by LSN for MAC Snow Leopard */
     21#elif defined(MACI64) /* added by L.S. Nadolski for MAC Snow Leopard */
    1322#define ExportMode
    1423#else
  • trunk/at/simulator/element/mexpassmethod.m

    r4 r5  
    3535        PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m32 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNX86.map''',' '];
    3636    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''',' '];
    3839    case 'MACI64'
    3940        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
     4Add the mex compile for 64 bit linux platform.
     5By Jianfeng ZHANG @ LAL, 13/02/2013.
     6*/
     7
    28
    39#if defined(PCWIN)
     
    511#include <float.h>
    612#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*/
    715#define ExportMode
    816#elif defined(ALPHA)
  • trunk/at/simulator/element/user/mexuserpassmethod.m

    r4 r5  
    99% The second argument is a list of options passed to the 'mex' script
    1010%
    11 % Examples: mexpassmethod('DriftPass','-v')
     11% Examples:
     12
    1213%           mexpassmethod('all','-argcheck')
    1314%           mexpassmethod({'DriftPass','BendLinearPass'})
     
    2021%
    2122% 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
    2229
    2330PLATFORMOPTION = ['-D',computer,' '];
     
    3441    PLATFORMOPTION = [PLATFORMOPTION,'LDFLAGS=''-pthread -shared -m32 -Wl,--version-script,',atroot,'/simulator/element/mexFunctionGLNX86.map''',' '];
    3542    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''',' '];
    3746    case 'MACI64'
    3847        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],
     1function z=rbend3(fname,L,A,A1,A2,K,gap,EdgeEffect1,EdgeEffect2, method)
     2%RBEND2('FAMILYNAME',  Length[m], BendingAngle[rad], EntranceAngle[rad],
    33%       ExitAngle[rad], K, gap, F1, F2, 'METHOD')
    44%       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
    1420% returns assigned address in the FAMLIST that is uniquely identifies
    1521% the family
    16 
    1722%
    1823% 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.
    1929
    2030ElemData.FamName = fname;  % add check for identical family names
     
    2838ElemData.K                      = K;
    2939ElemData.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
     40ElemData.FringeInt1         = 0.5; % same convention as in Tracy II
     41ElemData.FringeInt2         = 0.5; % same convention as in Tracy II
     42ElemData.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
     47ElemData.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
    3252
    33 ElemData.R1             = diag(ones(6,1));
     53
     54ElemData.R1             = diag(ones(6,1)); %rotation error
    3455ElemData.R2             = diag(ones(6,1));
    35 ElemData.T1             = zeros(1,6);
     56ElemData.T1             = zeros(1,6); %displacement error
    3657ElemData.T2             = zeros(1,6);
    3758
    38 ElemData.PolynomA               = [0 0 0 0];   
    39 ElemData.PolynomB               = [0 K 0 0];
     59ElemData.PolynomA               = [0 0 0 0];    %skew component of field
     60ElemData.PolynomB               = [0 K 0 0];    %normal component of field
    4061ElemData.PassMethod     = method;
    4162
  • trunk/at/simulator/track/atpass.c

    r4 r5  
    11/*  Tracking engine ATPASS for Accelerator Toolbox 1.3    */
    22
    3 /* Modification: Laurent S. Nadolski, April 7th, 2007
     3/*(1)
     4   Modification: Laurent S. Nadolski, April 7th, 2007
    45 * Add check on argument otherwise it crashes with no argument
    56 * April 22nd, 2011. Removed Limit for coordinates ctau
     7
     8(2)
     9Add the platform for 64 bit computer.
     10%Modified by Jianfeng Zhang @ LAL, 13/02/2013.
     11
    612 */
    713
     
    1016#include <string.h>
    1117
     18/* windows platform */
    1219#if defined(PCWIN)
    1320#include <windows.h>
     
    2835#define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction")
    2936
     37                        /* 32 bit linux platform */
    3038#elif defined(GLNX86)
    3139#include <dlfcn.h>
     
    3745#define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction")
    3846
     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
    3957#elif defined(SOL2)
    4058#include <dlfcn.h>
     
    4664#define GETPASSFCN(libfilename) dlsym((libfilename),"passFunction")
    4765
     66                        /* MAC platform */
    4867#elif defined(MACI64)
    4968#include <dlfcn.h>
     
    294313                    default:
    295314                       
    296                         mexPrintf("Element #%d\tPassMethod: '%s'\n",  n, method_names[n]);
     315                      mexPrintf("Element #%d\tPassMethod: '%s '\n",  n, method_names[n]);
    297316                        mexErrMsgTxt("Specified PassMethod is not on MATLAB search path");
    298317                }
  • trunk/machine/SOLEIL/LT2/LT2init.m

    r4 r5  
    407407AO.(ifam).DeviceList             = family2dev(ifamQ);
    408408AO.(ifam).ElementList            = family2elem(ifamQ);
    409 AO.(ifam).GroupId                = tango_group_create('Dipole');
     409%AO.(ifam).GroupId                = tango_group_create('Dipole');
    410410AO.(ifam).DeviceName             = 'LT2/AE/cycleD.1';
    411411%add devices to group
    412 tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName);
     412%tango_group_add(AO.(ifam).GroupId, AO.(ifam).DeviceName);
    413413%AO.(ifam).Inom = 180;
    414414AO.(ifam).Imax = 580;
     
    436436AO.(ifam).ElementList            = family2elem(ifamQ);
    437437%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');
    440440AO.(ifam).Inom = [1 2 3];
    441441AO.(ifam).Imax = 7.9*ones(1,3);
     
    461461AO.(ifam).ElementList            = family2elem(ifamQ);
    462462%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');
    465465%AO.(ifam).Inom = [1 2 3];
    466466AO.(ifam).Imax = 7.9*ones(1,5);
     
    486486AO.(ifam).ElementList            = family2elem(ifamQ);
    487487%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');
    490490nb = length(AO.(ifam).ElementList);
    491491AO.(ifam).Imax = [274  -349  -274  274  274  -274  274 ];
  • trunk/machine/SOLEIL/LT2/aoinit.m

    r4 r5  
    2626    addpath(fullfile(MMLROOT, 'mml'),'-begin');
    2727
    28     disp(['TANGO/MATLAB binding version: ' tango_version])
     28    %disp(['TANGO/MATLAB binding version: ' tango_version])
    2929    disp('Startup file for Matlab Middle Layer read with success');
    3030
  • trunk/machine/SOLEIL/StorageRing/aoinit.m

    r4 r5  
    7171    else
    7272       % Dedicated directory for development (not operation) modes on Hyperion
    73        addpath(fullfile(getdvptdirectory, 'StorageRingDvptData'));
     73       %addpath(fullfile(getdvptdirectory, 'StorageRingDvptData'));
    7474       addpath(fullfile(MMLROOT, 'machine', 'SOLEIL', 'StorageRing', 'RadiaMapGui'));
    7575    end
  • trunk/mml/at/atsummary.m

    r4 r5  
    1212%  Written by Eugene Tan
    1313%  Revised by Laurent S. Nadolski
    14 
     14%
     15% Customize the default values for ThomX ring
     16%     by Jianfeng Zhang @ LAL, 03/2013
    1517
    1618global THERING GLOBVAL
     
    5860        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);
    5961        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);
    6163        %         if H1+H0 < 0
    6264        %             fprintf('%f %i %s\n', H1+H0, i, THERING{i}.FamName)
     
    8385
    8486% Slip factor
    85 sum.etac = sum.gamma^(-2) - sum.compactionFactor;
     87sum.etac =  sum.gamma^(-2) - sum.compactionFactor;
    8688
    8789cavind = findcells(THERING,'HarmNumber');
     
    9193else
    9294    % Default
    93     freq = 352.202e6;
    94     v_cav = 3e6;
     95    freq = 499.96092;
     96    v_cav = 300e3;
    9597end
    9698sum.harmon = sum.circumference/(2.99792458e8/freq); % Assuming 499.654MHz RF
     
    124126fprintf('                V: \t\t%+4.5f\n', sum.chromaticity(2));
    125127fprintf(SeparatorString);
    126 fprintf('   Synchrotron Integral 1: \t% 4.5e [m]\n', sum.integrals(1));
    127 fprintf('                        2: \t% 4.5e [m^-1]\n', sum.integrals(2));
    128 fprintf('                        3: \t% 4.5e [m^-2]\n', sum.integrals(3));
    129 fprintf('                        4: \t% 4.5e [m^-1]\n', sum.integrals(4));
    130 fprintf('                        5: \t% 4.5e [m^-1]\n', sum.integrals(5));
    131 fprintf('                        6: \t% 4.5e [m^-1]\n', sum.integrals(6));
     128fprintf('  Radiation Integral 1: \t% 4.5e [m]\n', sum.integrals(1));
     129fprintf('                     2: \t% 4.5e [m^-1]\n', sum.integrals(2));
     130fprintf('                     3: \t% 4.5e [m^-2]\n', sum.integrals(3));
     131fprintf('                     4: \t% 4.5e [m^-1]\n', sum.integrals(4));
     132fprintf('                     5: \t% 4.5e [m^-1]\n', sum.integrals(5));
     133fprintf('                     6: \t% 4.5e [m^-1]\n', sum.integrals(6));
    132134fprintf('   Damping Partition H: \t% 4.5f\n', sum.damping(1));
    133135fprintf('                     V: \t% 4.5f\n', sum.damping(2));
     
    142144fprintf(SeparatorString);
    143145fprintf('   Assuming cavities Voltage: \t% 4.5f [kV]\n', v_cav/1e3);
    144 fprintf('                   Frequency: \t%4.5f [MHz]\n', freq/1e6);
     146fprintf('                   Frequency: \t%4.6f [MHz]\n', freq/1e6);
    145147fprintf('             Harmonic Number: \t% 4.5f\n', sum.harmon);
    146148fprintf('   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);
     149fprintf('   Synchronous Phase:  \t\t% 4.10f [rad] (%4.10f [deg])\n', sum.syncphase, sum.syncphase*180/pi);
    148150fprintf('   Linear Energy Acceptance:  \t% 4.5f%%\n', sum.energyacceptance*100);
    149151fprintf('   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  
    44% deviation DP. It calls FINDORBIT4 which assumes a lattice
    55% with NO accelerating cavities and NO radiation
    6 
     6%
     7% By Jianfeng Zhang @ LAL, 10/2013
     8% Modified to get 6D COD
     9%
    710
    811if nargin < 1
     
    1518%localspos = findspos(THERING,1:length(RING)+1);
    1619orbit = findorbit4(THERING,DP,1:length(THERING)+1);
     20%orbit = findorbit6(THERING,DP,1:length(THERING)+1);
  • trunk/mml/at/getpvmodel.m

    r4 r5  
    5555% 12/12/05 BPMx, BPMz, HCOR and VCOR getroll and getcrunch commented since too slow
    5656% 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%
    5762
    5863global THERING THERINGCELL
     
    800805                AM(i,1) = THERING{ATIndexList(i)}.BendingAngle;
    801806                % Modif: Laurent to be consistent, has to return an energy
    802                 % AM(i,1) = getenergymodel;
     807                AM(i,1) = getenergymodel;
    803808            end
    804809
  • trunk/mml/at/gotoat.m

    r4 r5  
    11function gotoat
     2%
     3%
     4% modified by Jianfeng Zhang @ LAL, 26/09/2013
     5%  Fix the bug to get atroot.
     6%
     7%
    28
    3 cd(getenv('ATROOT'));
     9cd(atroot);
     10
     11%cd(getenv('ATROOT'));
    412
    513% if strcmp(computer,'PCWIN') == 1
  • trunk/mml/measchro.m

    r4 r5  
    8484%
    8585%  Written by Greg Portmann and Jeff Corbett
    86 
    8786%
    8887%  Written by Gregory J. Portmann
    8988%  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%
    9096
    9197NRFSteps = 1;
     
    296302    end
    297303elseif strcmpi(RFUnitsString, 'Hz')
    298     if abs(max(DeltaRF)-min(DeltaRF)) > 1000;  % Hz
     304    if abs(max(DeltaRF)-min(DeltaRF)) > 1000*1e2;  % Hz
    299305        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');
    300306        if strcmp(tmp,'NO')
  • trunk/mml/measchroresp.m

    r4 r5  
    9191StructOutputFlag = 0;
    9292MatrixFlag = 1;
    93 DisplayFlag = -1;
     93DisplayFlag = 1;
    9494ArchiveFlag = -1;
    9595FileName = -1;
  • trunk/mml/setpathmml.m

    r4 r5  
    1313%  Written by Greg Portmann
    1414%  Updated by Igor Pinayev
    15 
     15%
     16%  Update for ThomX by Jianfeng Zhang @ LAL
     17%    (1) set linkflag for ThomX
     18%
    1619
    1720% Inputs:  MachineName, SubMachineName, MachineType, LinkFlag, MMLROOT
     
    154157        case {'VUV','XRAY'}
    155158            LinkFlag = 'UCODE';
    156         case {'ALBA','SOLEIL'}
     159        case {'THOMX','ALBA','SOLEIL'}
    157160            LinkFlag = 'Tango';
    158161        otherwise
     
    244247            %addpath(fullfile(MMLROOT,'links','tango'),'-begin');
    245248            versionName =  version('-release');
     249            %need to set for THOMX in the future (17/07/2013 by ZHANG)
    246250            TANGOROOT   = getenv('SOLEIL_ROOT');
    247            
     251            %need to set for THOMX in the future (17/07/2013 by ZHANG)
    248252            [statuss WHO] = system('whoami');
    249253            % system gives back an visible character: carriage return!
     
    305309
    306310    % Machine directory
    307     if ~isempty(MachineName) && ~isempty(SubMachineName)
     311     if ~isempty(MachineName) && ~isempty(SubMachineName)
    308312        % New MML path
    309313        addpath(fullfile(MMLROOT, 'machine', MachineName, SubMachineName),'-begin');
  • trunk/mml/steptune.m

    r4 r5  
    3535%  Modified by Laurent S. Nadolski
    3636%   06/01/06 - Introduction of ActuatorFamily as a input
     37%
    3738
    3839% Initialize
     
    128129
    129130
    130 % 2. Square matrix solution
    131 % DelQuad = inv(TuneResponseMatrix) * DeltaTune;
     131% 2. Square matrix solution;
     132 %DelQuad = inv(TuneResponseMatrix) * DeltaTune;
    132133
    133134
Note: See TracChangeset for help on using the changeset viewer.