Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Common
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
Skyward
Matlab dependencies
Common
Commits
f641ab59
Commit
f641ab59
authored
1 year ago
by
giuliaghirardini
Browse files
Options
Downloads
Patches
Plain Diff
[refactoring-ode][functions] Updated descentParachute
parent
aa10286a
Branches
Branches containing commit
No related tags found
1 merge request
!3
Refactoring ODE functions
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
functions/odeFunctions/descentParachute.m
+15
-15
15 additions, 15 deletions
functions/odeFunctions/descentParachute.m
with
15 additions
and
15 deletions
functions/odeFunctions/descentParachute.m
+
15
−
15
View file @
f641ab59
function
[
dY
,
parout
]
=
descentParachute
(
t
,
Y
,
rocket
,
environment
,
wind
,
parachute
,
newS
ettings
,
descent
_d
ata
)
function
[
dY
,
parout
]
=
descentParachute
(
t
,
Y
,
rocket
,
environment
,
wind
,
parachute
,
s
ettings
,
descent
D
ata
)
arguments
t
Y
...
...
@@ -6,8 +6,8 @@ arguments
environment
Environment
wind
WindCustom
{
mustBeA
(
wind
,
{
'WindCustom'
,
'WindMatlab'
})}
parachute
Parachute
newS
ettings
Settings
descent
_d
ata
struct
s
ettings
Settings
descent
D
ata
struct
end
%{
descentParachute
-
ode
function
of
the
descent
with
parachute
...
...
@@ -40,23 +40,23 @@ SPDX-License-Identifier: GPL-3.0-or-later
%% recalling the state
% x = Y(1);
% y = Y(2);
z
=
Y
(
3
);
altitude
=
-
Y
(
3
);
u
=
Y
(
4
);
v
=
Y
(
5
);
w
=
Y
(
6
);
%% CONSTANTS
if
newS
ettings
.
simulator
.
stochNumber
>
1
if
isfield
(
s
ettings
.
simulator
.
stochNumber
)
% para = settings.stoch.para;
else
para
=
descent
_d
ata
.
para
;
% defined in stdRun {para = i; settings.paraNumber = para;}
para
=
descent
D
ata
.
para
;
% defined in stdRun {para = i; settings.paraNumber = para;}
end
stage
=
descent
_d
ata
.
stage
;
stage
=
descent
D
ata
.
stage
;
S
=
parachute
(
para
,
stage
)
.
S
;
% [m^2] Surface
CD
=
parachute
(
para
,
stage
)
.
CD
;
% [/] Parachute Drag Coefficient
CL
=
parachute
(
para
,
stage
)
.
CL
;
% [/] Parachute Lift Coefficient
S
=
parachute
(
para
,
stage
)
.
surface
;
% [m^2] Surface
CD
=
parachute
(
para
,
stage
)
.
cd
;
% [/] Parachute Drag Coefficient
CL
=
parachute
(
para
,
stage
)
.
cl
;
% [/] Parachute Lift Coefficient
if
stage
==
1
m
=
rocket
.
motor
.
structureMass
-
sum
(
rocket
.
stagesMass
)
-
sum
([
parachute
(:,
stage
+
1
:
end
)
.
mass
]);
...
...
@@ -64,13 +64,13 @@ else
m
=
rocket
.
stagesMass
(
stage
-
1
)
+
sum
([
parachute
(:,
stage
)
.
mass
]);
end
g
=
environment
.
g0
/(
1
+
(
-
z
*
1e-3
/
6371
))
^
2
;
% [N/kg] module of gravitational field
g
=
environment
.
g0
/(
1
+
(
altitude
*
1e-3
/
6371
))
^
2
;
% [N/kg] module of gravitational field
%% ADDING WIND (supposed to be added in NED axes);
if
isa
(
wind
,
'WindMatlab'
)
[
uw
,
vw
,
ww
]
=
wind
.
getVels
(
z
,
t
);
[
uw
,
vw
,
ww
]
=
wind
.
getVels
(
altitude
,
t
);
else
[
uw
,
vw
,
ww
]
=
wind
.
getVels
(
-
z
);
[
uw
,
vw
,
ww
]
=
wind
.
getVels
(
altitude
);
end
windVels
=
[
uw
vw
ww
];
...
...
@@ -83,8 +83,8 @@ wr = w - windVels(3);
V_norm
=
norm
([
ur
vr
wr
]);
%% ATMOSPHERE DATA
absoluteAltitude
=
-
z
+
environment
.
z0
;
[
~
,
a
,
P
,
rho
]
=
atmosphereData
(
absoluteAltitude
,
g
,
local
);
absoluteAltitude
=
altitude
+
environment
.
z0
;
[
~
,
~
,
P
,
rho
]
=
atmosphereData
(
absoluteAltitude
,
g
,
local
);
%% REFERENCE FRAME
% The parachutes are approximated as rectangular surfaces with the normal
...
...
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