diff --git a/ducktrack/elements.py b/ducktrack/elements.py index 9d08df03b..2dfe88f7e 100644 --- a/ducktrack/elements.py +++ b/ducktrack/elements.py @@ -741,8 +741,6 @@ def track(self,p): p.p0c = new_p0c - import pdb; pdb.set_trace() - p.x *= geo_emit_factor p.px = old_px * geo_emit_factor p.y *= geo_emit_factor diff --git a/tests/test_elements.py b/tests/test_elements.py index b6298d92f..cdb38578c 100644 --- a/tests/test_elements.py +++ b/tests/test_elements.py @@ -403,404 +403,6 @@ def test_wire(test_context): dtk_particle.py, rtol=1e-9, atol=1e-9) -@for_all_test_contexts -def test_linear_transfer(test_context): - dtk_particle = dtk.TestParticles( - p0c=25.92e9, - x=1e-3, - px=1e-5, - y=-2e-3, - py=-1.5e-5, - zeta=2., - delta=2E-4) - - particles = xp.Particles.from_dict(dtk_particle.to_dict(), - _context=test_context) - - alpha_x_0 = -0.5 - beta_x_0 = 100.0 - disp_x_0 = 1.8 - alpha_x_1 = 2.1 - beta_x_1 = 2.0 - disp_x_1 = 3.3 - alpha_y_0 = -0.4 - beta_y_0 = 8.0 - disp_y_0 = -0.2 - alpha_y_1 = 0.7 - beta_y_1 = 0.3 - disp_y_1 = -1.9 - Q_x = 0.27 - Q_y = 0.34 - beta_s = 856.9 - Q_s = 0.001 - energy_ref_increment = 1.2E9 - energy_ref_increment = 0.0 # There seems to be a bug for non-zero values - energy_increment = 4.8E8 - x_ref_0 = -5E-3 - px_ref_0 = 6E-4 - x_ref_1 = 2E-2 - px_ref_1 = -5E-5 - y_ref_0 = -9E-2 - py_ref_0 = 1E-4 - y_ref_1 = 4E-2 - py_ref_1 = 5E-4 - - arc = xt.LinearTransferMatrix(_context=test_context, - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, disp_x_0=disp_x_0, - alpha_x_1=alpha_x_1, beta_x_1=beta_x_1, disp_x_1=disp_x_1, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, disp_y_0=disp_y_0, - alpha_y_1=alpha_y_1, beta_y_1=beta_y_1, disp_y_1=disp_y_1, - Q_x=Q_x, Q_y=Q_y, - beta_s=beta_s, Q_s=Q_s, - chroma_x=0.0, chroma_y=0.0, - detx_x=0.0, detx_y=0.0, dety_y=0.0, dety_x=0.0, - energy_ref_increment=energy_ref_increment,energy_increment=energy_increment, - x_ref_0 = x_ref_0, px_ref_0 = px_ref_0, x_ref_1 = x_ref_1, px_ref_1 = px_ref_1, - y_ref_0 = y_ref_0, py_ref_0 = py_ref_0, y_ref_1 = y_ref_1, py_ref_1 = py_ref_1) - - arc.track(particles) - - dtk_arc = dtk.elements.LinearTransferMatrix( - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, disp_x_0=disp_x_0, - alpha_x_1=alpha_x_1, beta_x_1=beta_x_1, disp_x_1=disp_x_1, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, disp_y_0=disp_y_0, - alpha_y_1=alpha_y_1, beta_y_1=beta_y_1, disp_y_1=disp_y_1, - Q_x=Q_x, Q_y=Q_y, - beta_s=-beta_s, Q_s=Q_s, # Note the minus sign (convention has changed) - chroma_x=0.0, chroma_y=0.0, - detx_x=0.0, detx_y=0.0, dety_y=0.0, dety_x=0.0, - energy_ref_increment=energy_ref_increment,energy_increment=energy_increment, - x_ref_0 = x_ref_0, px_ref_0 = px_ref_0, x_ref_1 = x_ref_1, px_ref_1 = px_ref_1, - y_ref_0 = y_ref_0, py_ref_0 = py_ref_0, y_ref_1 = y_ref_1, py_ref_1 = py_ref_1) - - dtk_arc.track(dtk_particle) - - assert np.isclose(test_context.nparray_from_context_array(particles.x)[0], - dtk_particle.x, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.px)[0], - dtk_particle.px, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.y)[0], - dtk_particle.y, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.py)[0], - dtk_particle.py, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.zeta)[0], - dtk_particle.zeta, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.delta)[0], - dtk_particle.delta, rtol=1e-14, atol=1e-14) - - -@for_all_test_contexts -def test_linear_transfer_chroma_detuning(test_context): - dtk_particle = dtk.TestParticles( - p0c=25.92e9, - x=1e-3, - px=1e-5, - y=-2e-3, - py=-1.5e-5, - zeta=2., - delta=2E-4) - - particles = xp.Particles.from_dict(dtk_particle.to_dict(), - _context=test_context) - - alpha_x_0 = -0.5 - beta_x_0 = 100.0 - disp_x_0 = 1.8 - alpha_x_1 = 2.1 - beta_x_1 = 2.0 - disp_x_1 = 3.3 - alpha_y_0 = -0.4 - beta_y_0 = 8.0 - disp_y_0 = -0.2 - alpha_y_1 = 0.7 - beta_y_1 = 0.3 - disp_y_1 = -1.9 - Q_x = 0.27 - Q_y = 0.34 - beta_s = 856.9 - Q_s = 0.001 - #energy_ref_increment = 1.2E9 - energy_ref_increment = 0.0 # There seems to be a bug for non-zero values - energy_increment = 4.8E8 - x_ref_0 = -5E-3 - px_ref_0 = 6E-4 - x_ref_1 = 2E-2 - px_ref_1 = -5E-5 - y_ref_0 = -9E-2 - py_ref_0 = 1E-4 - y_ref_1 = 4E-2 - py_ref_1 = 5E-4 - chroma_x=8.0 - chroma_y=-5.0 - detx_x = 1E-3 - detx_y = -2E-4 - dety_y = -6E-4 - dety_x = 3E-3 - - arc = xt.LinearTransferMatrix(_context=test_context, - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, disp_x_0=disp_x_0, - alpha_x_1=alpha_x_1, beta_x_1=beta_x_1, disp_x_1=disp_x_1, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, disp_y_0=disp_y_0, - alpha_y_1=alpha_y_1, beta_y_1=beta_y_1, disp_y_1=disp_y_1, - Q_x=Q_x, Q_y=Q_y, - beta_s=beta_s, Q_s=Q_s, - chroma_x=chroma_x, chroma_y=chroma_y, - detx_x=detx_x, detx_y=detx_y, dety_y=dety_y, dety_x=dety_x, - energy_ref_increment=energy_ref_increment,energy_increment=energy_increment, - x_ref_0 = x_ref_0, px_ref_0 = px_ref_0, x_ref_1 = x_ref_1, px_ref_1 = px_ref_1, - y_ref_0 = y_ref_0, py_ref_0 = py_ref_0, y_ref_1 = y_ref_1, py_ref_1 = py_ref_1) - arc.track(particles) - - dtk_arc = dtk.elements.LinearTransferMatrix(alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, disp_x_0=disp_x_0, - alpha_x_1=alpha_x_1, beta_x_1=beta_x_1, disp_x_1=disp_x_1, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, disp_y_0=disp_y_0, - alpha_y_1=alpha_y_1, beta_y_1=beta_y_1, disp_y_1=disp_y_1, - Q_x=Q_x, Q_y=Q_y, - beta_s=-beta_s, Q_s=Q_s, # Note the minus sign (convention has changed) - chroma_x=chroma_x, chroma_y=chroma_y, - detx_x=detx_x, detx_y=detx_y, dety_y=dety_y, dety_x=dety_x, - energy_ref_increment=energy_ref_increment,energy_increment=energy_increment, - x_ref_0 = x_ref_0, px_ref_0 = px_ref_0, x_ref_1 = x_ref_1, px_ref_1 = px_ref_1, - y_ref_0 = y_ref_0, py_ref_0 = py_ref_0, y_ref_1 = y_ref_1, py_ref_1 = py_ref_1) - dtk_arc.track(dtk_particle) - - assert np.isclose(test_context.nparray_from_context_array(particles.x)[0], - dtk_particle.x, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.px)[0], - dtk_particle.px, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.y)[0], - dtk_particle.y, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.py)[0], - dtk_particle.py, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.zeta)[0], - dtk_particle.zeta, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.delta)[0], - dtk_particle.delta, rtol=1e-14, atol=1e-14) - - -@for_all_test_contexts -def test_linear_transfer_uncorrelated_damping(test_context): - alpha_x_0 = -0.5 - beta_x_0 = 100.0 - disp_x_0 = 1.8 - alpha_x_1 = 2.1 - beta_x_1 = 2.0 - disp_x_1 = 3.3 - alpha_y_0 = -0.4 - beta_y_0 = 8.0 - disp_y_0 = -0.2 - alpha_y_1 = 0.7 - beta_y_1 = 0.3 - disp_y_1 = -1.9 - Q_x = 0.27 - Q_y = 0.34 - beta_s = 856.9 - Q_s = 0.001 - energy_ref_increment = 1.2E9 - energy_increment = 4.8E8 - x_ref_0 = -5E-3 - px_ref_0 = 6E-4 - x_ref_1 = 2E-2 - px_ref_1 = -5E-5 - y_ref_0 = -9E-2 - py_ref_0 = 1E-4 - y_ref_1 = 4E-2 - py_ref_1 = 5E-4 - damping_rate_x = 5E-4 - damping_rate_y = 1E-3 - damping_rate_s = 2E-3 - - dtk_particle = dtk.TestParticles( - p0c=25.92e9, - x=1e-3, - px=1e-5, - y=-2e-3, - py=-1.5e-5, - zeta=2., - delta=2E-4) - - particles = xp.Particles.from_dict(dtk_particle.to_dict(), - _context=test_context) - - - arc = xt.LinearTransferMatrix(_context=test_context, - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, disp_x_0=disp_x_0, - alpha_x_1=alpha_x_1, beta_x_1=beta_x_1, disp_x_1=disp_x_1, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, disp_y_0=disp_y_0, - alpha_y_1=alpha_y_1, beta_y_1=beta_y_1, disp_y_1=disp_y_1, - Q_x=Q_x, Q_y=Q_y, - beta_s=beta_s, Q_s=Q_s, - chroma_x=0.0, chroma_y=0.0, - detx_x=0.0, detx_y=0.0, dety_y=0.0, dety_x=0.0, - energy_ref_increment=energy_ref_increment,energy_increment=energy_increment, - x_ref_0 = x_ref_0, px_ref_0 = px_ref_0, x_ref_1 = x_ref_1, px_ref_1 = px_ref_1, - y_ref_0 = y_ref_0, py_ref_0 = py_ref_0, y_ref_1 = y_ref_1, py_ref_1 = py_ref_1, - damping_rate_x = damping_rate_x,damping_rate_y = damping_rate_y,damping_rate_s = damping_rate_s) - arc.track(particles) - - dtk_arc = dtk.elements.LinearTransferMatrix(alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, disp_x_0=disp_x_0, - alpha_x_1=alpha_x_1, beta_x_1=beta_x_1, disp_x_1=disp_x_1, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, disp_y_0=disp_y_0, - alpha_y_1=alpha_y_1, beta_y_1=beta_y_1, disp_y_1=disp_y_1, - Q_x=Q_x, Q_y=Q_y, - beta_s=-beta_s, Q_s=Q_s, # Note the minus sign (convention has changed) - chroma_x=0.0, chroma_y=0.0, - detx_x=0.0, detx_y=0.0, dety_y=0.0, dety_x=0.0, - energy_ref_increment=energy_ref_increment,energy_increment=energy_increment, - x_ref_0 = x_ref_0, px_ref_0 = px_ref_0, x_ref_1 = x_ref_1, px_ref_1 = px_ref_1, - y_ref_0 = y_ref_0, py_ref_0 = py_ref_0, y_ref_1 = y_ref_1, py_ref_1 = py_ref_1, - damping_rate_x = damping_rate_x,damping_rate_y = damping_rate_y,damping_rate_s = damping_rate_s) - dtk_arc.track(dtk_particle) - - assert np.isclose(test_context.nparray_from_context_array(particles.x)[0], - dtk_particle.x, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.px)[0], - dtk_particle.px, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.y)[0], - dtk_particle.y, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.py)[0], - dtk_particle.py, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.zeta)[0], - dtk_particle.zeta, rtol=1e-14, atol=1e-14) - assert np.isclose(test_context.nparray_from_context_array(particles.delta)[0], - dtk_particle.delta, rtol=1e-14, atol=1e-14) - - -@for_all_test_contexts -def test_linear_transfer_uncorrelated_damping_rate(test_context): - alpha_x_0 = -0.5 - beta_x_0 = 100.0 - alpha_y_0 = -0.4 - beta_y_0 = 8.0 - Q_x = 0.18 - Q_y = 0.22 - beta_s = 856.9 - Q_s = 0.0015 - damping_rate_x = 5E-4 - damping_rate_y = 1E-3 - damping_rate_s = 2E-3 - energy = 45.6 - equ_emit_x = 0.3E-9 - equ_emit_y = 1E-12 - equ_length = 3.5E-3 - equ_delta = 3.8E-4 - beta_s = equ_length/equ_delta - equ_emit_s = equ_length*equ_delta - - particles = xp.Particles(_context=test_context, - x=[10*np.sqrt(equ_emit_x*beta_x_0)], - y=[10*np.sqrt(equ_emit_y*beta_y_0)], - zeta=[10*np.sqrt(equ_emit_s*beta_s)], - p0c=energy*1E9) - - - arc = xt.LinearTransferMatrix(_context=test_context, - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, - alpha_x_1=alpha_x_0, beta_x_1=beta_x_0, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, - alpha_y_1=alpha_y_0, beta_y_1=beta_y_0, - Q_x=Q_x, Q_y=Q_y, - beta_s=beta_s, Q_s=Q_s, - damping_rate_x = damping_rate_x, - damping_rate_y = damping_rate_y, - damping_rate_s = damping_rate_s) - - gamma_x = (1.0+alpha_x_0**2)/beta_x_0 - gamma_y = (1.0+alpha_y_0**2)/beta_y_0 - n_turns = int(1E4) - emit_x = np.zeros(n_turns,dtype=float) - emit_y = np.zeros_like(emit_x) - emit_s = np.zeros_like(emit_x) - ctx2np = test_context.nparray_from_context_array - for turn in range(n_turns): - arc.track(particles) - emit_x[turn] = ctx2np(0.5*(gamma_x*particles.x[0]**2 - + 2*alpha_x_0*particles.x[0]*particles.px[0] - + beta_x_0*particles.px[0]**2)) - emit_y[turn] = ctx2np(0.5*( - gamma_y*particles.y[0]**2+2*alpha_y_0 - *particles.y[0]*particles.py[0]+beta_y_0*particles.py[0]**2)) - emit_s[turn] = ctx2np(0.5*( - particles.zeta[0]**2/beta_s+beta_s*particles.delta[0]**2)) - turns = np.arange(n_turns) - fit_x = linregress(turns,np.log(emit_x)) - fit_y = linregress(turns,np.log(emit_y)) - fit_s = linregress(turns,np.log(emit_s)) - - assert np.isclose(damping_rate_x,-fit_x.slope, rtol=1e-3, atol=1e-10) - assert np.isclose(damping_rate_y,-fit_y.slope, rtol=1e-3, atol=1e-10) - assert np.isclose(damping_rate_s,-fit_s.slope, rtol=1e-3, atol=1e-10) - - -@for_all_test_contexts -def test_linear_transfer_uncorrelated_damping_equilibrium(test_context): - alpha_x_0 = 0.0 - beta_x_0 = 100.0 - alpha_y_0 = 0.0 - beta_y_0 = 8.0 - Q_x = 0.18 - Q_y = 0.22 - beta_s = 856.9 - Q_s = 0.015 - damping_rate_x = 5E-4 - damping_rate_y = 1E-3 - damping_rate_s = 2E-3 - energy = 45.6 - equ_emit_x = 0.3E-9 - equ_emit_y = 1E-12 - equ_length = 3.5E-3 - equ_delta = 3.8E-4 - beta_s = equ_length/equ_delta - equ_emit_s = equ_length*equ_delta - - npart = int(1E3) - particles = xp.Particles(_context=test_context, - x=np.random.randn(npart)*np.sqrt(equ_emit_x*beta_x_0), - px=np.random.randn(npart)*np.sqrt(equ_emit_x/beta_x_0), - y=np.random.randn(npart)*np.sqrt(equ_emit_y*beta_y_0), - py=np.random.randn(npart)*np.sqrt(equ_emit_y/beta_y_0), - zeta=np.random.randn(npart)*np.sqrt(equ_emit_s*beta_s), - delta=np.random.randn(npart)*np.sqrt(equ_emit_s/beta_s), - p0c=energy*1E9) - particles._init_random_number_generator(); - - - arc = xt.LinearTransferMatrix(_context=test_context, - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, - alpha_x_1=alpha_x_0, beta_x_1=beta_x_0, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, - alpha_y_1=alpha_y_0, beta_y_1=beta_y_0, - Q_x=Q_x, Q_y=Q_y, - beta_s=beta_s, Q_s=Q_s, - damping_rate_x = damping_rate_x,damping_rate_y = damping_rate_y,damping_rate_s = damping_rate_s, - equ_emit_x = equ_emit_x, equ_emit_y = equ_emit_y, equ_emit_s = equ_emit_s) - - gamma_x = (1.0+alpha_x_0**2)/beta_x_0 - gamma_y = (1.0+alpha_y_0**2)/beta_y_0 - n_turns = int(1E3) - emit_x = np.zeros(n_turns,dtype=float) - emit_y = np.zeros_like(emit_x) - emit_s = np.zeros_like(emit_x) - ctx2np = test_context.nparray_from_context_array - for turn in range(n_turns): - arc.track(particles) - emit_x[turn] = 0.5*np.average(ctx2np( - gamma_x*particles.x**2+2*alpha_x_0*particles.x*particles.px - +beta_x_0*particles.px**2)) - emit_y[turn] = 0.5*np.average(ctx2np( - gamma_y*particles.y**2+2*alpha_y_0*particles.y*particles.py - +beta_y_0*particles.py**2)) - emit_s[turn] = 0.5*np.average(ctx2np(particles.zeta**2/beta_s - +beta_s*particles.delta**2)) - turns = np.arange(n_turns) - equ_emit_x_0 = np.average(emit_x) - equ_emit_y_0 = np.average(emit_y) - equ_emit_s_0 = np.average(emit_s) - - assert np.isclose(equ_emit_x,equ_emit_x_0, rtol=1e-1, atol=1e-10) - assert np.isclose(equ_emit_y,equ_emit_y_0, rtol=1e-1, atol=1e-10) - assert np.isclose(equ_emit_s,equ_emit_s_0, rtol=1e-1, atol=1e-10) - @for_all_test_contexts def test_linear_transfer_first_order_taylor_map(test_context): @@ -1236,73 +838,6 @@ def test_simplified_accelerator_segment_uncorrelated_damping(test_context): assert np.isclose(test_context.nparray_from_context_array(particles.delta)[0], dtk_particle.delta, rtol=1e-14, atol=1e-14) - -@for_all_test_contexts -def test_linear_transfer_uncorrelated_damping_rate(test_context): - alpha_x_0 = -0.5 - beta_x_0 = 100.0 - alpha_y_0 = -0.4 - beta_y_0 = 8.0 - Q_x = 0.18 - Q_y = 0.22 - beta_s = 856.9 - Q_s = 0.0015 - damping_rate_x = 5E-4 - damping_rate_y = 1E-3 - damping_rate_s = 2E-3 - energy = 45.6 - equ_emit_x = 0.3E-9 - equ_emit_y = 1E-12 - equ_length = 3.5E-3 - equ_delta = 3.8E-4 - beta_s = equ_length/equ_delta - equ_emit_s = equ_length*equ_delta - - particles = xp.Particles(_context=test_context, - x=[10*np.sqrt(equ_emit_x*beta_x_0)], - y=[10*np.sqrt(equ_emit_y*beta_y_0)], - zeta=[10*np.sqrt(equ_emit_s*beta_s)], - p0c=energy*1E9) - - - arc = xt.LinearTransferMatrix(_context=test_context, - alpha_x_0=alpha_x_0, beta_x_0=beta_x_0, - alpha_x_1=alpha_x_0, beta_x_1=beta_x_0, - alpha_y_0=alpha_y_0, beta_y_0=beta_y_0, - alpha_y_1=alpha_y_0, beta_y_1=beta_y_0, - Q_x=Q_x, Q_y=Q_y, - beta_s=beta_s, Q_s=Q_s, - damping_rate_x = damping_rate_x, - damping_rate_y = damping_rate_y, - damping_rate_s = damping_rate_s) - - gamma_x = (1.0+alpha_x_0**2)/beta_x_0 - gamma_y = (1.0+alpha_y_0**2)/beta_y_0 - n_turns = int(1E4) - emit_x = np.zeros(n_turns,dtype=float) - emit_y = np.zeros_like(emit_x) - emit_s = np.zeros_like(emit_x) - ctx2np = test_context.nparray_from_context_array - for turn in range(n_turns): - arc.track(particles) - emit_x[turn] = ctx2np(0.5*(gamma_x*particles.x[0]**2 - + 2*alpha_x_0*particles.x[0]*particles.px[0] - + beta_x_0*particles.px[0]**2)) - emit_y[turn] = ctx2np(0.5*( - gamma_y*particles.y[0]**2+2*alpha_y_0 - *particles.y[0]*particles.py[0]+beta_y_0*particles.py[0]**2)) - emit_s[turn] = ctx2np(0.5*( - particles.zeta[0]**2/beta_s+beta_s*particles.delta[0]**2)) - turns = np.arange(n_turns) - fit_x = linregress(turns,np.log(emit_x)) - fit_y = linregress(turns,np.log(emit_y)) - fit_s = linregress(turns,np.log(emit_s)) - - assert np.isclose(damping_rate_x,-fit_x.slope, rtol=1e-3, atol=1e-10) - assert np.isclose(damping_rate_y,-fit_y.slope, rtol=1e-3, atol=1e-10) - assert np.isclose(damping_rate_s,-fit_s.slope, rtol=1e-3, atol=1e-10) - - @for_all_test_contexts def test_simplified_accelerator_segment_uncorrelated_damping_equilibrium(test_context): alpha_x_0 = 0.0 diff --git a/xtrack/beam_elements/elements_src/linesegmentmap.h b/xtrack/beam_elements/elements_src/linesegmentmap.h index 1da6d0525..99fc0d612 100644 --- a/xtrack/beam_elements/elements_src/linesegmentmap.h +++ b/xtrack/beam_elements/elements_src/linesegmentmap.h @@ -304,8 +304,6 @@ void energy_and_reference_increments(LocalParticle *part0, // both the position and the momentum are scaled, // rather than only the momentum. if (energy_ref_increment != 0){ - printf("px = %e\n", LocalParticle_get_px(part)); - printf("py = %e\n", LocalParticle_get_py(part)); double const old_px = LocalParticle_get_px(part); double const old_py = LocalParticle_get_py(part); double const new_energy0 = LocalParticle_get_mass0(part) @@ -321,9 +319,6 @@ void energy_and_reference_increments(LocalParticle *part0, LocalParticle_set_py(part, old_py * geo_emit_factor); LocalParticle_scale_x(part, geo_emit_factor); LocalParticle_scale_y(part, geo_emit_factor); - printf("geo emit factor = %e\n", geo_emit_factor); - printf("px = %e\n", LocalParticle_get_px(part)); - printf("py = %e\n", LocalParticle_get_py(part)); } //end_per_particle_block