Skip to content

Commit

Permalink
still need a linear solver (but only on the StateIndependentsComp) wh…
Browse files Browse the repository at this point in the history
…en input_initial=True for one or more states.
  • Loading branch information
robfalck committed Sep 13, 2023
1 parent b4675ac commit 8673ce2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def two_burn_orbit_raise_problem(transcription='gauss-lobatto', optimizer='SLSQP
p.driver.opt_settings['nlp_scaling_method'] = 'gradient-based' # for faster convergence
p.driver.opt_settings['alpha_for_y'] = 'safer-min-dual-infeas'
p.driver.opt_settings['mu_strategy'] = 'monotone'
p.driver.opt_settings['derivative_test'] = 'first-order'
if show_output:
p.driver.opt_settings['print_level'] = 5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def test_ex_two_burn_orbit_raise_connected(self):
compressed=False, optimizer=optimizer,
show_output=False, connected=True, run_driver=True)

p.check_totals(compact_print=True)

if p.model.traj.phases.burn2 in p.model.traj.phases._subsystems_myproc:
assert_near_equal(p.get_val('traj.burn2.states:deltav')[0], 0.3995,
tolerance=4.0E-3)
Expand Down
3 changes: 1 addition & 2 deletions dymos/transcriptions/pseudospectral/pseudospectral_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def setup_states(self, phase):
if self.any_solved_segs or self.any_connected_opt_segs:
indep = StateIndependentsComp(grid_data=grid_data,
state_options=phase.state_options)
indep.linear_solver = om.DirectSolver()
else:
indep = om.IndepVarComp()

Expand Down Expand Up @@ -513,8 +514,6 @@ def configure_solvers(self, phase):
newton.options['stall_limit'] = 3
newton.linesearch = om.BoundsEnforceLS()

# even though you don't need a nl_solver for connections, you still ln_solver since its implicit
if self.any_solved_segs or self._implicit_duration:
if isinstance(phase.linear_solver, om.LinearRunOnce):
phase.linear_solver = om.DirectSolver()

Expand Down

0 comments on commit 8673ce2

Please sign in to comment.