@@ -200,7 +200,8 @@ def test_kinematic_car_ocp(
200200 'ignore' , message = "unable to solve" , category = UserWarning )
201201 traj_ocp = fs .solve_flat_ocp (
202202 vehicle_flat , timepts , x0 , u0 ,
203- cost = traj_cost , constraints = input_constraints ,
203+ trajectory_cost = traj_cost ,
204+ trajectory_constraints = input_constraints ,
204205 terminal_cost = terminal_cost , basis = basis ,
205206 initial_guess = initial_guess ,
206207 minimize_kwargs = {'method' : method },
@@ -445,8 +446,8 @@ def test_flat_solve_ocp(self, basis):
445446 (sp .optimize .NonlinearConstraint , lambda x , u : x , lb , ub )]
446447 traj_nlconst = fs .solve_flat_ocp (
447448 flat_sys , timepts , x0 , u0 ,
448- cost = trajectory_cost , terminal_cost = terminal_cost ,
449- constraints = nl_constraints , basis = basis ,
449+ trajectory_cost = trajectory_cost , terminal_cost = terminal_cost ,
450+ trajectory_constraints = nl_constraints , basis = basis ,
450451 )
451452 x_nlconst , u_nlconst = traj_nlconst .eval (timepts )
452453 np .testing .assert_almost_equal (x_const , x_nlconst )
@@ -685,7 +686,7 @@ def test_solve_flat_ocp_errors(self):
685686 # Try to optimize with insufficient degrees of freedom
686687 with pytest .raises (ValueError , match = "basis set is too small" ):
687688 traj = fs .solve_flat_ocp (
688- flat_sys , timepts , x0 , u0 , cost = cost_fcn ,
689+ flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
689690 basis = fs .PolyFamily (2 ))
690691
691692 # Solve with the errors in the various input arguments
@@ -700,20 +701,21 @@ def test_solve_flat_ocp_errors(self):
700701 with pytest .raises (TypeError , match = "must be a list" ):
701702 traj = fs .solve_flat_ocp (
702703 flat_sys , timepts , x0 , u0 , cost_fcn ,
703- constraints = np .eye (2 ), basis = fs .PolyFamily (8 ))
704+ trajectory_constraints = np .eye (2 ), basis = fs .PolyFamily (8 ))
704705
705706 # Unknown constraint type
706707 with pytest .raises (TypeError , match = "unknown constraint type" ):
707708 traj = fs .solve_flat_ocp (
708709 flat_sys , timepts , x0 , u0 , cost_fcn ,
709- constraints = [(None , 0 , 0 , 0 )], basis = fs .PolyFamily (8 ))
710+ trajectory_constraints = [(None , 0 , 0 , 0 )],
711+ basis = fs .PolyFamily (8 ))
710712
711713 # Method arguments, parameters
712714 traj_method = fs .solve_flat_ocp (
713- flat_sys , timepts , x0 , u0 , cost = cost_fcn ,
715+ flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
714716 basis = fs .PolyFamily (6 ), minimize_method = 'slsqp' )
715717 traj_kwarg = fs .solve_flat_ocp (
716- flat_sys , timepts , x0 , u0 , cost = cost_fcn ,
718+ flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
717719 basis = fs .PolyFamily (6 ), minimize_kwargs = {'method' : 'slsqp' })
718720 np .testing .assert_allclose (
719721 traj_method .eval (timepts )[0 ], traj_kwarg .eval (timepts )[0 ],
0 commit comments