Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rotare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Rouma Alexandre
Rotare
Commits
5876a34b
Verified
Commit
5876a34b
authored
1 year ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(Result): add support all perf in plot
parent
0494a9bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/classes/@Result/plotperf.m
+14
-18
14 additions, 18 deletions
src/classes/@Result/plotperf.m
with
14 additions
and
18 deletions
src/classes/@Result/plotperf.m
+
14
−
18
View file @
5876a34b
...
@@ -44,7 +44,7 @@ function plotperf(self, varargin)
...
@@ -44,7 +44,7 @@ function plotperf(self, varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Defaults and constants
% Defaults and constants
DEF
.
ALLOWED_PROPERTIES
=
{
'cT'
,
'cQ'
,
'cP'
};
DEF
.
ALLOWED_PROPERTIES
=
{
'thrust'
,
'torque'
,
'power'
,
'eff'
,
'cT'
,
'cQ'
,
'cP'
};
DEF
.
allowed_oper
=
self
.
operPts
.
Properties
.
VariableNames
;
DEF
.
allowed_oper
=
self
.
operPts
.
Properties
.
VariableNames
;
DEF
.
ALLOWED_SOLVERS
=
{
'leishman'
,
'indfact'
,
'indvel'
,
'stahlhut'
};
DEF
.
ALLOWED_SOLVERS
=
{
'leishman'
,
'indfact'
,
'indvel'
,
'stahlhut'
};
...
@@ -56,14 +56,15 @@ function plotperf(self, varargin)
...
@@ -56,14 +56,15 @@ function plotperf(self, varargin)
figure
(
'Name'
,
'Rotor performance'
);
figure
(
'Name'
,
'Rotor performance'
);
end
end
filtered
=
filtertable
(
self
.
summarize
,
...
[
filtered
,
idx
]
=
self
.
filter
(
operPt
.
altitude
,
operPt
.
speed
,
operPt
.
rpm
,
operPt
.
collective
);
operPt
.
altitude
,
operPt
.
speed
,
...
operPt
.
rpm
,
operPt
.
collective
);
for
iSolv
=
1
:
length
(
solvers
)
for
iSolv
=
1
:
length
(
solvers
)
perfSolv
=
sprintf
(
'%s_%s'
,
perf
,
solvers
{
iSolv
});
thissolv
=
solvers
{
iSolv
};
plot
(
filtered
.
(
oper
),
filtered
.
(
perfSolv
),
'DisplayName'
,
solvers
{
iSolv
});
if
iSolv
==
1
if
~
isempty
(
self
.
(
thissolv
))
dataVect
=
vectorize
(
filtered
.
(
thissolv
),
perf
);
plot
(
self
.
operPts
(
idx
,
:)
.
(
oper
),
dataVect
,
'DisplayName'
,
solvers
{
iSolv
});
hold
on
;
hold
on
;
end
end
end
end
...
@@ -84,7 +85,7 @@ function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin)
...
@@ -84,7 +85,7 @@ function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin)
addRequired
(
p
,
'speed'
,
valData
);
addRequired
(
p
,
'speed'
,
valData
);
addRequired
(
p
,
'rpm'
,
valData
);
addRequired
(
p
,
'rpm'
,
valData
);
addRequired
(
p
,
'collective'
,
valData
);
addRequired
(
p
,
'collective'
,
valData
);
addParameter
(
p
,
'solvers'
,
{
'leishman'
,
'indfact'
,
'indvel'
,
'stahlhut'
}
);
addParameter
(
p
,
'solvers'
,
DEF
.
ALLOWED_SOLVERS
);
addParameter
(
p
,
'newFig'
,
false
,
valLogi
);
addParameter
(
p
,
'newFig'
,
false
,
valLogi
);
parse
(
p
,
varargin
{:});
parse
(
p
,
varargin
{:});
...
@@ -100,18 +101,13 @@ function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin)
...
@@ -100,18 +101,13 @@ function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin)
newFig
=
p
.
Results
.
newFig
;
newFig
=
p
.
Results
.
newFig
;
end
end
function
filtered
=
filtertable
(
inputTable
,
alt
,
speed
,
rpm
,
coll
)
function
vect
=
vectorize
(
struct
,
prop
)
% FILTERTABLE Filter the data with corresponding alt, coll, rpm and speed from the summary table
% VECTORIZE Transform struct array into a vector
iAlt
=
getidx
(
'altitude'
,
alt
);
iSpeed
=
getidx
(
'speed'
,
speed
);
iRpm
=
getidx
(
'rpm'
,
rpm
);
iColl
=
getidx
(
'collective'
,
coll
);
filtered
=
inputTable
(
iAlt
&
iColl
&
iRpm
&
iSpeed
,
:
);
vect
=
zeros
(
1
,
length
(
struct
)
);
f
unction
idx
=
getidx
(
type
,
val
)
f
or
i
=
1
:
length
(
struct
)
idx
=
inputTable
.
(
type
)
==
val
|
isnan
(
val
);
vect
(
i
)
=
struct
(
i
)
.
(
prop
);
end
end
end
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