how can I use this grammar ?
Moderators: cyao, michael_borland
Re: how can I use this grammar ?
Dear Michael,
That's much close.
Now I caculate the s1(=Sx),s2(=Sxp) and s12 by ex and twiss parameter .
I get ex from .sig :
s1 s2 s12 ex ElementName
m m m
2.841564e-04 2.955620e-04 8.242936e-08 1.609421e-08 W11
I get twiss from .twi :
betax alphax ElementName
m
1.870317e+00 -1.261194e-01 W11 then gammax= (1 + alphax^2)/betax= 0.5432;
Then I can get: s1 = sqrt(betax*ex)=sqrt (1.870317e+00 * 1.609421e-08 ) = 1.7350e-004
s2 = sqrt( gammax*ex)=9.3501e-005
s12 = -alphax * ex = 2.0298e-009
but the results I get are different from the s1,s2 and s12 from .sig. Why ?
Joy
That's much close.
Now I caculate the s1(=Sx),s2(=Sxp) and s12 by ex and twiss parameter .
I get ex from .sig :
s1 s2 s12 ex ElementName
m m m
2.841564e-04 2.955620e-04 8.242936e-08 1.609421e-08 W11
I get twiss from .twi :
betax alphax ElementName
m
1.870317e+00 -1.261194e-01 W11 then gammax= (1 + alphax^2)/betax= 0.5432;
Then I can get: s1 = sqrt(betax*ex)=sqrt (1.870317e+00 * 1.609421e-08 ) = 1.7350e-004
s2 = sqrt( gammax*ex)=9.3501e-005
s12 = -alphax * ex = 2.0298e-009
but the results I get are different from the s1,s2 and s12 from .sig. Why ?
Joy
-
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: how can I use this grammar ?
Joy,
Is it possible that the beta functions used for the beam (loaded via sdds_beam) are not the same as those given to the &twiss_output command?
You can use sddsanalyzebeam to check the beta functions etc of the beam file.
--Michael
Is it possible that the beta functions used for the beam (loaded via sdds_beam) are not the same as those given to the &twiss_output command?
You can use sddsanalyzebeam to check the beta functions etc of the beam file.
--Michael
Re: how can I use this grammar ?
Hi, Michael :
I have already used the right beta functions from sdds_beam to the twiss_output command. They were consistent. Do you think there are some wrong in my .ele file I posted it several days ago ?
Best,
Joy
I have already used the right beta functions from sdds_beam to the twiss_output command. They were consistent. Do you think there are some wrong in my .ele file I posted it several days ago ?
Best,
Joy
-
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: how can I use this grammar ?
Joy,
I don't see an obvious problem with the .ele file. Does the beam have large energy spread?
Assuming you are using QUAD and DRIFT elements, you can try setting default_order=1. This will turn off any aberrations and you should get better agreement.
--Michael
I don't see an obvious problem with the .ele file. Does the beam have large energy spread?
Assuming you are using QUAD and DRIFT elements, you can try setting default_order=1. This will turn off any aberrations and you should get better agreement.
--Michael
Re: how can I use this grammar ?
Michael,
I have set default_order=1. I can not see Sdelta0, rms energy spread, in .twi file. And sddsrugert can only analyze the energy spread of undulator. I have not found anyelse can do with enery spread in the manual.
Best,
Joy
I have set default_order=1. I can not see Sdelta0, rms energy spread, in .twi file. And sddsrugert can only analyze the energy spread of undulator. I have not found anyelse can do with enery spread in the manual.
Best,
Joy
-
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: how can I use this grammar ?
Joy,
sddsanalyzebeam will analyze the energy spread of a beam file. Also, the &run_setup sigma=<filename> feature will show you the energy spread, plus the beta functions computed from the beam. You can compare these to the results of &twiss_output and see where the discrepancy starts.
--Michael
sddsanalyzebeam will analyze the energy spread of a beam file. Also, the &run_setup sigma=<filename> feature will show you the energy spread, plus the beta functions computed from the beam. You can compare these to the results of &twiss_output and see where the discrepancy starts.
--Michael
Re: how can I use this grammar ?
Michael,
The Sdelta(energy spread) is 1.349871e-03 after the Astra(the begining of Elegant) from both .sig file and sddsanalyzebeam file , and Sdelta at the reconstruction point is 8.107814e-03 from .sig file. Is it too big ? Is it the factor of the dsicrepancy I mentioned above? Does it influence my constructions ?
Also I have comparad the beta functions in .twi file and the results of beta functions calculated from s1 and ex in .sig file . They are the same at the begining, but the discreapancy starts from the next element(the accelerating tube A1P)
Fox instance, I calculate the betax using s1 and ex from .sig at the element DBLL2:
betax_calculated = s1^2 /ex = 3.769923e-04 * 3.769923e-04 / 1.875018e-08 = 7.5798 , but the betax in .twi at the element DBLL2 is 7.5847.
alaphax_calculated = -s12 /ex = -2.710423e-08 /1.875018e-08 = 1.4455, but the alphax in .twi at the element DBLL2 is -1.44402.
Yes the discrepancy the this element near the begnning is samll , but it is large at the end (about 1-2) .
Best,
Joy
The Sdelta(energy spread) is 1.349871e-03 after the Astra(the begining of Elegant) from both .sig file and sddsanalyzebeam file , and Sdelta at the reconstruction point is 8.107814e-03 from .sig file. Is it too big ? Is it the factor of the dsicrepancy I mentioned above? Does it influence my constructions ?
Also I have comparad the beta functions in .twi file and the results of beta functions calculated from s1 and ex in .sig file . They are the same at the begining, but the discreapancy starts from the next element(the accelerating tube A1P)
Fox instance, I calculate the betax using s1 and ex from .sig at the element DBLL2:
betax_calculated = s1^2 /ex = 3.769923e-04 * 3.769923e-04 / 1.875018e-08 = 7.5798 , but the betax in .twi at the element DBLL2 is 7.5847.
alaphax_calculated = -s12 /ex = -2.710423e-08 /1.875018e-08 = 1.4455, but the alphax in .twi at the element DBLL2 is -1.44402.
Yes the discrepancy the this element near the begnning is samll , but it is large at the end (about 1-2) .
Best,
Joy
Last edited by Joytop on 02 Jun 2012, 19:29, edited 1 time in total.
Re: how can I use this grammar ?
Dear Michael,
I have a new question :
I want to calculate the emittance and s1 ect from the color density plot x-xp as the attchment. Yes, it's really that the dot plot over state the wings. I finished the color density by sddshist2d and sddscontour. Can you give me an example to calculate the emittance ect from the data produced by sddshist2d.
Best regards!
Joy
I have a new question :
I want to calculate the emittance and s1 ect from the color density plot x-xp as the attchment. Yes, it's really that the dot plot over state the wings. I finished the color density by sddshist2d and sddscontour. Can you give me an example to calculate the emittance ect from the data produced by sddshist2d.
Best regards!
Joy
Re: how can I use this grammar ?
Dear Michael,
I calculated the s3,s4 and emittance in Matlab use the color density image data produced by sddshist2d(sddshist2d inputfile outputfile -col=y,yp -xparam=400,-0.001,0.001 -yparam=400,-0.001,0.001). Then the outputfile data is the density matrix and can be used to calculate ey. The results are different from the s3,s4 and ey from .sig file . And the error is high to 30% !
I can show you the results :
s3 s34 ey s4
W10 4.116129e-04 9.927426e-08 1.276723e-08 2.431699e-04 (from .sig file, tracking result)
W10 2.7187e-004 4.1770e-008 8.0477e-009 1.5647e-004 (from sddshist2d results)
W10 3.9145e-004 4.4390e-008 1.6001e-008 1.2054e-004 (from my reconstructed image data)
I calculated the s3,s4 and emittance in Matlab use the color density image data produced by sddshist2d(sddshist2d inputfile outputfile -col=y,yp -xparam=400,-0.001,0.001 -yparam=400,-0.001,0.001). Then the outputfile data is the density matrix and can be used to calculate ey. The results are different from the s3,s4 and ey from .sig file . And the error is high to 30% !
I can show you the results :
s3 s34 ey s4
W10 4.116129e-04 9.927426e-08 1.276723e-08 2.431699e-04 (from .sig file, tracking result)
W10 2.7187e-004 4.1770e-008 8.0477e-009 1.5647e-004 (from sddshist2d results)
W10 3.9145e-004 4.4390e-008 1.6001e-008 1.2054e-004 (from my reconstructed image data)
Re: how can I use this grammar ?

Last edited by Joytop on 02 Jun 2012, 19:30, edited 1 time in total.