@@ -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 )
@@ -657,7 +658,7 @@ def test_solve_flat_ocp_errors(self):
657658 # Try to optimize with insufficient degrees of freedom
658659 with pytest .raises (ValueError , match = "basis set is too small" ):
659660 traj = fs .solve_flat_ocp (
660- flat_sys , timepts , x0 , u0 , cost = cost_fcn ,
661+ flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
661662 basis = fs .PolyFamily (2 ))
662663
663664 # Solve with the errors in the various input arguments
@@ -672,20 +673,21 @@ def test_solve_flat_ocp_errors(self):
672673 with pytest .raises (TypeError , match = "must be a list" ):
673674 traj = fs .solve_flat_ocp (
674675 flat_sys , timepts , x0 , u0 , cost_fcn ,
675- constraints = np .eye (2 ), basis = fs .PolyFamily (8 ))
676+ trajectory_constraints = np .eye (2 ), basis = fs .PolyFamily (8 ))
676677
677678 # Unknown constraint type
678679 with pytest .raises (TypeError , match = "unknown constraint type" ):
679680 traj = fs .solve_flat_ocp (
680681 flat_sys , timepts , x0 , u0 , cost_fcn ,
681- constraints = [(None , 0 , 0 , 0 )], basis = fs .PolyFamily (8 ))
682+ trajectory_constraints = [(None , 0 , 0 , 0 )],
683+ basis = fs .PolyFamily (8 ))
682684
683685 # Method arguments, parameters
684686 traj_method = fs .solve_flat_ocp (
685- flat_sys , timepts , x0 , u0 , cost = cost_fcn ,
687+ flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
686688 basis = fs .PolyFamily (6 ), minimize_method = 'slsqp' )
687689 traj_kwarg = fs .solve_flat_ocp (
688- flat_sys , timepts , x0 , u0 , cost = cost_fcn ,
690+ flat_sys , timepts , x0 , u0 , trajectory_cost = cost_fcn ,
689691 basis = fs .PolyFamily (6 ), minimize_kwargs = {'method' : 'slsqp' })
690692 np .testing .assert_allclose (
691693 traj_method .eval (timepts )[0 ], traj_kwarg .eval (timepts )[0 ],
0 commit comments