From 0d7a3c50f9f2c0c532847cf80db61ab8068854b8 Mon Sep 17 00:00:00 2001 From: Rob Falck Date: Wed, 19 Jul 2023 16:19:50 -0400 Subject: [PATCH] cleanup --- .../test/test_tandem_phases.py | 4 +--- .../finite_burn_orbit_raise_problem.py | 24 +++++++++---------- .../linkage/test/test_linkage_report.py | 3 ++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/dymos/examples/brachistochrone/test/test_tandem_phases.py b/dymos/examples/brachistochrone/test/test_tandem_phases.py index 33dd80622..86ac656bc 100644 --- a/dymos/examples/brachistochrone/test/test_tandem_phases.py +++ b/dymos/examples/brachistochrone/test/test_tandem_phases.py @@ -65,7 +65,7 @@ def make_brachistochrone_phase(transcription='gauss-lobatto', num_segments=8, tr return phase -# @use_tempdirs +@use_tempdirs @require_pyoptsparse(optimizer='SLSQP') class TestTandemPhases(unittest.TestCase): @@ -164,8 +164,6 @@ def _run_transcription(self, transcription): p.run_driver() - om.n2(p) - expected = np.sqrt((10-0)**2 + (10 - 5)**2) assert_near_equal(p['phase1.timeseries.S'][-1], expected, tolerance=1.0E-3) diff --git a/dymos/examples/finite_burn_orbit_raise/finite_burn_orbit_raise_problem.py b/dymos/examples/finite_burn_orbit_raise/finite_burn_orbit_raise_problem.py index cf70784d9..9cd701da9 100644 --- a/dymos/examples/finite_burn_orbit_raise/finite_burn_orbit_raise_problem.py +++ b/dymos/examples/finite_burn_orbit_raise/finite_burn_orbit_raise_problem.py @@ -42,13 +42,13 @@ def make_traj(transcription='gauss-lobatto', transcription_order=3, compressed=F burn1 = traj.add_phase('burn1', burn1) burn1.set_time_options(fix_initial=True, duration_bounds=(.5, 10), units='TU') - burn1.add_state('r', fix_initial=True, fix_final=False, defect_scaler=100.0, + burn1.add_state('r', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='r_dot', units='DU') - burn1.add_state('theta', fix_initial=True, fix_final=False, defect_scaler=100.0, + burn1.add_state('theta', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='theta_dot', units='rad') - burn1.add_state('vr', fix_initial=True, fix_final=False, defect_scaler=100.0, + burn1.add_state('vr', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='vr_dot', units='DU/TU') - burn1.add_state('vt', fix_initial=True, fix_final=False, defect_scaler=100.0, + burn1.add_state('vt', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='vt_dot', units='DU/TU') burn1.add_state('accel', fix_initial=True, fix_final=False, rate_source='at_dot', units='DU/TU**2') @@ -61,13 +61,13 @@ def make_traj(transcription='gauss-lobatto', transcription_order=3, compressed=F coast = dm.Phase(ode_class=FiniteBurnODE, transcription=t[transcription]) coast.set_time_options(initial_bounds=(0.5, 20), duration_bounds=(.5, 50), duration_ref=50, units='TU') - coast.add_state('r', fix_initial=False, fix_final=False, defect_scaler=100.0, + coast.add_state('r', fix_initial=False, fix_final=False, defect_scaler=1.0, rate_source='r_dot', units='DU') - coast.add_state('theta', fix_initial=False, fix_final=False, defect_scaler=100.0, + coast.add_state('theta', fix_initial=False, fix_final=False, defect_scaler=1.0, rate_source='theta_dot', units='rad') - coast.add_state('vr', fix_initial=False, fix_final=False, defect_scaler=100.0, + coast.add_state('vr', fix_initial=False, fix_final=False, defect_scaler=1.0, rate_source='vr_dot', units='DU/TU') - coast.add_state('vt', fix_initial=False, fix_final=False, defect_scaler=100.0, + coast.add_state('vt', fix_initial=False, fix_final=False, defect_scaler=1.0, rate_source='vt_dot', units='DU/TU') coast.add_state('accel', fix_initial=True, fix_final=True, rate_source='at_dot', units='DU/TU**2') @@ -87,13 +87,13 @@ def make_traj(transcription='gauss-lobatto', transcription_order=3, compressed=F burn2.set_time_options(initial_bounds=(1.0, 60), duration_bounds=(-10.0, -0.5), initial_ref=10, units='TU') - burn2.add_state('r', fix_initial=True, fix_final=False, defect_scaler=100.0, + burn2.add_state('r', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='r_dot', units='DU') - burn2.add_state('theta', fix_initial=False, fix_final=False, defect_scaler=100.0, + burn2.add_state('theta', fix_initial=False, fix_final=False, defect_scaler=1.0, rate_source='theta_dot', units='rad') - burn2.add_state('vr', fix_initial=True, fix_final=False, defect_scaler=1000.0, + burn2.add_state('vr', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='vr_dot', units='DU/TU') - burn2.add_state('vt', fix_initial=True, fix_final=False, defect_scaler=1000.0, + burn2.add_state('vt', fix_initial=True, fix_final=False, defect_scaler=1.0, rate_source='vt_dot', units='DU/TU') burn2.add_state('accel', fix_initial=False, fix_final=False, defect_scaler=1.0, rate_source='at_dot', units='DU/TU**2') diff --git a/dymos/visualization/linkage/test/test_linkage_report.py b/dymos/visualization/linkage/test/test_linkage_report.py index b85e0fce1..0f01b0bc7 100644 --- a/dymos/visualization/linkage/test/test_linkage_report.py +++ b/dymos/visualization/linkage/test/test_linkage_report.py @@ -4,7 +4,7 @@ import unittest import openmdao.api as om -from openmdao.utils.testing_utils import use_tempdirs +from openmdao.utils.testing_utils import use_tempdirs, require_pyoptsparse import dymos as dm from dymos.examples.balanced_field.balanced_field_ode import BalancedFieldODEComp @@ -25,6 +25,7 @@ def _flatten_dict(d, parent_key='', sep='.'): @use_tempdirs class TestLinkageReport(unittest.TestCase): + @require_pyoptsparse(optimizer='IPOPT') def test_model_data(self): """ Test that model data for the linkage report contains the expected data.