!***** same as small code option,echo,rbarc=false; ! mad-x lattice lcell:= 5.0; L : drift, L= lcell/2; alpha= .00000000 !3141592653589793238462643383279502; kf:=0.157544565336162; kd:=-0.157544565336162; QF : SBEND,L= 1.0, ANGLE=ALPHA,k1= 0.06268711967817417; QD : SBEND,L= 1.0, ANGLE=ALPHA,k1=-0.06191718852856776; sf : sextupole, K2= 0.0; sd : sextupole, K2= -0.00+0.0; sf1 : sextupole, K2= 1.0; sd1 : sextupole, K2= -0.00+0.0; sf2 : sextupole, K2= 1.0; sd2 : sextupole, K2= -0.00+0.0; oct : octupole, K3= 400.00; oct0 : octupole, K3= 0.00; cell1 : line=(QF,sf1,L,QD,sd1,L); cell2 : line=(QF,sf2,L,QD,sd2,L); cell : line=(QF,sf,L,QD,sd,L); lattice : LINE= (3*cell,cell,3*cell,cell2,2*cell,oct); lattice0 : LINE= (3*cell,cell,3*cell,cell2,2*cell,oct0); BEAM, particle=positron, energy=1.5; use, period=lattice; !SELECT,FLAG=TWISS, column=name,s,betx,bety,dx,K1L,K2L; !twiss,file="madx_ordinary.twiss"; ptc_create_universe; ptc_create_layout,model=1,method=2,nst=40; !,exact; !ptc_script, file="e1_wonderful_magnet_company.txt"; ptc_script, file="print_flat_exercise.txt"; SELECT,FLAG=ptc_twiss, column=name,s,mu1,beta11,alfa11,gama11; PTC_twiss,file="madx_ptc.twiss"; use, period=lattice0; ptc_create_layout,model=1,method=2,nst=40; !,exact; ptc_script, file="print_flat_exercise0.txt"; stop;