÷_elements name=*, type=*, divisions=1 &end &run_setup lattice=hd.lte, use_beamline="george", p_central_mev=7.2, final=%s.matched1.fin, parameters=%s.matched1.parms, centroid=%s.matched1.cen, sigma=%s.matched1.sig, magnets=%s.matched1.mag, &end &twiss_output matched=0, beta_x=8.7, alpha_x=-2.4, beta_y=35.1, alpha_y=-9.5, output_at_each_step=1 &end &run_control n_steps=1 &end &optimization_setup mode="minimize", method="simplex", target=1e-8, tolerance=1e-16, n_evaluations=250, n_passes=3, n_restarts=10, balance_terms=1, output_sparsing_factor=10 &end !!!!!!!!!!!!!!!! START OPTIMIZATION OF QA, QB !!!!!!!!!!!!!!!!!!!!! &optimization_variable name=QA, item=K1, step_size=1, lower_limit=-50, upper_limit=+50, &end &optimization_covariable name=QB, item=K1, equation="QA.K1 -0.25 *" &end &optimization_term weight=1, term="MKMATCH#1.etay 0 - sqr", &end &bunched_beam n_particles_per_bunch=1 &end &optimize summarize_setup=1 &end &save_lattice filename=%s.matched1.lte &end !!!!!!!!!!!!!!!! START OPTIMIZATION OF Q1, Q2, Q3, Q4 !!!!!!!!!!!!!!!!!!!!! &run_setup lattice=mev.matched1.lte, use_beamline="george", p_central_mev=7.2, final=%s.matched2.fin, parameters=%s.matched2.parms, centroid=%s.matched2.cen, sigma=%s.matched2.sig, magnets=%s.matched2.mag, &end &twiss_output filename=%s.matched2.twi, matched=0, beta_x=8.7, alpha_x=-2.4, beta_y=35.1, alpha_y=-9.5 &end &optimization_variable name=Q1, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_variable name=Q2, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_variable name=Q3, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_variable name=Q4, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_term weight=1, term="MKMATCH#1.alphax 0 - sqr" &end &optimization_term weight=1, term="MKMATCH#1.alphay 0 - sqr" &end &run_control n_steps=1 &end &bunched_beam n_particles_per_bunch=1 &end &optimize &end &save_lattice filename=%s.matched2.lte &end !!!!!!!!!!!!!!!! START OPTIMIZATION OF QW, QX, QY, QZ !!!!!!!!!!!!!!!!!!!!! &run_setup lattice=mev.matched2.lte, use_beamline="george", p_central_mev=7.2, final=%s.matched3.fin, parameters=%s.matched3.parms, centroid=%s.matched3.cen, sigma=%s.matched3.sig, magnets=%s.matched3.mag, &end &twiss_output filename=%s.matched3.twi, matched=0, beta_x=8.7, alpha_x=-2.4, beta_y=35.1, alpha_y=-9.5 &end &optimization_variable name=QW, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_variable name=QX, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_variable name=QY, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_variable name=QZ, item=K1, step_size=1, lower_limit=-10, upper_limit=10 &end &optimization_term weight=2, term="MKFINAL#1.betax 0.5 - sqr" &end !&optimization_term ! weight=1, term="MKFINAL#1.alphax 0 - sqr" !&end &optimization_term weight=1, term="MKFINAL#1.betay 0.5 - sqr" &end !&optimization_term ! weight=1, term="MKFINAL#1.alphay 0 - sqr" !&end &run_control n_steps=1 &end &bunched_beam n_particles_per_bunch=1 &end &optimize &end &save_lattice filename=%s.matched3.lte &end !!!!!!!!!!!!!!!! OUTPUT FINAL TWISS, TRACK, FLOOR COORDINATES !!!!!!!!!!!!!!!!!!!!! &run_setup lattice=mev.matched3.lte, use_beamline="george", p_central_mev=7.2, final=%s.matched4.fin, parameters=%s.matched4.parms, centroid=%s.matched4.cen, sigma=%s.matched4.sig, magnets=%s.matched4.mag, &end &floor_coordinates filename=%s.matched4.flr, X0 = 0, Z0 = 0, Y0 = 1.0668, theta0 = 0, magnet_centers = 1 &end &twiss_output filename=%s.matched4.twi, matched=0, beta_x=8.7, alpha_x=-2.4, beta_y=35.1, alpha_y=-9.5 &end &run_control &end &bunched_beam bunch=%s.matched4.bun n_particles_per_bunch=1024, emit_nx=0.47e-6, emit_ny=0.33e-6, beta_x=8.7, alpha_x=-2.4, beta_y=35.1, alpha_y=-9.5 sigma_dp=5e-3,sigma_s=0.0, distribution_type[0] = 3*"gaussian", distribution_cutoff[0] = 3*3, enforce_rms_values[0]=1,1,1 &end &track &end