Branch off at Hopf point (point is either of kind hopf or stst)

Contents

function [per,suc]=SetupPsol(funcs,ststbranch,ind,varargin)

Inputs

Important optional inputs (name-value pairs)

All other optional inputs are passed on to fields of out branch per

Outputs

(c) DDE-BIFTOOL v. 3.1.1(20), 11/04/2014

default={'radius',0.01,'contpar',[],'corpar',[],...
    'degree',3,'intervals',20,'hopfcorrection',true};
[options,pass_on]=dde_set_options(default,varargin,'pass_on');
% create branch per of periodic solutions starting from an
% approximate Hopf point num on a branch br of steady states
if isempty(options.contpar)
    options.contpar=ststbranch.parameter.free;
end
if isempty(options.corpar)
    % assume that initial correction have to be made in all continuation
    % parameters (to accomodate step condition)
    options.corpar=options.contpar;
end
hopf=ststbranch.point(ind);
if ~strcmp(hopf.kind,'hopf')
    if ~isfield(hopf,'stability') || isempty(hopf.stability)
        hopf.stability=p_stabil(funcs,hopf,ststbranch.method.stability);
    end
    hopf=p_tohopf(funcs,hopf);
end;
hm=df_mthod(funcs,'hopf');
hm.point=dde_set_options(hm.point,pass_on,'pass_on');
if options.hopfcorrection
    [hopf,suc]=p_correc(funcs,hopf,options.corpar,[],hm.point);
    if suc==0
        per=[];
        return;
    end;
end
[deg_psol,step_cond]=p_topsol(funcs,hopf,...
    options.radius,options.degree,options.intervals);
per=df_brnch(funcs,options.contpar,'psol');
per.parameter=ststbranch.parameter;
per.parameter.free=options.contpar;

per=replace_branch_pars(per,options.contpar,pass_on);
[psol,suc]=p_correc(funcs,deg_psol,options.contpar,step_cond,per.method.point,1, ...
    deg_psol);
if suc==0
    per=[];
    return;
end;
per.point=deg_psol;
per.point.profile=repmat(hopf.x,[1,size(per.point.profile,2)]);
per.point(2)=psol;
end