Contents
Extract FRC
function extract_FRS(obj,oid,modes,order,mFreqs,parRange,outdof,optdof,scale_state,scale_obs,varargin)
m = numel(mFreqs);
assert(numel(modes)==2*m, 'The master subspace is not %dD.',2*m);
nCycle = obj.FRCOptions.nCycle;
Checking whether internal resonance indeed happens
if isempty(obj.System.spectrum)
[~,~,~] = obj.System.linear_spectral_analysis();
end
lambda = obj.System.spectrum.Lambda(modes);
lambdaRe = real(lambda);
lambdaIm = imag(lambda);
check_spectrum_and_internal_resonance(lambdaRe,lambdaIm,mFreqs);
SSM computation of autonomous part
obj.choose_E(modes)
[W_0,R_0] = obj.compute_whisker(order);
[beta,kappa] = check_auto_reduced_dynamics(R_0,order,mFreqs);
wcoeffs = []; cind = []; dind = [];
for k=1:order
W = W_0(k);
coeffs = W.coeffs(optdof,:);
ind = W.ind;
if ~isempty(coeffs)
wcoeffs = [wcoeffs coeffs];
cind = [cind; ind(:,1:2:end-1)];
dind = [dind; ind(:,2:2:end)];
end
end
SSM computation of non-autonomous part
iNonauto = [];
rNonauto = [];
kNonauto = [];
kappa_set= [obj.System.Fext.data.kappa];
kappa_pos = kappa_set(kappa_set>0);
num_kappa = numel(kappa_pos);
for k=1:num_kappa
kappak = kappa_pos(k);
idm = find(mFreqs(:)==kappak);
obj.System.Omega = lambdaIm(2*idm(1)-1);
[W_1, R_1, Flead] = obj.compute_perturbed_whisker(0,[],[]);
idk = find(kappa_set==kappak);
R_10 = R_1(idk).R.coeffs;
r = R_10(2*idm-1);
iNonauto = [iNonauto; idm];
rNonauto = [rNonauto; r];
kNonauto = [kNonauto; idk];
end
create data structure for observables
optData = create_data_for_po_amp(cind,dind,mFreqs,wcoeffs,optdof,obj,Flead);
calculation of FRS
if m==1 && strcmp(obj.FRSOptions.method,'level set')
gammas = compute_gamma(R_0);
cal_FRS_via_ana(obj,parRange,gammas,lambda,full(r),outdof,optdof,optData,R_1)
else
lamd = struct();
lamd.lambdaRe = lambdaRe; lamd.lambdaIm = lambdaIm;
Nonauto = struct();
Nonauto.iNonauto = iNonauto; Nonauto.rNonauto = rNonauto; Nonauto.kNonauto = kNonauto;
[fdata,~] = create_reduced_dynamics_data(beta,kappa,lamd,mFreqs,Nonauto,W_0,W_1,order,modes);
cal_FRS_via_cont_ep(oid,fdata,obj,m,nCycle,scale_state,scale_obs,mFreqs,...
optData,outdof,optdof,parRange,varargin{:});
end
end