|
9 | 9 | from .poly import PolyFamily |
10 | 10 | from .systraj import SystemTrajectory |
11 | 11 | from ..exception import ControlArgument |
| 12 | +from ..config import _process_legacy_keyword |
12 | 13 | from ..nlsys import NonlinearIOSystem |
13 | 14 | from ..timeresp import _check_convert_array |
14 | 15 |
|
@@ -315,7 +316,7 @@ def point_to_point( |
315 | 316 |
|
316 | 317 | Parameters |
317 | 318 | ---------- |
318 | | - flatsys : FlatSystem object |
| 319 | + sys : FlatSystem object |
319 | 320 | Description of the differentially flat system. This object must |
320 | 321 | define a function `flatsys.forward()` that takes the system state and |
321 | 322 | produceds the flag of flat outputs and a system `flatsys.reverse()` |
@@ -364,6 +365,20 @@ def point_to_point( |
364 | 365 |
|
365 | 366 | The constraints are applied at each time point along the trajectory. |
366 | 367 |
|
| 368 | + initial_guess : 2D array_like, optional |
| 369 | + Initial guess for the trajectory coefficients (not implemented). |
| 370 | +
|
| 371 | + params : dict, optional |
| 372 | + Parameter values for the system. Passed to the evaluation |
| 373 | + functions for the system as default values, overriding internal |
| 374 | + defaults. |
| 375 | +
|
| 376 | + minimize_method : str, optional |
| 377 | + Set the method used by :func:`scipy.optimize.minimize`. |
| 378 | +
|
| 379 | + minimize_options : str, optional |
| 380 | + Set the options keyword used by :func:`scipy.optimize.minimize`. |
| 381 | +
|
367 | 382 | minimize_kwargs : str, optional |
368 | 383 | Pass additional keywords to :func:`scipy.optimize.minimize`. |
369 | 384 |
|
@@ -399,9 +414,8 @@ def point_to_point( |
399 | 414 | T0 = timepts[0] if len(timepts) > 1 else T0 |
400 | 415 |
|
401 | 416 | # Process keyword arguments |
402 | | - if trajectory_constraints is None: |
403 | | - # Backwards compatibility |
404 | | - trajectory_constraints = kwargs.pop('constraints', None) |
| 417 | + trajectory_constraints = _process_legacy_keyword( |
| 418 | + kwargs, 'constraints', 'trajectory_constraints', trajectory_constraints) |
405 | 419 |
|
406 | 420 | minimize_kwargs = {} |
407 | 421 | minimize_kwargs['method'] = kwargs.pop('minimize_method', None) |
@@ -632,7 +646,7 @@ def solve_flat_ocp( |
632 | 646 |
|
633 | 647 | Parameters |
634 | 648 | ---------- |
635 | | - flatsys : FlatSystem object |
| 649 | + sys : FlatSystem object |
636 | 650 | Description of the differentially flat system. This object must |
637 | 651 | define a function `flatsys.forward()` that takes the system state and |
638 | 652 | produceds the flag of flat outputs and a system `flatsys.reverse()` |
@@ -684,6 +698,17 @@ def solve_flat_ocp( |
684 | 698 | initial_guess : 2D array_like, optional |
685 | 699 | Initial guess for the optimal trajectory of the flat outputs. |
686 | 700 |
|
| 701 | + params : dict, optional |
| 702 | + Parameter values for the system. Passed to the evaluation |
| 703 | + functions for the system as default values, overriding internal |
| 704 | + defaults. |
| 705 | +
|
| 706 | + minimize_method : str, optional |
| 707 | + Set the method used by :func:`scipy.optimize.minimize`. |
| 708 | +
|
| 709 | + minimize_options : str, optional |
| 710 | + Set the options keyword used by :func:`scipy.optimize.minimize`. |
| 711 | +
|
687 | 712 | minimize_kwargs : str, optional |
688 | 713 | Pass additional keywords to :func:`scipy.optimize.minimize`. |
689 | 714 |
|
@@ -724,12 +749,10 @@ def solve_flat_ocp( |
724 | 749 | T0 = timepts[0] if len(timepts) > 1 else 0 |
725 | 750 |
|
726 | 751 | # Process keyword arguments |
727 | | - if trajectory_constraints is None: |
728 | | - # Backwards compatibility |
729 | | - trajectory_constraints = kwargs.pop('constraints', None) |
730 | | - if trajectory_cost is None: |
731 | | - # Compatibility with point_to_point |
732 | | - trajectory_cost = kwargs.pop('cost', None) |
| 752 | + trajectory_constraints = _process_legacy_keyword( |
| 753 | + kwargs, 'constraints', 'trajectory_constraints', trajectory_constraints) |
| 754 | + trajectory_cost = _process_legacy_keyword( |
| 755 | + kwargs, 'cost', 'trajectory_cost', trajectory_cost) |
733 | 756 |
|
734 | 757 | minimize_kwargs = {} |
735 | 758 | minimize_kwargs['method'] = kwargs.pop('minimize_method', None) |
|
0 commit comments