-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeh_analysis.m
72 lines (60 loc) · 1.84 KB
/
meh_analysis.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function retval = meh_analysis(T, Jacobians, Ndim, tol)
% meh_analysis(T, Jacobians)
%
% Mesochronic Analysis of a sequence of mesochronic Jacobians.
%
% T - vector of lengths of integration periods (length K)
% Jacobians - cell array of Ndim x Ndim x K or 3x3xK
% Ndim - dimension of state space, 2 or 3
% tol - tolerance for zero-matching criteria (1e-3 is a good value)
% set up output storage structures
Npoints = numel(Jacobians);
Dets = zeros([Npoints, length(T)]);
Traces = zeros(size(Dets));
Meh = zeros(size(Dets));
Compr = zeros(size(Dets));
NonNml = zeros(size(Dets));
NonDefect = zeros( size(Dets));
TrCof = zeros(size(Dets)); % Trace of Cofactor - used for 3d analysis
FTLE = zeros( size(Dets));
Hyp = zeros( size(Dets));
if Ndim == 3
disp('Using 3d mesohyperbolicity')
assert(exist('meh3d','file') == 2, '3d analysis not yet implemented');
meh = @(T, J)meh3d( T, J, tol);
else
disp('Using 2d mesohyperbolicity')
meh = @(T,J)meh2d(T,J);
end
% evaluate quantifiers for Jacobians
parfor m = 1:Npoints
% select the appropriate jacobian
myJacobians = Jacobians{m};
[classes, quants, spectral] = meh( T, myJacobians );
% spectral quantities
Dets(m,:) = spectral.Dets;
Traces(m,:) = spectral.Traces;
if isfield(spectral,'TrCofs')
TrCof(m,:) = spectral.TrCofs;
end
% quantifiers of mesochronic analysis criteria
Compr(m,:) = quants.Compr;
NonNml(m,:) = quants.NonNml;
NonDefect(m,:) = quants.NonDefect;
FTLE(m,:) = quants.FTLE;
Hyp(m,:) = quants.Hyp;
% mesochronic classes
Meh(m,:) = classes;
end
% create and store output structures
retval.Dets = Dets;
retval.Traces = Traces;
if Ndim == 3
retval.TrCof = TrCof;
end
retval.Meh = Meh;
retval.Compr = Compr;
retval.NonNml = NonNml;
retval.FTLE = FTLE;
retval.Hyp = Hyp;
retval.NonDefect = NonDefect;