You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using grid refinement on a problem with run_driver=True and solve_segments='forward' causes an array size mismatch error
Example
In test_aircraft_steady_flight.py changing line 105 to dm.run_problem(p, refine_iteration_limit=1) causes the test case test_ex_aircraft_steady_flight_solve to fail. The error is
File "/Users/kponnapa/codes/dymos/dymos/examples/aircraft_steady_flight/test/test_ex_aircraft_steady_flight.py", line 119, in test_ex_aircraft_steady_flight_solve p = ex_aircraft_steady_flight(optimizer='SLSQP', solve_segments='forward',
File "/Users/kponnapa/codes/dymos/dymos/examples/aircraft_steady_flight/test/test_ex_aircraft_steady_flight.py", line 105, in ex_aircraft_steady_flight dm.run_problem(p, refine_iteration_limit=1)
File "/Users/kponnapa/codes/dymos/dymos/run_problem.py", line 85, in run_problem failed = _refine_iter(problem, refine_iteration_limit, refine_method, case_prefix=case_prefix,
File "/Users/kponnapa/codes/dymos/dymos/grid_refinement/refinement.py", line 70, in _refine_iter failed = problem.run_driver(case_prefix=f'{_case_prefix}{refine_method}_{i}_')
File "/Users/kponnapa/codes/openmdao/openmdao/utils/hooks.py", line 130, in execute_hooks ret = f(*args, **kwargs)
File "/Users/kponnapa/codes/openmdao/openmdao/core/problem.py", line 856, in run_driver return self.driver.run()
File "/Users/kponnapa/codes/openmdao/openmdao/drivers/pyoptsparse_driver.py", line 321, in run coloring = self._get_coloring(run_model=not model_ran)
File "/Users/kponnapa/codes/openmdao/openmdao/utils/hooks.py", line 130, in execute_hooks ret = f(*args, **kwargs)
File "/Users/kponnapa/codes/openmdao/openmdao/core/driver.py", line 1290, in _get_coloring coloring = c_mod.dynamic_total_coloring(self, run_model=run_model,
File "/Users/kponnapa/codes/openmdao/openmdao/utils/coloring.py", line 1977, in dynamic_total_coloring coloring = compute_total_coloring(problem, num_full_jacs=num_full_jacs, tol=tol, orders=orders,
File "/Users/kponnapa/codes/openmdao/openmdao/utils/coloring.py", line 1911, in compute_total_coloring J, sparsity_info = _get_bool_total_jac(problem, num_full_jacs=num_full_jacs, tol=tol,
File "/Users/kponnapa/codes/openmdao/openmdao/utils/coloring.py", line 1649, in _get_bool_total_jac prob.run_model(reset_iter_counts=False)
File "/Users/kponnapa/codes/openmdao/openmdao/core/problem.py", line 810, in run_model self.model.run_solve_nonlinear()
File "/Users/kponnapa/codes/openmdao/openmdao/core/system.py", line 3992, in run_solve_nonlinear self._solve_nonlinear()
File "/Users/kponnapa/codes/openmdao/openmdao/core/group.py", line 2595, in _solve_nonlinear self._nonlinear_solver._solve_with_cache_check()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check self.solve() # don't use caching
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve self._gs_iter()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 787, in _gs_iter subsys._solve_nonlinear()
File "/Users/kponnapa/codes/openmdao/openmdao/core/group.py", line 2595, in _solve_nonlinear self._nonlinear_solver._solve_with_cache_check()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 825, in _solve_with_cache_check self.solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 583, in solve raise err
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 579, in solve self._solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 656, in _solve self._single_iteration()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/nonlinear/newton.py", line 241, in _single_iteration self.linesearch.solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 583, in solve raise err
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 579, in solve self._solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/linesearch/backtracking.py", line 233, in _solve self._enforce_bounds(step=du, alpha=1.0)
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/linesearch/backtracking.py", line 176, in _enforce_bounds _enforce_bounds_scalar(system._outputs, step, alpha, lower, upper)
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/linesearch/backtracking.py", line 568, in _enforce_bounds_scalar change_lower = 0. if lower_bounds is None else np.maximum(u_data, lower_bounds) - u_data ValueError: operands could not be broadcast together with shapes (4319,) (3752,)
Environment
Operating System: OS X 12.4
Python environment: Anaconda Python 3.9
Packages: Dymos v1.5.1dev0, OpenMDAO v3.19.1.dev0, pyoptsparse v2.8.3
The text was updated successfully, but these errors were encountered:
Issue Type
Description
Using grid refinement on a problem with
run_driver=True
andsolve_segments='forward'
causes an array size mismatch errorExample
In
test_aircraft_steady_flight.py
changing line 105 todm.run_problem(p, refine_iteration_limit=1)
causes the test casetest_ex_aircraft_steady_flight_solve
to fail. The error isFile "/Users/kponnapa/codes/dymos/dymos/examples/aircraft_steady_flight/test/test_ex_aircraft_steady_flight.py", line 119, in test_ex_aircraft_steady_flight_solve p = ex_aircraft_steady_flight(optimizer='SLSQP', solve_segments='forward',
File "/Users/kponnapa/codes/dymos/dymos/examples/aircraft_steady_flight/test/test_ex_aircraft_steady_flight.py", line 105, in ex_aircraft_steady_flight dm.run_problem(p, refine_iteration_limit=1)
File "/Users/kponnapa/codes/dymos/dymos/run_problem.py", line 85, in run_problem failed = _refine_iter(problem, refine_iteration_limit, refine_method, case_prefix=case_prefix,
File "/Users/kponnapa/codes/dymos/dymos/grid_refinement/refinement.py", line 70, in _refine_iter failed = problem.run_driver(case_prefix=f'{_case_prefix}{refine_method}_{i}_')
File "/Users/kponnapa/codes/openmdao/openmdao/utils/hooks.py", line 130, in execute_hooks ret = f(*args, **kwargs)
File "/Users/kponnapa/codes/openmdao/openmdao/core/problem.py", line 856, in run_driver return self.driver.run()
File "/Users/kponnapa/codes/openmdao/openmdao/drivers/pyoptsparse_driver.py", line 321, in run coloring = self._get_coloring(run_model=not model_ran)
File "/Users/kponnapa/codes/openmdao/openmdao/utils/hooks.py", line 130, in execute_hooks ret = f(*args, **kwargs)
File "/Users/kponnapa/codes/openmdao/openmdao/core/driver.py", line 1290, in _get_coloring coloring = c_mod.dynamic_total_coloring(self, run_model=run_model,
File "/Users/kponnapa/codes/openmdao/openmdao/utils/coloring.py", line 1977, in dynamic_total_coloring coloring = compute_total_coloring(problem, num_full_jacs=num_full_jacs, tol=tol, orders=orders,
File "/Users/kponnapa/codes/openmdao/openmdao/utils/coloring.py", line 1911, in compute_total_coloring J, sparsity_info = _get_bool_total_jac(problem, num_full_jacs=num_full_jacs, tol=tol,
File "/Users/kponnapa/codes/openmdao/openmdao/utils/coloring.py", line 1649, in _get_bool_total_jac prob.run_model(reset_iter_counts=False)
File "/Users/kponnapa/codes/openmdao/openmdao/core/problem.py", line 810, in run_model self.model.run_solve_nonlinear()
File "/Users/kponnapa/codes/openmdao/openmdao/core/system.py", line 3992, in run_solve_nonlinear self._solve_nonlinear()
File "/Users/kponnapa/codes/openmdao/openmdao/core/group.py", line 2595, in _solve_nonlinear self._nonlinear_solver._solve_with_cache_check()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check self.solve() # don't use caching
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve self._gs_iter()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 787, in _gs_iter subsys._solve_nonlinear()
File "/Users/kponnapa/codes/openmdao/openmdao/core/group.py", line 2595, in _solve_nonlinear self._nonlinear_solver._solve_with_cache_check()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 825, in _solve_with_cache_check self.solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 583, in solve raise err
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 579, in solve self._solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 656, in _solve self._single_iteration()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/nonlinear/newton.py", line 241, in _single_iteration self.linesearch.solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 583, in solve raise err
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/solver.py", line 579, in solve self._solve()
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/linesearch/backtracking.py", line 233, in _solve self._enforce_bounds(step=du, alpha=1.0)
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/linesearch/backtracking.py", line 176, in _enforce_bounds _enforce_bounds_scalar(system._outputs, step, alpha, lower, upper)
File "/Users/kponnapa/codes/openmdao/openmdao/solvers/linesearch/backtracking.py", line 568, in _enforce_bounds_scalar change_lower = 0. if lower_bounds is None else np.maximum(u_data, lower_bounds) - u_data
ValueError: operands could not be broadcast together with shapes (4319,) (3752,)
Environment
Operating System: OS X 12.4
Python environment: Anaconda Python 3.9
Packages: Dymos v1.5.1dev0, OpenMDAO v3.19.1.dev0, pyoptsparse v2.8.3
The text was updated successfully, but these errors were encountered: