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
a3665599
Commit
a3665599
authored
1 year ago
by
giuliaghirardini
Browse files
Options
Downloads
Patches
Plain Diff
[msa-refactoring][classes] Implemented new method for wind class
parent
60008658
Branches
Branches containing commit
No related tags found
1 merge request
!2
Final data structure
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
classes/components/Wind.m
+52
-7
52 additions, 7 deletions
classes/components/Wind.m
with
52 additions
and
7 deletions
classes/components/Wind.m
+
52
−
7
View file @
a3665599
...
...
@@ -54,6 +54,51 @@ classdef Wind < Component
end
function
setData
(
obj
)
% new setWindData
s
=
length
(
obj
.
altitudes
);
if
s
<=
1
obj
.
constantWind
=
true
;
if
strcmp
(
settings
.
magDistribution
(
1
),
"u"
)
mag
=
rand
(
1
)
*
(
obj
.
mag
(
2
,
1
)
-
obj
.
mag
(
1
,
1
))
+
obj
.
mag
(
1
,
1
);
else
mag
=
normrnd
(
obj
.
mag
(
1
,
1
),
obj
.
mag
(
2
,
1
),
1
);
end
if
strcmp
(
settings
.
azDistribution
(
1
),
"u"
)
az
=
rand
(
1
)
*
(
obj
.
az
(
2
,
1
)
-
obj
.
az
(
1
,
1
))
+
obj
.
az
(
1
,
1
);
else
az
=
normrnd
(
obj
.
az
(
1
,
1
),
obj
.
az
(
2
,
1
),
1
);
end
obj
.
magVec
=
mag
;
obj
.
azVec
=
az
;
else
obj
.
constantWind
=
false
;
magVector
=
nan
(
1
,
s
);
azVector
=
nan
(
1
,
s
);
isUniformMag
=
strcmp
(
obj
.
magDistribution
,
"u"
);
isUniformAz
=
strcmp
(
obj
.
azDistribution
,
"u"
);
uniformDis
=
@
(
val1
,
val2
)
rand
(
1
)
*
(
val2
-
val1
)
+
val1
;
gaussianDis
=
@
(
mean
,
sigma
)
normrnd
(
mean
,
sigma
,
1
);
for
i
=
1
:
s
if
isUniformMag
(
i
)
magVector
(
i
)
=
uniformDis
(
obj
.
mag
(
1
,
i
),
obj
.
mag
(
2
,
i
));
else
magVector
(
i
)
=
gaussianDis
(
obj
.
mag
(
1
,
i
),
obj
.
mag
(
2
,
i
));
end
if
isUniformAz
(
i
)
azVector
(
i
)
=
uniformDis
(
obj
.
az
(
1
,
i
),
obj
.
az
(
2
,
i
));
else
azVector
(
i
)
=
gaussianDis
(
obj
.
az
(
1
,
i
),
obj
.
az
(
2
,
i
));
end
end
obj
.
magVec
=
magVector
;
obj
.
azVec
=
azVector
;
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