Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Implementation of Height Energy in SGM #97

Merged
merged 45 commits into from
Feb 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d4fd2ac
Initial commit for Height Energy SGM phase
crecine Nov 30, 2023
ca34560
moved empty execcomp into a function to be shared amongst ODEs
crecine Dec 1, 2023
a7c18fc
Converted takeoff and landing ODEs to be compatible with SGM
crecine Dec 5, 2023
27d6c12
Updated variable pass through from outer problem to SimuPy problem Ad…
crecine Dec 6, 2023
f3b8fcd
temp for debugging
crecine Dec 6, 2023
7d3b46e
temp commit for debugging
crecine Dec 8, 2023
2c4701f
Reduced usage of blocked_state_names by specifying states in more phases
crecine Dec 29, 2023
2285655
Added ability to auto-promote all auto_ivs variables
crecine Dec 29, 2023
5fc9c65
Added debug prints
crecine Dec 29, 2023
4676eab
added more prints
crecine Dec 29, 2023
6a6f5a6
Remove debug prints
crecine Dec 29, 2023
0e6f3fc
Added SGM phases for detailed takeoff and landing
crecine Jan 11, 2024
27490e8
Merge branch 'main' into flops_sgm
crecine Jan 17, 2024
7349550
Switched from mission_ODE to simple_mission_ODE
crecine Jan 17, 2024
f4c7017
Converting simple_mission to SGM
crecine Jan 18, 2024
c53993d
Merge branch 'sgm-update' into flops_sgm
crecine Jan 23, 2024
218e803
prepared for testing detailed takeoff and landing
crecine Jan 24, 2024
f5fff48
Merge branch 'main' into flops_sgm
crecine Jan 24, 2024
c999f70
Merge branch 'main' into flops_sgm
johnjasa Jan 25, 2024
f8596a1
Merge branch 'main' into flops_sgm
crecine Jan 31, 2024
f2fb553
cleaned up comments and removed unused values
crecine Jan 31, 2024
62c1d20
Adding flexible triggers and removing unused trajectories
crecine Feb 5, 2024
a9e8b68
Using flexible triggers
crecine Feb 6, 2024
28f9a78
fixed missing squeeze
crecine Feb 6, 2024
abd6143
Merge branch 'main' into flops_sgm
crecine Feb 6, 2024
52ea87e
fixing units and type hint
crecine Feb 6, 2024
abd99f7
Merge branch 'main' into flops_sgm
crecine Feb 7, 2024
6042876
Added some temporary debugging statements and tweaked triggers
crecine Feb 8, 2024
8335270
added debug environment files to gitignore
crecine Feb 10, 2024
33c0e8b
fixed typo
crecine Feb 12, 2024
35bc9dd
adding phase names to ascent subphases and adding states to phases
crecine Feb 14, 2024
edec537
restoring descent estimation
crecine Feb 14, 2024
546f1fa
reverted temporary debugging
crecine Feb 14, 2024
104f765
Merge branch 'main' into flops_sgm
crecine Feb 14, 2024
3ec4f9b
updated debug to verbosity
crecine Feb 14, 2024
0856940
added a bench test for SGM and add some key to list conversion
crecine Feb 14, 2024
6a9a2e3
Merge branch 'main' into flops_sgm
crecine Feb 14, 2024
afd6e8d
Merge branch 'main' into flops_sgm
crecine Feb 15, 2024
cfdb0da
moving HE SGM example to test case and minor refactoring
crecine Feb 16, 2024
ee630fe
Merge branch 'flops_sgm' of https://github.com/crecine/om-Aviary into…
crecine Feb 16, 2024
5e912d0
adding skip for missing pyoptsparse
crecine Feb 17, 2024
591a671
reverted test values
crecine Feb 20, 2024
7b09c6e
minor changes to tests
crecine Feb 20, 2024
a4f04ed
fixed value when clearing triggers
crecine Feb 20, 2024
d5a24eb
PR feedback
crecine Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added a bench test for SGM and add some key to list conversion
  • Loading branch information
crecine committed Feb 14, 2024
commit 085694035d423f3be2ac0b33a6a0682d5f3c155d
Original file line number Diff line number Diff line change
@@ -697,7 +697,7 @@ def compute_partials(self, inputs, J):
next_prob.state_equation_function(next_res.t[-1], next_res.x[-1, :])
costate[:] = next_prob.compute_totals(
output,
next_prob.states.keys(),
list(next_prob.states.keys()),
return_format='array'
).squeeze()

@@ -743,7 +743,7 @@ def compute_partials(self, inputs, J):
else:
dg_dx[0, :] = prob.compute_totals(
[channel_name],
prob.states.keys(),
list(prob.states.keys()),
return_format='array'
)

@@ -804,7 +804,7 @@ def compute_partials(self, inputs, J):

dh_j_dx = prob.compute_totals(
[state_name],
prob.states.keys(),
list(prob.states.keys()),
crecine marked this conversation as resolved.
Show resolved Hide resolved
return_format='array').squeeze()

dh_dparam[state_idx, :] = prob.compute_totals(
@@ -835,7 +835,7 @@ def compute_partials(self, inputs, J):

state_rate_names = [val['rate'] for _, val in prob.states.items()]
df_dx_data[idx, :, :] = prob.compute_totals(state_rate_names,
prob.states.keys(),
list(prob.states.keys()),
return_format='array').T
if param_dict:
df_dparam_data[idx, ...] = prob.compute_totals(
23 changes: 23 additions & 0 deletions aviary/validation_cases/benchmark_tests/test_bench_GwGm.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
from aviary.interface.default_phase_info.two_dof import phase_info
from aviary.interface.methods_for_level1 import run_aviary
from aviary.variable_info.variables import Aircraft, Mission
from aviary.variable_info.enums import AnalysisScheme


@use_tempdirs
@@ -60,8 +61,30 @@ def test_bench_GwGm_SNOPT(self):
assert_near_equal(prob.get_val("traj.desc2.timeseries.distance")[-1],
3675.0, tolerance=rtol)

@require_pyoptsparse(optimizer="SNOPT")
def test_bench_GwGm_shooting(self):
local_phase_info = deepcopy(phase_info)
prob = run_aviary('models/test_aircraft/aircraft_for_bench_GwGm.csv',
crecine marked this conversation as resolved.
Show resolved Hide resolved
local_phase_info, optimizer='IPOPT', run_driver=False,
analysis_scheme=AnalysisScheme.SHOOTING)

rtol = 0.01

assert_near_equal(prob.get_val(Mission.Design.GROSS_MASS),
174039., tolerance=rtol)

assert_near_equal(prob.get_val(Aircraft.Design.OPERATING_MASS),
95509, tolerance=rtol)

assert_near_equal(prob.get_val('traj.distance_final', units='NM'),
3774.3, tolerance=rtol)

assert_near_equal(prob.get_val('traj.mass_final', units='lbm'),
136823.47, tolerance=rtol)


if __name__ == '__main__':
# unittest.main()
test = ProblemPhaseTestCase()
test.test_bench_GwGm_SNOPT()
test.test_bench_GwGm_shooting()
Loading