Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Data Processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Data Processing
Commits
6f57a79d
Verified
Commit
6f57a79d
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(plots): add new plots, improve plot style
parent
8820a868
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
processall.m
+8
-0
8 additions, 0 deletions
processall.m
utils/analysis/plotcf.m
+161
-19
161 additions, 19 deletions
utils/analysis/plotcf.m
utils/redfreq.m
+13
-0
13 additions, 0 deletions
utils/redfreq.m
utils/syncdata.m
+1
-1
1 addition, 1 deletion
utils/syncdata.m
with
183 additions
and
20 deletions
processall.m
+
8
−
0
View file @
6f57a79d
...
...
@@ -62,6 +62,14 @@ function ExpData = processall(idFile)
if
~
isempty
(
ExpData
(
iTest
)
.
arduFile
)
% Not for static tests (no ardu data)
[
arduShort
,
~
]
=
loadardu
(
ExpData
(
iTest
)
.
arduFile
);
% DEBUG
figure
;
hold
on
;
plot
(
tunnelData
(:,
1
));
plot
(
tunnelData
(:,
3
));
grid
on
;
[
arduShort
,
tunnelData
,
ExpData
(
iTest
)
.
arduStart
,
ExpData
(
iTest
)
.
tunnelStart
]
=
...
syncdata
(
arduShort
,
tunnelData
);
...
...
This diff is collapsed.
Click to expand it.
utils/analysis/plotcf.m
+
161
−
19
View file @
6f57a79d
...
...
@@ -14,10 +14,14 @@ function plotcf(ResData)
% One figure per dx
% Plot airspeeds in different colors
set
(
0
,
'defaulttextinterpreter'
,
'latex'
);
ONLY_ERR_BARS
=
true
;
ERR_CAPSIZE
=
3
;
OFFSET_STEPS
=
20
;
CHORD
=
0.05
;
INTERESTING_PLOTS
=
[
0.03
,
2
,
7.7
0.03
,
2
,
7.7
0.03
,
3
,
2.5
0.03
,
3
,
4.6
...
...
@@ -25,7 +29,7 @@ function plotcf(ResData)
0.03
,
3.5
,
4.6
0.03
,
3.5
,
7.7
0.05
,
1.25
,
4.6
%
0.05, 1.25, 4.6
% DRIFT ON INERTIA
0.05
,
2
,
7.7
0.05
,
3
,
7.7
0.05
,
3.5
,
2.5
...
...
@@ -38,14 +42,22 @@ function plotcf(ResData)
0.10
,
3.5
,
7.7
];
SAVE_TIKZ_PARAM
=
[
0
,
0
,
0
];
% Points to save ([0,0,0] to make sur nothing is save)
for
i
=
1
:
size
(
ResData
,
1
)
for
j
=
1
:
size
(
ResData
,
2
)
if
isinteresting
(
ResData
(
i
,
j
),
INTERESTING_PLOTS
)
expParam
=
sprintf
(
'd = %0.2f, f = %0.2f, V = %0.1f'
,
...
trueF
=
ResData
(
i
,
j
)
.
Front
.
trueFreq
;
redFreq
=
redfreq
(
trueF
,
CHORD
,
ResData
(
i
,
j
)
.
Testcase
.
airspeed
);
expParam
=
sprintf
(
'd = %0.2f, f = %0.2f, V = %0.1f (k = %0.02f)'
,
...
ResData
(
i
,
j
)
.
Testcase
.
dx
,
...
ResData
(
i
,
j
)
.
Testcase
.
freq
,
...
ResData
(
i
,
j
)
.
Testcase
.
airspeed
);
ResData
(
i
,
j
)
.
Testcase
.
airspeed
,
...
redFreq
);
offsets
=
ResData
(
i
,
j
)
.
AllPhases
.
offsets
;
cleanOffsets
=
-
175
:
OFFSET_STEPS
:
175
;
...
...
@@ -72,40 +84,170 @@ function plotcf(ResData)
xpos
=
cleanOffsets
-
meanOffset
+
stdOffset
;
figure
(
'Name'
,
'myfig'
);
subplot
(
211
);
ax1
=
subplot
(
211
);
setcolormap
();
hold
on
;
if
~
ONLY_ERR_BARS
plot
(
ResData
(
i
,
j
)
.
AllPhases
.
offsets
,
...
ResData
(
i
,
j
)
.
AllPhases
.
Front
.
cF
(:,
[
1
,
3
]),
'o'
);
end
errorbar
(
cleanOffsets
,
meanF
(:,
1
),
ynegF
(:,
1
),
yposF
(:,
1
),
xneg
,
xpos
,
'o'
);
errorbar
(
cleanOffsets
,
meanF
(:,
3
),
ynegF
(:,
3
),
yposF
(:,
3
),
xneg
,
xpos
,
'o'
);
errorbar
(
cleanOffsets
,
meanF
(:,
3
),
yposF
(:,
3
),
'o'
,
'Capsize'
,
ERR_CAPSIZE
);
errorbar
(
cleanOffsets
,
meanF
(:,
1
),
yposF
(:,
1
),
'o'
,
'Capsize'
,
ERR_CAPSIZE
);
hold
off
;
title
([
'Front module -- '
,
expParam
]);
setgca
();
subplot
(
212
);
setgca
(
'XTickLabel'
,
[],
...
'XLabel'
,
[]);
legend
({
'\cl'
,
'\cd'
},
'Location'
,
'SouthWest'
);
legend
(
'boxoff'
);
ax1
.
Position
(
3
)
=
1.25
*
ax1
.
Position
(
3
);
title
(
'Front'
);
ax2
=
subplot
(
212
);
setcolormap
();
hold
on
;
if
~
ONLY_ERR_BARS
plot
(
ResData
(
i
,
j
)
.
AllPhases
.
offsets
,
...
ResData
(
i
,
j
)
.
AllPhases
.
Aft
.
cF
(:,
[
1
,
3
]),
'o'
);
end
errorbar
(
cleanOffsets
,
meanA
(:,
1
),
ynegA
(:,
1
),
yposA
(:,
1
),
xneg
,
xpos
,
'o'
);
errorbar
(
cleanOffsets
,
meanA
(:,
3
),
ynegA
(:,
3
),
yposA
(:,
3
),
xneg
,
xpos
,
'o'
);
errorbar
(
cleanOffsets
,
meanA
(:,
3
),
yposA
(:,
3
),
'o'
,
'Capsize'
,
ERR_CAPSIZE
);
errorbar
(
cleanOffsets
,
meanA
(:,
1
),
yposA
(:,
1
),
'o'
,
'Capsize'
,
ERR_CAPSIZE
);
hold
off
;
title
([
'Aft module -- '
,
expParam
]);
title
(
ax2
,
'Aft'
);
setgca
();
legend
(
'Location'
,
'bestoutside'
,
'orientation'
,
'horizontal'
,
'Fx'
,
'Fz'
);
linkaxes
([
ax1
ax2
],
'xy'
);
ax2
.
Position
(
3
)
=
ax1
.
Position
(
3
);
title
(
'Aft'
);
if
isinteresting
(
ResData
(
i
,
j
),
SAVE_TIKZ_PARAM
)
figdir
=
'figures/results/'
;
filename
=
sprintf
(
'flapWindOn-Dx%0.2f_F%0.2f_V%0.1f.tex'
,
...
ResData
(
i
,
j
)
.
Testcase
.
dx
,
...
ResData
(
i
,
j
)
.
Testcase
.
freq
,
...
ResData
(
i
,
j
)
.
Testcase
.
airspeed
);
save2tikz
([
figdir
,
filename
],
'\small'
);
end
% Update titles after having saved
title
(
ax1
,
[
'Front - '
,
expParam
]);
title
(
ax2
,
[
'Aft - '
,
expParam
]);
% Save interesting stuff for other types of plots
Tmp
(
i
,
j
)
.
cleanOffsets
=
cleanOffsets
;
Tmp
(
i
,
j
)
.
meanF
=
meanF
;
Tmp
(
i
,
j
)
.
stdF
=
stdF
;
Tmp
(
i
,
j
)
.
meanA
=
meanA
;
Tmp
(
i
,
j
)
.
stdA
=
stdA
;
end
end
end
% Plot aft wings only for different spacing conditions
for
j
=
26
figure
(
'Name'
,
'Dx'
);
ax1
=
subplot
(
211
);
setcolormap
();
hold
on
;
errorbar
(
Tmp
(
2
,
j
)
.
cleanOffsets
,
Tmp
(
2
,
j
)
.
meanA
(:,
3
),
Tmp
(
2
,
j
)
.
stdA
(:,
3
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
errorbar
(
Tmp
(
2
,
j
)
.
cleanOffsets
,
Tmp
(
2
,
j
)
.
meanA
(:,
1
),
Tmp
(
2
,
j
)
.
stdA
(:,
1
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
hold
off
;
setgca
(
'XTickLabel'
,
[],
...
'XLabel'
,
[]);
title
(
'$\dx = 0.03 \unit{\m}$'
);
legend
({
'\cl'
,
'\cd'
},
'Location'
,
'NorthEast'
);
legend
(
'boxoff'
);
ax1
.
Position
(
3
)
=
1.25
*
ax1
.
Position
(
3
);
ax2
=
subplot
(
212
);
setcolormap
();
hold
on
;
errorbar
(
Tmp
(
1
,
j
)
.
cleanOffsets
,
Tmp
(
1
,
j
)
.
meanA
(:,
3
),
Tmp
(
1
,
j
)
.
stdA
(:,
3
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
errorbar
(
Tmp
(
1
,
j
)
.
cleanOffsets
,
Tmp
(
1
,
j
)
.
meanA
(:,
1
),
Tmp
(
1
,
j
)
.
stdA
(:,
1
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
hold
off
;
setgca
();
title
(
'$\dx = 0.10 \unit{\m}$'
);
linkaxes
([
ax1
ax2
],
'xy'
);
ax2
.
Position
(
3
)
=
ax1
.
Position
(
3
);
figdir
=
'figures/results/'
;
filename
=
sprintf
(
'flapWindOn-DxCompa-F%0.2f_V%0.1f.tex'
,
...
ResData
(
i
,
j
)
.
Testcase
.
freq
,
...
ResData
(
i
,
j
)
.
Testcase
.
airspeed
);
save2tikz
([
figdir
,
filename
],
'\small'
);
end
% Plot aft wings only for diff frequencies
j
=
20
;
figure
(
'Name'
,
'K'
);
ax1
=
subplot
(
211
);
setcolormap
();
hold
on
;
errorbar
(
Tmp
(
1
,
j
)
.
cleanOffsets
,
Tmp
(
1
,
j
)
.
meanA
(:,
3
),
Tmp
(
1
,
j
)
.
stdA
(:,
3
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
errorbar
(
Tmp
(
1
,
j
)
.
cleanOffsets
,
Tmp
(
1
,
j
)
.
meanA
(:,
1
),
Tmp
(
1
,
j
)
.
stdA
(:,
1
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
hold
off
;
setgca
(
'XTickLabel'
,
[],
...
'XLabel'
,
[]);
title
(
'$\redFreq = 0.05$'
);
legend
({
'\cl'
,
'\cd'
},
'Location'
,
'NorthEast'
);
legend
(
'boxoff'
);
ax1
.
Position
(
3
)
=
1.25
*
ax1
.
Position
(
3
);
j
=
28
;
ax2
=
subplot
(
212
);
setcolormap
();
hold
on
;
errorbar
(
Tmp
(
1
,
j
)
.
cleanOffsets
,
Tmp
(
1
,
j
)
.
meanA
(:,
3
),
Tmp
(
1
,
j
)
.
stdA
(:,
3
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
errorbar
(
Tmp
(
1
,
j
)
.
cleanOffsets
,
Tmp
(
1
,
j
)
.
meanA
(:,
1
),
Tmp
(
1
,
j
)
.
stdA
(:,
1
),
'o'
,
...
'Capsize'
,
ERR_CAPSIZE
);
hold
off
;
setgca
();
title
(
'$\redFreq = 0.07$'
);
linkaxes
([
ax1
ax2
],
'x'
);
ax2
.
Position
(
3
)
=
ax1
.
Position
(
3
);
figdir
=
'figures/results/'
;
filename
=
sprintf
(
'flapWindOn-kCompa-Dx%0.2f_V%0.1f.tex'
,
...
ResData
(
i
,
j
)
.
Testcase
.
dx
,
...
ResData
(
i
,
j
)
.
Testcase
.
airspeed
);
save2tikz
([
figdir
,
filename
],
'\small'
);
end
function
setgca
()
% SETGCA Sets the axes parameters
function
setgca
(
varargin
)
xlim
([
-
180
,
180
]);
grid
on
;
xlabel
(
'Phase offset [deg]'
);
ylabel
(
'\cl and \cd [-]'
);
xticks
([
-
180
:
90
:
180
]);
set
(
gca
,
...
'Box'
,
'off'
,
...
'TickDir'
,
'out'
,
...
'TickLength'
,
[
.
02
.
02
],
...
'XMinorTick'
,
'off'
,
...
'YMinorTick'
,
'off'
,
...
'YGrid'
,
'on'
,
...
'XGrid'
,
'on'
,
...
'XColor'
,
'k'
,
...
'YColor'
,
'k'
,
...
'GridLineStyle'
,
':'
,
...
'GridColor'
,
'k'
,
...
'GridAlpha'
,
0.25
,
...
'LineWidth'
,
1
,
...
'FontName'
,
'Helvetica'
,
...
'Fontsize'
,
14
);
if
nargin
>
0
set
(
gca
,
varargin
{:});
end
end
This diff is collapsed.
Click to expand it.
utils/redfreq.m
0 → 100644
+
13
−
0
View file @
6f57a79d
function
redFreq
=
redfreq
(
freq
,
chord
,
speed
)
% REFREQ Calculate the reduced frequency
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
redFreq
=
pi
*
freq
*
chord
/
speed
;
end
This diff is collapsed.
Click to expand it.
utils/syncdata.m
+
1
−
1
View file @
6f57a79d
...
...
@@ -71,7 +71,7 @@ function [arduSynced, tunnelSynced, arduStartTime, tunnelStartTime] = ...
end
function
[
startIdx
,
startTime
]
=
getstartardu
(
arduData
)
% GETSTARTARDU Get the starting point for the arduino dataset and the flapping direction at
% GETSTARTARDU Get the starting po
int for the arduino dataset and the flapping direction at
% start
ANGLE_IDX
=
[
2
,
3
];
% Indexes of the front and aft angles in arduData 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