1

*+ 10/17/2013 sorbit signs of positions and deltacorrectors

2

and corrector/bpm orientations

3


4

Call LSSOL to compute correction angles:

5

sorbit_ls_lssol(int ncorrectors, int npositions,

6

float *betacorrectors, float *betapositions,

7

float *phasecorrectors, float *phasepositions, float tune,

8

float stepcut, float *positions, float *lbcorrectors, float *ubcorrectors,

9

float *deltacorrectors, float *predictedpositions, int *lssol_inform)

10


11

After deltacorrectors found multiply by stepcut and change sign of angles

12

(change sign because have solved for angles which move

13

the orbit from 0 to the positions inputed and we want

14

the angles which move the beam from the positions inputed

15

to 0)

16

stepcutl = stepcut;

17

for(ii=0;ii<ncorrectors;ii++)

18

{

19

deltacorrectors[ii] = stepcutl*x[ii];

20

}

21


22

The input positions are number of dx mm to be corrected to 0.

23

After above sign change on deltacorrectors the deltacorrectors should have right

24

sign of correction angles.

25


26

If the input positions flip sign(as in my code pre_bpm:

27


28

for (i = 0; i < num_bpms[pl]; i++) cor>dx1[i] = cor>o1.mm[i];

29


30

/* the sign of correction is as such: 1 is to correct 1 mm distortion */

31


32

if (pgm.i4[I_DESO]) {

33

for (i = 0; i < num_bpms[pl]; i++) cor>dx1[i] += cor>deso.mm[i];

34

}

35


36

The signs of the above output correction angles must be reversed.

37

Fact that for recycler in pa4196(original pa1850) 'sorbit' output deltacorrectors

38

sign reversed only in horz plane indicate corrector/bpm orientations in horz

39

is 'norm' whereas vertical is opposite.

40


41

 float signs[2] = {1,1.};

42

 for (i = 0; i < num_ob_ceds[pl]; i++) cor>dthet[i] *= signs[pl];

43


44

IN MI signs[2] = {1,1.} indicate corrector/bpm orientations in vertical plane

45

is 'norm' whereas in horz plane is wrong.
