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
efc03536
Verified
Commit
efc03536
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(plots): add new comparison plots
parent
d7fae90e
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
utils/analysis/getallpeaks.m
+20
-0
20 additions, 0 deletions
utils/analysis/getallpeaks.m
utils/plotwindonoff.m
+117
-0
117 additions, 0 deletions
utils/plotwindonoff.m
with
137 additions
and
0 deletions
utils/analysis/getallpeaks.m
0 → 100644
+
20
−
0
View file @
efc03536
function
peakLocs
=
getallpeaks
(
signal
,
sampling
)
% GETALLPEAKS Return all the peaks in the signal
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Signal analysis
freq
=
getmainfrequency
(
signal
,
sampling
);
% Get first and last peaks for wind-off conditions
[
~
,
peakLocs
]
=
findpeaks
(
signal
,
...
'MinPeakProminence'
,
max
(
signal
)
/
2
,
...
'MinPeakDistance'
,
((
1
/
freq
)
*
sampling
)
/
2
);
end
This diff is collapsed.
Click to expand it.
utils/plotwindonoff.m
0 → 100644
+
117
−
0
View file @
efc03536
function
plotwindonoff
(
ResData
)
% PLOTWINDONON Plots the forces in wind on and wind off conditions
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
POSITION
=
'Front'
;
INTERESTING_POINTS
=
[
0.10
,
2.5
,
4.6
0.10
,
2.5
,
7.7
0.10
,
3.5
,
2.5
0.10
,
3.5
,
4.6
0.10
,
3.5
,
7.7
];
for
i
=
1
:
size
(
ResData
,
1
)
for
j
=
1
:
size
(
ResData
,
2
)
if
isinteresting
(
ResData
(
i
,
j
),
INTERESTING_POINTS
)
expParam
=
sprintf
(
'd = %0.2f, f = %0.2f, V = %0.1f'
,
...
ResData
(
i
,
j
)
.
Testcase
.
dx
,
...
ResData
(
i
,
j
)
.
Testcase
.
freq
,
...
ResData
(
i
,
j
)
.
Testcase
.
airspeed
);
% Index of corresponding wind-off data
woIdx
=
(
j
)
-
mod
(
j
-
1
,
4
);
windOff
=
ResData
(
i
,
woIdx
)
.
(
POSITION
);
timeOff
=
ResData
(
i
,
woIdx
)
.
time
;
sampling
=
ResData
(
i
,
woIdx
)
.
sampling
;
windOn
=
ResData
(
i
,
j
)
.
(
POSITION
);
timeOn
=
ResData
(
i
,
j
)
.
time
;
meanPeakAngle
=
averagepeaks
(
windOff
.
angles
,
sampling
,
windOff
.
trueFreq
);
meanPeakFoff
=
averagepeaks
(
windOff
.
forces
(:,
3
),
sampling
,
windOff
.
trueFreq
);
meanPeakFon
=
averagepeaks
(
windOn
.
forces
(:,
3
),
sampling
,
windOn
.
trueFreq
);
% Trim to same length if needed
minLen
=
min
(
length
(
meanPeakFoff
),
length
(
meanPeakFon
));
meanPeakAngle
=
meanPeakAngle
(
1
:
minLen
);
meanPeakFoff
=
meanPeakFoff
(
1
:
minLen
);
meanPeakFon
=
meanPeakFon
(
1
:
minLen
);
meanDiff
=
meanPeakFon
-
meanPeakFoff
;
% True period
period
=
1
/
windOff
.
trueFreq
;
nPeriodIdx
=
period
*
sampling
;
time
=
(
0
:
length
(
meanDiff
)
-
1
)
/
nPeriodIdx
;
figure
;
hold
on
;
plot
(
time
,
meanPeakFoff
);
plot
(
time
,
meanPeakFon
);
plot
(
time
,
meanDiff
);
yyaxis
right
;
plot
(
time
,
meanPeakAngle
);
title
(
expParam
);
legend
(
'Wind off'
,
'Wind on'
,
'Diff'
);
grid
on
;
xlim
([
0
,
1
]);
figure
;
ax1
=
subplot
(
3
,
1
,
1
);
hold
on
;
plot
(
meanPeakAngle
,
meanPeakFon
);
plot
(
meanPeakAngle
(
round
(
end
/
5
)),
meanPeakFon
(
round
(
end
/
5
)),
'or'
);
title
([
'Wind on - '
,
expParam
]);
ax2
=
subplot
(
3
,
1
,
2
);
hold
on
;
plot
(
meanPeakAngle
,
meanPeakFoff
);
plot
(
meanPeakAngle
(
round
(
end
/
5
)),
meanPeakFoff
(
round
(
end
/
5
)),
'or'
);
title
([
'Wind off - '
,
expParam
]);
ax3
=
subplot
(
3
,
1
,
3
);
hold
on
;
plot
(
meanPeakAngle
,
meanDiff
);
plot
(
meanPeakAngle
(
round
(
end
/
5
)),
meanDiff
(
round
(
end
/
5
)),
'or'
);
title
([
'Diff - '
,
expParam
]);
linkaxes
([
ax1
ax2
ax3
],
'xy'
);
ax1
.
YLim
=
1.25
*
ax1
.
YLim
;
end
end
end
end
function
meanPeak
=
averagepeaks
(
signal
,
sampling
,
freq
)
% AVERAGEPEAKS Make the average of all peaks in the signal
period
=
1
/
freq
;
nPeriodIdx
=
period
*
sampling
;
peakLocs
=
getallpeaks
(
signal
,
sampling
);
% Remove first and last peaks
peakLocs
=
peakLocs
(
2
:
end
-
1
);
% Create mean peak
for
i
=
1
:
min
(
length
(
peakLocs
),
100
)
peakVals
(
i
,
:)
=
signal
(
round
(
peakLocs
(
i
)
-
nPeriodIdx
/
2
):
...
round
(
peakLocs
(
i
)
+
nPeriodIdx
/
2
));
end
meanPeak
=
mean
(
peakVals
);
end
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