how can I use this grammar ?

Moderators: cyao, michael_borland

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 06:15

These are the parameters in my ewty.sdds file :

SDDS1
!# little-endian
&description text=ewty_inj.sdds, &end
&parameter name=Npar, description="Number of good particles", type=long, &end
&column name=ID, description="particle index", format_string=%6ld, type=long, &end
&column name=x, symbol=x, units=m, description="horizontal position", format_string=%14.7e, type=double, &end
&column name=xp, symbol=x', description="horizontal slope", format_string=%14.7e, type=double, &end
&column name=y, symbol=y, units=m, description="vertical position", format_string=%14.7e, type=double, &end
&column name=yp, symbol=y', description="vertical slope", format_string=%14.7e, type=double, &end
&column name=t, symbol=t, units=s, description=time, format_string=%14.7e, type=double, &end
&column name=p, symbol=p, units="m$be$nc", description=momentum, format_string=%14.7e, type=double, &end
&data mode=binary, &end

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: how can I use this grammar ?

Post by michael_borland » 16 May 2012, 06:21

Try setting reuse_bunch=1 on sdds_beam.

When tracking from sdds_beam elegant will terminate when it runs out of pages unless this flag is set.

--Michael

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 07:08

Dear Michael,

You are so great!

I am a little afraid about the mistakes when I use Elegant. I felt so difficult for me to find out the exact point that cause the errors. Maybe it would be better when I use if more and more.

Also , I want to scan the Quadpole 08 (180 K vaules ) to get different x-y distributions to do phase space reconstruction. Do you think I can get the right x-y distributions according to "vary_element" ? I have post my .ele above. I think everything is right, but I get the different results as fig1.png and fig2.png in attachment. Ofthere, fig1 is my reconstruction image and fig2 is from Elegant.

Can you find out some reasons for me ?

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

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: how can I use this grammar ?

Post by michael_borland » 16 May 2012, 07:13

Joy,

Using vary_element is the right way to perform a quadrupole scan. You might want to watch out for higher-order effects, especially if your beam has significant energy spread, since I assume the reconstruction technique uses the first-order matrices for quads and drifts. You could try setting default_order=1 in the &run_setup command. Assuming you are using QUAD and DRIFT elements, this should simulate the transport line in a way that is consistent with the reconstruction technique.

--Michael

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 08:37

Dear Michael,

Thanks so much ! I just now changed that values, but I have not finished the reconstruction using the new data, very lage as you know.

I also found anohter problem : when I use a set of K values of quadrupole, from small to lager, I supposed the particles distribution in x direction would be smaller and smaller since Q08 is focusing on x direction. However, the results from Elegant are not as my supposed : when the K is more than some value, the width of x distribution become more and more lager ! How can it be ?! I cannot figure it out.

Best,
Joy

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: how can I use this grammar ?

Post by michael_borland » 16 May 2012, 08:45

Joy,

This would be explained by overfocusing. If the quad gets too strong, the minimum focus occurs before the observation point and moves further from the observation point as the strength increases.

Try splitting your drift spaces into many pieces (using &divide_elements) and looking at the sigma output (from &run_setup) as the quad is varied.

--Michael

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 09:13

Hi,Michael

I know it why now. there is a relationship between focus point and drift.

Best,
Joy

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 10:11

Hi Michael,

I changed the order = 1, but you see the two results in the attachment. They are so different ! I use the same method to reconstruct the phase space by a gauss distribution and my reslut is always the same to the original. But now, I only change the input projections , but I cannot get the same as elegant and they are so different. What else factor should I consider ? I really cannot find out any place wrong to emend.

Best,
Joy

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 10:14

There are the new results.

the sizes are so different.
Last edited by Joytop on 02 Jun 2012, 19:31, edited 1 time in total.

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: how can I use this grammar ?

Post by michael_borland » 16 May 2012, 14:38

Joy, you should make a color density plot for the elegant data. The point plot tend to over state the wings.
Michael

Post Reply