@@ -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 ,
@@ -668,7 +668,7 @@ def test_solve_flat_ocp_errors(self):
668668 # Solving without basis specified should be OK (may generate warning)
669669 with warnings .catch_warnings ():
670670 warnings .simplefilter ("ignore" )
671- traj = fs .solve_flat_ocp (flat_sys , timepts , x0 , u0 , cost_fcn )
671+ traj = fs .solve_flat_optimal (flat_sys , timepts , x0 , u0 , cost_fcn )
672672 x , u = traj .eval (timepts )
673673 np .testing .assert_array_almost_equal (x0 , x [:, 0 ])
674674 if not traj .success :
@@ -681,40 +681,40 @@ def test_solve_flat_ocp_errors(self):
681681
682682 # Solving without a cost function generates an error
683683 with pytest .raises (TypeError , match = "cost required" ):
684- traj = fs .solve_flat_ocp (flat_sys , timepts , x0 , u0 )
684+ traj = fs .solve_flat_optimal (flat_sys , timepts , x0 , u0 )
685685
686686 # Try to optimize with insufficient degrees of freedom
687687 with pytest .raises (ValueError , match = "basis set is too small" ):
688- traj = fs .solve_flat_ocp (
688+ traj = fs .solve_flat_optimal (
689689 flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
690690 basis = fs .PolyFamily (2 ))
691691
692692 # Solve with the errors in the various input arguments
693693 with pytest .raises (ValueError , match = "Initial state: Wrong shape" ):
694- traj = fs .solve_flat_ocp (
694+ traj = fs .solve_flat_optimal (
695695 flat_sys , timepts , np .zeros (3 ), u0 , cost_fcn )
696696 with pytest .raises (ValueError , match = "Initial input: Wrong shape" ):
697- traj = fs .solve_flat_ocp (
697+ traj = fs .solve_flat_optimal (
698698 flat_sys , timepts , x0 , np .zeros (3 ), cost_fcn )
699699
700700 # Constraint that isn't a constraint
701701 with pytest .raises (TypeError , match = "must be a list" ):
702- traj = fs .solve_flat_ocp (
702+ traj = fs .solve_flat_optimal (
703703 flat_sys , timepts , x0 , u0 , cost_fcn ,
704704 trajectory_constraints = np .eye (2 ), basis = fs .PolyFamily (8 ))
705705
706706 # Unknown constraint type
707707 with pytest .raises (TypeError , match = "unknown constraint type" ):
708- traj = fs .solve_flat_ocp (
708+ traj = fs .solve_flat_optimal (
709709 flat_sys , timepts , x0 , u0 , cost_fcn ,
710710 trajectory_constraints = [(None , 0 , 0 , 0 )],
711711 basis = fs .PolyFamily (8 ))
712712
713713 # Method arguments, parameters
714- traj_method = fs .solve_flat_ocp (
714+ traj_method = fs .solve_flat_optimal (
715715 flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
716716 basis = fs .PolyFamily (6 ), minimize_method = 'slsqp' )
717- traj_kwarg = fs .solve_flat_ocp (
717+ traj_kwarg = fs .solve_flat_optimal (
718718 flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
719719 basis = fs .PolyFamily (6 ), minimize_kwargs = {'method' : 'slsqp' })
720720 np .testing .assert_allclose (
@@ -723,7 +723,7 @@ def test_solve_flat_ocp_errors(self):
723723
724724 # Unrecognized keywords
725725 with pytest .raises (TypeError , match = "unrecognized keyword" ):
726- traj_method = fs .solve_flat_ocp (
726+ traj_method = fs .solve_flat_optimal (
727727 flat_sys , timepts , x0 , u0 , cost_fcn , solve_ivp_method = None )
728728
729729 @pytest .mark .parametrize (
0 commit comments