Nonautonomous struct setup for computation

Nonautonomous struct setup for computation

Contents

function [W1,R1,kappas,Fext_ord] = nonAut_struct_setup(l,N,nKappa,order,FEXT)
        

NONAUT_STRUCT_SETUP

This function is used to initialise the data structures that are used in the non-autonomous SSM computation.

[W1,R1,kappas,Fext_ord]= NONAUT_STRUCT_SETUP(l,N,nKappa,order,FEXT)

See also: NONAUT_2NDORDER_WHISKER, NONAUT_1ST_ORDER_WHISKER

k_kappa   = size(FEXT.data(1).kappa,1);
kappas    = zeros(k_kappa,nKappa);
% intitalise data structures to store coefficients
idle = repmat(struct('coeffs',[],'ind',[]),order+1  , 1);
W1  = repmat(struct('kappa' ,[],'W',idle),nKappa, 1);
R1  = repmat(struct('kappa' ,[],'R',idle),nKappa, 1);

Fext_ord = zeros(1,nKappa);

for i = 1:nKappa
    Fext_ord(i)  = numel(FEXT.data(i).F_n_k);
    kappa = FEXT.data(i).kappa;
    W1(i).kappa = kappa;
    R1(i).kappa = kappa;
    kappas(:,i)  = kappa;

    W1(i).W(1).coeffs = sparse(N,1);
    W1(i).W(1).ind    = sparse(l,1);
    R1(i).R(1).coeffs = sparse(l,1);
    R1(i).R(1).ind    = sparse(l,1);
end
        
end