lattice file conversion from MAD-X to ELEGANT?

Moderators: cyao, michael_borland

Post Reply
gpark
Posts: 18
Joined: 07 Dec 2017, 13:15

lattice file conversion from MAD-X to ELEGANT?

Post by gpark » 23 Jun 2021, 16:14

I am in a collaboration with other team and they can provide me with a lattice file in MAD-X. I want to run it on the ELEGANT. The lattice is long and I would need some kind of conversion of the lattice file into something I can use for the ELEGANT. Is this possible? If so, could you let me know how to do it?

Thanks,
Gunn Tae

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

Re: lattice file conversion from MAD-X to ELEGANT?

Post by michael_borland » 23 Jun 2021, 17:02

Gunn Tae,

I'm sure it is possible, but we don't have anything like that at APS. If you can provide the lattice, perhaps I can see what we can do.

I think SLAC had a program to convert MAD8 to elegant format.

--Michael

gpark
Posts: 18
Joined: 07 Dec 2017, 13:15

Re: lattice file conversion from MAD-X to ELEGANT?

Post by gpark » 23 Jun 2021, 20:54

Thanks, Michael

I failed to attach the files. It says extension .madx nor .dat are not allowed.


Gunn Tae
Last edited by gpark on 23 Jun 2021, 21:01, edited 1 time in total.

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

Re: lattice file conversion from MAD-X to ELEGANT?

Post by michael_borland » 23 Jun 2021, 20:56

Gunn Tae,

I don't see the files. Did you forget to attach them?

--Michael

gpark
Posts: 18
Joined: 07 Dec 2017, 13:15

Re: lattice file conversion from MAD-X to ELEGANT?

Post by gpark » 23 Jun 2021, 21:15

Thanks, Michael

I failed to attach the files. It says extension .madx nor .dat are not allowed.


Gunn Tae

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

Re: lattice file conversion from MAD-X to ELEGANT?

Post by michael_borland » 15 Jul 2021, 13:20

Gunn Tae,

If you can put the file into a ZIP file, you should be able to attach that file with no problem.

--Michael

A.V.Bogomyagkov
Posts: 18
Joined: 29 Jan 2021, 14:07

Re: lattice file conversion from MAD-X to ELEGANT?

Post by A.V.Bogomyagkov » 07 Feb 2022, 01:53

Gunn Tae,

I convert MAD-X sequences into ELEGANT by using mad8 key in save command of MAD-X

Code: Select all

seqedit, sequence=ct_ring;
	flatten;
endedit;

set,format="28.15g";
select,flag=save,clear;
use,sequence=ct_ring;
save,sequence=ct_ring,file="ctau_tmp.madx",noexpr;

call,file="ctau_tmp.madx";	//Needed to have all expressions evaluated and replaced by numbers
twiss,ct_ring;				//Just to check

set,format="28.15g";
select,flag=save,clear;
use,sequence=ct_ring;
save,sequence=ct_ring,file="ctau-2022.02.04-08.56.14_1.0crab_L2.INJ.mad8",noexpr,mad8;

then I use MAD8 to obtain a beam line

Code: Select all

SAVELINE,NAME=ct_ring,FILENAME=&
"ctau-2022.02.04-08.56.14_1.0crab_L2.INJ-line.mad8";
After that you need to add watch or malign element and change RFCAVITY elements to RFCA.

Anton

Post Reply