@@ -198,7 +198,7 @@ def test_kinematic_car_ocp(
198198 with warnings .catch_warnings ():
199199 warnings .filterwarnings (
200200 'ignore' , message = "unable to solve" , category = UserWarning )
201- traj_ocp = fs .solve_flat_ocp (
201+ traj_ocp = fs .solve_flat_optimal (
202202 vehicle_flat , timepts , x0 , u0 ,
203203 trajectory_cost = traj_cost ,
204204 trajectory_constraints = input_constraints ,
@@ -384,7 +384,7 @@ def test_flat_solve_ocp(self, basis):
384384 terminal_cost = opt .quadratic_cost (
385385 flat_sys , 1e3 , 1e3 , x0 = xf , u0 = uf )
386386
387- traj_cost = fs .solve_flat_ocp (
387+ traj_cost = fs .solve_flat_optimal (
388388 flat_sys , timepts , x0 , u0 ,
389389 terminal_cost = terminal_cost , basis = basis )
390390
@@ -398,7 +398,7 @@ def test_flat_solve_ocp(self, basis):
398398 # Solve with trajectory and terminal cost functions
399399 trajectory_cost = opt .quadratic_cost (flat_sys , 0 , 1 , x0 = xf , u0 = uf )
400400
401- traj_cost = fs .solve_flat_ocp (
401+ traj_cost = fs .solve_flat_optimal (
402402 flat_sys , timepts , x0 , u0 , terminal_cost = terminal_cost ,
403403 trajectory_cost = trajectory_cost , basis = basis )
404404
@@ -421,7 +421,7 @@ def test_flat_solve_ocp(self, basis):
421421 assert np .any (x_cost [0 , :] < lb [0 ]) or np .any (x_cost [0 , :] > ub [0 ]) \
422422 or np .any (x_cost [1 , :] < lb [1 ]) or np .any (x_cost [1 , :] > ub [1 ])
423423
424- traj_const = fs .solve_flat_ocp (
424+ traj_const = fs .solve_flat_optimal (
425425 flat_sys , timepts , x0 , u0 ,
426426 terminal_cost = terminal_cost , trajectory_cost = trajectory_cost ,
427427 trajectory_constraints = constraints , basis = basis ,
@@ -444,7 +444,7 @@ def test_flat_solve_ocp(self, basis):
444444 # Use alternative keywords as well
445445 nl_constraints = [
446446 (sp .optimize .NonlinearConstraint , lambda x , u : x , lb , ub )]
447- traj_nlconst = fs .solve_flat_ocp (
447+ traj_nlconst = fs .solve_flat_optimal (
448448 flat_sys , timepts , x0 , u0 ,
449449 trajectory_cost = trajectory_cost , terminal_cost = terminal_cost ,
450450 trajectory_constraints = nl_constraints , basis = basis ,
@@ -640,7 +640,7 @@ def test_solve_flat_ocp_errors(self):
640640 # Solving without basis specified should be OK (may generate warning)
641641 with warnings .catch_warnings ():
642642 warnings .simplefilter ("ignore" )
643- traj = fs .solve_flat_ocp (flat_sys , timepts , x0 , u0 , cost_fcn )
643+ traj = fs .solve_flat_optimal (flat_sys , timepts , x0 , u0 , cost_fcn )
644644 x , u = traj .eval (timepts )
645645 np .testing .assert_array_almost_equal (x0 , x [:, 0 ])
646646 if not traj .success :
@@ -653,40 +653,40 @@ def test_solve_flat_ocp_errors(self):
653653
654654 # Solving without a cost function generates an error
655655 with pytest .raises (TypeError , match = "cost required" ):
656- traj = fs .solve_flat_ocp (flat_sys , timepts , x0 , u0 )
656+ traj = fs .solve_flat_optimal (flat_sys , timepts , x0 , u0 )
657657
658658 # Try to optimize with insufficient degrees of freedom
659659 with pytest .raises (ValueError , match = "basis set is too small" ):
660- traj = fs .solve_flat_ocp (
660+ traj = fs .solve_flat_optimal (
661661 flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
662662 basis = fs .PolyFamily (2 ))
663663
664664 # Solve with the errors in the various input arguments
665665 with pytest .raises (ValueError , match = "Initial state: Wrong shape" ):
666- traj = fs .solve_flat_ocp (
666+ traj = fs .solve_flat_optimal (
667667 flat_sys , timepts , np .zeros (3 ), u0 , cost_fcn )
668668 with pytest .raises (ValueError , match = "Initial input: Wrong shape" ):
669- traj = fs .solve_flat_ocp (
669+ traj = fs .solve_flat_optimal (
670670 flat_sys , timepts , x0 , np .zeros (3 ), cost_fcn )
671671
672672 # Constraint that isn't a constraint
673673 with pytest .raises (TypeError , match = "must be a list" ):
674- traj = fs .solve_flat_ocp (
674+ traj = fs .solve_flat_optimal (
675675 flat_sys , timepts , x0 , u0 , cost_fcn ,
676676 trajectory_constraints = np .eye (2 ), basis = fs .PolyFamily (8 ))
677677
678678 # Unknown constraint type
679679 with pytest .raises (TypeError , match = "unknown constraint type" ):
680- traj = fs .solve_flat_ocp (
680+ traj = fs .solve_flat_optimal (
681681 flat_sys , timepts , x0 , u0 , cost_fcn ,
682682 trajectory_constraints = [(None , 0 , 0 , 0 )],
683683 basis = fs .PolyFamily (8 ))
684684
685685 # Method arguments, parameters
686- traj_method = fs .solve_flat_ocp (
686+ traj_method = fs .solve_flat_optimal (
687687 flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
688688 basis = fs .PolyFamily (6 ), minimize_method = 'slsqp' )
689- traj_kwarg = fs .solve_flat_ocp (
689+ traj_kwarg = fs .solve_flat_optimal (
690690 flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
691691 basis = fs .PolyFamily (6 ), minimize_kwargs = {'method' : 'slsqp' })
692692 np .testing .assert_allclose (
@@ -695,7 +695,7 @@ def test_solve_flat_ocp_errors(self):
695695
696696 # Unrecognized keywords
697697 with pytest .raises (TypeError , match = "unrecognized keyword" ):
698- traj_method = fs .solve_flat_ocp (
698+ traj_method = fs .solve_flat_optimal (
699699 flat_sys , timepts , x0 , u0 , cost_fcn , solve_ivp_method = None )
700700
701701 @pytest .mark .parametrize (
0 commit comments