Skip to content

starting from a previouly calculated generation #1

@ZeusMarti

Description

@ZeusMarti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions