xsuite / xsuite

Suite of python packages for multiparticle simulations of particle accelerators.
https://xsuite.readthedocs.io
Apache License 2.0
25 stars 22 forks source link

Line length shrinks if Matrix element is used when TWISS is called #482

Open eccortes95 opened 5 months ago

eccortes95 commented 5 months ago

A line with a MATRIX element, eg: wiggler: matrix,l:= 4,rm11:= 1.000449786249,rm12:= 4.000639844715,rm21:= 0.00022577719708,rm22:= 1.00045326313,rm33:= 0.9786569514876,rm34:= 3.970145599493,rm43:=-0.01063922161568,rm44:= 0.97864807445; from MADX can be exported to Xsuite. However when I load the line and then do TWISS the line appears to shrink: line = xt.Line.from_dict(loaded_dct) tab = line.get_table() print(tab['s'][-1]) OUTPUT: 2303.952493011991 line.build_tracker() tw = line.twiss(method='4d') print(tw0.s[-1]) OUTPUT: 2223.9524930120483

I can provide the lattice, if needed.

giadarol commented 5 months ago

Hello. Yes it would be good to have the full lattice

eccortes95 commented 5 months ago

I've sent it.