Giter Club home page Giter Club logo

mg-gpo's Issues

starting from a previouly calculated generation

Hi there,

I have started using MG-GPO to optimize the dynamical aperture and beam lifetime. First of all, thanks for sharing this type of content, it is very nice, I really apreciate it.

I was trying to start from a previously calculated generation 2 of a diferent run. I did:

load('generation_2.mat');
gbest = MGGPO(evaluate,predict,Npop,Ngen,Nobj,Nvar,da);

It produced ar error because f0 iwas not defined I did the following modification in MGGPO (line 43):

elseif nargin > 6
    %{
    da = varargin{1}; 
    %     da.Xmat=[da.Xmat xt];
    %     da.fa = [da.fa; ynew];
    %     da.nf = nf;
    %     da.invKmat = inv(Kmat+sigy^2*eye(nf))
    gbest = da.gbest;
    v0 = da.v0;
    %}
    % zeus modification:
    vrange1 = ones(Nvar,1)*[0,1,1e-6]*1;
    l_limit = vrange1(:,1);
    u_limit = vrange1(:,2);
    gen = varargin{1};
    da=gen.da;
    gbest = da.gbest;
    v0 = da.v0;
    f0=gen.f0;
end

Then I run:

gen=importdata('generation_2.mat');
gbest = MGGPO(evaluate,predict,Npop,Ngen,Nobj,Nvar,gen);

This time the code calculated the evaluate function (it takes a long time to evaluate the dynamical aperture and lifetime) but it produced an error because pbest was not defined... Maybe there are more things missing. Could you take a look at it?

Also I know I'm not understanding what the field da contains, could you
briefly describe it?

Thanks a lot

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.