Page 1 of 1

lattice file conversion from MAD-X to ELEGANT?

Posted: 23 Jun 2021, 16:14
by gpark
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

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

Posted: 23 Jun 2021, 17:02
by michael_borland
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

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

Posted: 23 Jun 2021, 20:54
by gpark
Thanks, Michael

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


Gunn Tae

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

Posted: 23 Jun 2021, 20:56
by michael_borland
Gunn Tae,

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

--Michael

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

Posted: 23 Jun 2021, 21:15
by gpark
Thanks, Michael

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


Gunn Tae

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

Posted: 15 Jul 2021, 13:20
by michael_borland
Gunn Tae,

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

--Michael

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

Posted: 07 Feb 2022, 01:53
by A.V.Bogomyagkov
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