Giter VIP home page Giter VIP logo

electroncooling's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

electroncooling's Issues

Force calculated multiple times?

force(n_sample, ion, ebeam, cooler, force_paras);
//Restore the longitudinal velocity if it has been changed due to electron velocity gradient
restore_velocity(n_sample, ebeam);
//Special treatment for bunched electron beam to cool coasting ion beam
if(!ion.bunched()&&ebeam.bunched()) {
bunched_to_coasting(ecool_paras, ion, ebeam, cooler, force_paras);
force(n_sample, ion, ebeam, cooler, force_paras);
}

It appears there's a case where force is called three times between transition to the beam frame and transition back to the lab frame, since force() is called within bunched_to_coasting. Is this intended, or should the force call at line 1008 be the start of an if/else statement?

Force units?

I am trying to understand the units of the force calculation within the Parkhomchuk model. I know that Betacool returns a numerical value for the frictional forces in terms of eV/m, but the Betacool physics guide also uses a different set of terms in the force calculation. What is the difference between the Betacool F_const (as shown in the Betacool physics guide) and what is shown here:

double f_const = -4*k_c*k_c*k_ke*k_ke*k_e*k_e*k_e/(k_me*1e6);

When I try to compare forces return from both JSPEC and Betacool I find they are different by a factor of roughly 25/k_e.

Benchmarking against Betacool

Hi,
Using your master branch, I've constructed an ecooling example comparable to an EIC design. The parameters are:

        //define coasting gold beam in an EIC scenario
        int n_charge = 79;
        double n_mass = 197;
        double kinetic_energy = 1e5*n_mass;
        double gamma = 1+kinetic_energy/(n_mass*k_u);
        double beta = sqrt(1-1/(gamma*gamma));
        double emit_nx0 = beta*gamma*5e-6;
        double emit_ny0 = beta*gamma*5e-6;
        std::cout<<std::endl;
        std::cout<<"gamma ="<<gamma<<" beta ="<<beta<<" emit_nx0="<<emit_nx0<<std::endl;
        double dp_p0 = 0.004;
        double n_ptcl = 5E8;
        double sigma_s_ion = 2e-2;
        Beam c_beam(n_charge, n_mass, kinetic_energy, emit_nx0, emit_ny0, dp_p0, sigma_s_ion,n_ptcl);

        //define the ring
        std::string filename = "Booster.tfs"; 
        Lattice lattice(filename);
        Ring ring(lattice, c_beam);

        //define the cooler
        double cooler_length = 1;
        double n_section = 1;
        double magnetic_field = 5;
        double beta_h = 10;
        double beta_v = 17;
        double dis_h = 0;
        double dis_v = 0;
        Cooler cooler(cooler_length,n_section,magnetic_field,beta_h,beta_v,dis_h, dis_v);

        //define electron beam
        double current = 0.03;
        double radius = 0.025;
        double neutralisation = 0;
        UniformCylinder uniform_cylinder(current, radius, neutralisation);
        double gamma_e = c_beam.gamma();
        double tmp_tr = 0.05;
        double tmp_long = 0.1;
        EBeam e_beam(gamma_e, tmp_tr, tmp_long, uniform_cylinder);

        //define cooling model
        unsigned int n_tr = 100;
        unsigned int n_long = 100;
        EcoolRateParas ecool_rate_paras(n_tr, n_long);

        ForceParas force_paras(ForceFormula::PARKHOMCHUK);
        double rate_x, rate_y, rate_s;
        ecooling_rate(ecool_rate_paras, force_paras, c_beam, cooler, e_beam, ring, rate_x, rate_y, rate_s);

I've also constructed the same situation for comparison in BETACOOL. The comparison of forces is shown below:
image

I'm wondering if you benchmarked against Betacool in your development. It's possible I made a mistake with the Betacool configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.