Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MSA Toolkit
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
Container 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
Aerodynamics and Flight Dynamics
Mission Analysis
MSA Toolkit
Commits
34e2fc6b
Commit
34e2fc6b
authored
1 month ago
by
Marco Luigi Gaibotti
Browse files
Options
Downloads
Patches
Plain Diff
[coeff-transport] mainAutoMatProtub now exports Coefficient class directly
parent
0ccd143b
Branches
Branches containing commit
No related tags found
1 merge request
!18
Coeff transport
Pipeline
#11368
failed
1 month ago
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
autoMatricesProtub/mainAutoMatProtub.m
+8
-7
8 additions, 7 deletions
autoMatricesProtub/mainAutoMatProtub.m
autoMatricesProtub/src/exportVars.m
+31
-17
31 additions, 17 deletions
autoMatricesProtub/src/exportVars.m
with
39 additions
and
24 deletions
autoMatricesProtub/mainAutoMatProtub.m
+
8
−
7
View file @
34e2fc6b
function
[
coeffs
To
t
,
coeffs
To
tHighAOA
]
=
mainAutoMatProtub
(
rocket
,
environment
,
settings
,
options
)
function
[
coeffs
Ou
t
,
coeffs
Ou
tHighAOA
]
=
mainAutoMatProtub
(
rocket
,
environment
,
settings
,
options
)
arguments
arguments
rocket
=
[];
% Empty by default
rocket
=
[];
% Empty by default
environment
Environment
=
Environment
.
empty
environment
Environment
=
Environment
.
empty
...
@@ -98,12 +98,13 @@ input = createDissileInput(rocket, autoMatSettings.vars);
...
@@ -98,12 +98,13 @@ input = createDissileInput(rocket, autoMatSettings.vars);
[
coeffsTot
,
finsCN
]
=
dissileMatcom
(
input
);
[
coeffsTot
,
finsCN
]
=
dissileMatcom
(
input
);
%% SAVE DATA
%% SAVE DATA
if
options
.
saveVars
saveVars
(
autoMatSettings
.
varsHighAOA
,
rocket
,
mission
,
coeffsTotHighAOA
,
finsCNHighAOA
,
...
coeffsOut
=
exportVars
(
...
chosenXcg
,
autoMatSettings
.
saveFinsCN
,
'aeroCoefficientsHighAOA.mat'
);
autoMatSettings
.
varsHighAOA
,
rocket
,
mission
,
coeffsTotHighAOA
,
finsCNHighAOA
,
chosenXcg
,
...
saveVars
(
autoMatSettings
.
vars
,
rocket
,
mission
,
coeffsTot
,
finsCN
,
...
autoMatSettings
.
saveFinsCN
,
options
.
saveVars
,
'aeroCoefficientsHighAOA.mat'
);
chosenXcg
,
autoMatSettings
.
saveFinsCN
,
'aeroCoefficients.mat'
);
coeffsOutHighAOA
=
exportVars
(
...
end
autoMatSettings
.
vars
,
rocket
,
mission
,
coeffsTot
,
finsCN
,
chosenXcg
,
...
autoMatSettings
.
saveFinsCN
,
options
.
saveVars
,
'aeroCoefficients.mat'
);
AMtime
=
toc
;
AMtime
=
toc
;
fprintf
(
'Aerodynamics Prediction completed \n'
)
fprintf
(
'Aerodynamics Prediction completed \n'
)
...
...
This diff is collapsed.
Click to expand it.
autoMatricesProtub/src/
save
Vars.m
→
autoMatricesProtub/src/
export
Vars.m
+
31
−
17
View file @
34e2fc6b
function
saveVars
(
vars
,
rocket
,
mission
,
total
,
finsCN
,
chosenXcg
,
saveFinsCN
,
outputName
)
function
coeffs
=
exportVars
(
vars
,
rocket
,
mission
,
total
,
finsCN
,
chosenXcg
,
...
saveFinsCN
,
saveToFile
,
outputName
)
arguments
arguments
vars
vars
...
@@ -8,6 +9,7 @@ arguments
...
@@ -8,6 +9,7 @@ arguments
finsCN
finsCN
chosenXcg
chosenXcg
saveFinsCN
saveFinsCN
saveToFile
outputName
outputName
end
end
...
@@ -40,14 +42,34 @@ if strcmp(rocket.parafoil.noseType,'MHAACK')
...
@@ -40,14 +42,34 @@ if strcmp(rocket.parafoil.noseType,'MHAACK')
geometry
.
cMod
=
rocket
.
parafoil
.
noseCMod
;
geometry
.
cMod
=
rocket
.
parafoil
.
noseCMod
;
geometry
.
pMod
=
rocket
.
parafoil
.
nosePMod
;
geometry
.
pMod
=
rocket
.
parafoil
.
nosePMod
;
else
else
error
(
'parafoil.pMod and/or parafoil.cMod are not defined; check
simulationsData
'
)
error
(
'parafoil.pMod and/or parafoil.cMod are not defined; check
rocketConfig
'
)
end
end
end
end
geometry
.
xcg
=
chosenXcg
;
geometry
.
xcg
=
chosenXcg
;
%% CREATING OUTPUT
%% CREATING OUTPUT
outputPath
=
fullfile
(
mission
.
dataPath
,
outputName
);
outputPath
=
fullfile
(
mission
.
dataPath
,
outputName
);
if
rocket
.
dynamicDerivatives
,
fieldName
=
rocket
.
motor
.
name
;
else
,
fieldName
=
'generic'
;
end
if
saveFinsCN
finsCN
=
squeeze
(
finsCN
(
1
,
:,
:,
:,
:,
:));
% Consider only the first xcg bc fins CN is xcg-independent
else
finsCN
=
[];
end
coeffs
=
Coefficient
();
coeffs
.
state
=
state
;
coeffs
.
total
=
total
;
coeffs
.
geometry
=
geometry
;
coeffs
.
finsCN
=
finsCN
;
if
saveToFile
% Save files as struct to allow exporting
output
=
struct
();
output
=
struct
();
if
~
isfile
(
outputPath
)
if
~
isfile
(
outputPath
)
...
@@ -56,20 +78,12 @@ else
...
@@ -56,20 +78,12 @@ else
save
(
outputPath
,
'-struct'
,
'output'
,
'-append'
)
save
(
outputPath
,
'-struct'
,
'output'
,
'-append'
)
end
end
if
rocket
.
dynamicDerivatives
,
fieldName
=
rocket
.
motor
.
name
;
else
,
fieldName
=
'generic'
;
end
output
.
(
fieldName
)
=
struct
();
output
.
(
fieldName
)
=
struct
();
output
.
(
fieldName
)
.
state
=
state
;
output
.
(
fieldName
)
.
state
=
state
;
output
.
(
fieldName
)
.
total
=
total
;
output
.
(
fieldName
)
.
total
=
total
;
output
.
(
fieldName
)
.
geometry
=
geometry
;
output
.
(
fieldName
)
.
geometry
=
geometry
;
output
.
(
fieldName
)
.
finsCN
=
[];
if
saveFinsCN
finsCN
=
squeeze
(
finsCN
(
1
,
:,
:,
:,
:,
:));
% Consider only the first xcg bc fins CN is xcg-independent
output
.
(
fieldName
)
.
finsCN
=
finsCN
;
output
.
(
fieldName
)
.
finsCN
=
finsCN
;
end
save
(
outputPath
,
'-struct'
,
'output'
,
'-append'
)
save
(
outputPath
,
'-struct'
,
'output'
,
'-append'
);
end
end
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