Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gyacomo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Cyril David Hoffmann
Gyacomo
Commits
f916da89
Commit
f916da89
authored
4 years ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
Statistical analysis and 3D plots in phase space
parent
15277710
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/create_gif_3D.m
+49
-0
49 additions, 0 deletions
matlab/create_gif_3D.m
wk/analysis_stat_2D.m
+42
-0
42 additions, 0 deletions
wk/analysis_stat_2D.m
with
91 additions
and
0 deletions
matlab/create_gif_3D.m
0 → 100644
+
49
−
0
View file @
f916da89
title1
=
GIFNAME
;
FIGDIR
=
BASIC
.
RESDIR
;
GIFNAME
=
[
FIGDIR
,
GIFNAME
,
'.gif'
];
% Setup figure frame
fig
=
figure
(
'Color'
,
'white'
,
'Position'
,
[
100
,
100
,
400
,
400
]);
plt
=
@
(
x
)
squeeze
(
reshape
(
x
(:,:,
1
),[],
1
));
scale_x
=
max
(
abs
(
plt
(
X
(:,:,
1
))));
scale_y
=
max
(
abs
(
plt
(
Y
(:,:,
1
))));
scale_z
=
max
(
abs
(
plt
(
Z
(:,:,
1
))));
plot3
(
plt
(
X
)/
scale_x
,
plt
(
Y
)/
scale_y
,
plt
(
Z
)/
scale_z
,
'.k'
,
'MarkerSize'
,
MARKERSIZE
);
view
(
VIEW
);
colormap
jet
axis
tight
manual
% this ensures that getframe() returns a consistent size
in
=
1
;
nbytes
=
fprintf
(
2
,
'frame %d/%d'
,
in
,
numel
(
FRAMES
));
for
n
=
FRAMES
% loop over selected frames
plt
=
@
(
x
)
squeeze
(
reshape
(
x
(:,:,
n
),[],
1
));
scale_x
=
max
(
abs
(
plt
(
X
)));
scale_y
=
max
(
abs
(
plt
(
Y
)));
scale_z
=
max
(
abs
(
plt
(
Z
)));
plot3
(
plt
(
X
)/
scale_x
,
plt
(
Y
)/
scale_y
,
plt
(
Z
)/
scale_z
,
'.k'
,
'MarkerSize'
,
MARKERSIZE
);
view
(
VIEW
);
xlabel
(
XNAME
);
ylabel
(
YNAME
);
zlabel
(
ZNAME
);
title
([
'$t \approx$'
,
sprintf
(
'%.3d'
,
ceil
(
T
(
n
)))
...
,
', scaling = '
,
sprintf
(
'%.1e'
,
scale_x
)]);
grid
on
;
drawnow
% Capture the plot as an image
frame
=
getframe
(
fig
);
im
=
frame2im
(
frame
);
[
imind
,
cm
]
=
rgb2ind
(
im
,
32
);
% Write to the GIF File
if
in
==
1
imwrite
(
imind
,
cm
,
GIFNAME
,
'gif'
,
'Loopcount'
,
inf
);
else
imwrite
(
imind
,
cm
,
GIFNAME
,
'gif'
,
'WriteMode'
,
'append'
,
'DelayTime'
,
DELAY
);
end
% terminal info
while
nbytes
>
0
fprintf
(
'\b'
)
nbytes
=
nbytes
-
1
;
end
nbytes
=
fprintf
(
2
,
'frame %d/%d'
,
n
,
numel
(
FRAMES
));
in
=
in
+
1
;
end
disp
(
' '
)
disp
([
'Gif saved @ : '
,
GIFNAME
])
This diff is collapsed.
Click to expand it.
wk/analysis_stat_2D.m
0 → 100644
+
42
−
0
View file @
f916da89
if
0
%% ni ne phase space for different time windows
fig
=
figure
;
t0
=
20
;
t1
=
20
;
[
~
,
it0
]
=
min
(
abs
(
t0
-
Ts2D
));
[
~
,
it1
]
=
min
(
abs
(
t1
-
Ts2D
));
plt
=
@
(
x
)
squeeze
(
reshape
(
x
(:,:,
it0
:
it1
),[],
1
));
plot
(
plt
(
ni00
),
plt
(
ne00
),
'.'
);
title
([
'$'
,
num2str
(
Ts2D
(
it0
)),
'\leq t \leq'
,
num2str
(
Ts2D
(
it1
)),
'$'
]);
xlabel
(
'$n_i$'
);
ylabel
(
'$n_e$'
);
end
if
0
%% histograms
fig
=
figure
;
t0
=
100
;
t1
=
100
;
[
~
,
it0
]
=
min
(
abs
(
t0
-
Ts2D
));
[
~
,
it1
]
=
min
(
abs
(
t1
-
Ts2D
));
plt
=
@
(
x
)
squeeze
(
reshape
(
x
(:,:,
it0
:
it1
),[],
1
));
hist
(
plt
(
ni00
),
100
);
hold
on
title
([
'$'
,
num2str
(
Ts2D
(
it0
)),
'\leq t \leq'
,
num2str
(
Ts2D
(
it1
)),
'$'
]);
xlabel
(
'$n_i$'
);
end
if
0
%% ni ne phi 3D phase space
fig
=
figure
;
t0
=
20
;
t1
=
20
;
[
~
,
it0
]
=
min
(
abs
(
t0
-
Ts2D
));
[
~
,
it1
]
=
min
(
abs
(
t1
-
Ts2D
));
plt
=
@
(
x
)
squeeze
(
reshape
(
x
(:,:,
it0
:
it1
),[],
1
));
plot3
(
plt
(
ni00
),
plt
(
ne00
),
plt
(
phi
),
'.'
,
'MarkerSize'
,
0.5
);
title
([
'$'
,
num2str
(
Ts2D
(
it0
)),
'\leq t \leq'
,
num2str
(
Ts2D
(
it1
)),
'$'
]);
xlabel
(
'$n_i$'
);
ylabel
(
'$n_e$'
);
zlabel
(
'$\phi$'
);
grid
on
;
end
t0
=
0
;
skip_
=
1
;
DELAY
=
0.01
*
skip_
;
FRAMES
=
floor
(
t0
/(
Ts2D
(
2
)
-
Ts2D
(
1
)))
+
1
:
skip_
:
numel
(
Ts2D
);
if
0
%% ni ne phi 3D phase space GIF
GIFNAME
=
[
'ni_ne_phi_phase_space'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
X
=
ne00
;
Y
=
ni00
;
Z
=
phi
;
T
=
Ts2D
;
MARKERSIZE
=
0.01
;
XNAME
=
'$n_i$'
;
YNAME
=
'$n_e$'
;
ZNAME
=
'$\phi$'
;
VIEW
=
[
1
,
-
1
,
1
];
create_gif_3D
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment