Compute trajectory between an initial and final conditions.
Compute an optimal trajectory for a differentially flat system starting from an initial state and input value.
FlatSystem
object
Description of the differentially flat system. This object must define a function forward
that takes the system state and produces the flag of flat outputs and a function reverse
that takes the flag of the flat output and produces the state and input.
The list of points for evaluating cost and constraints, as well as the time horizon. If given as a float, indicates the final time for the trajectory (corresponding to xf)
Define the initial conditions for the system (default = 0).
Initial input for the system. Defaults to zero.
BasisFamily
object, optional
The basis functions to use for generating the trajectory. If not specified, the PolyFamily
basis family will be used, with the minimal number of elements required to find a feasible trajectory (twice the number of system states)
Function that returns the integral cost given the current state and input. Called as cost(x, u)
.
Function that returns the terminal cost given the state and input. Called as cost(x, u)
.
List of constraints that should hold at each point in the time vector. Each element of the list should consist of a tuple with first element given by scipy.optimize.LinearConstraint
or scipy.optimize.NonlinearConstraint
and the remaining elements of the tuple are the arguments that would be passed to those functions. The following tuples are supported:
(LinearConstraint, A, lb, ub): The matrix A is multiplied by stacked vector of the state and input at each point on the trajectory for comparison against the upper and lower bounds.
(NonlinearConstraint, fun, lb, ub): a user-specific constraint function fun(x, u)
is called at each point along the trajectory and compared against the upper and lower bounds.
The constraints are applied at each time point along the trajectory.
Initial guess for the optimal trajectory of the flat outputs.
Parameter values for the system. Passed to the evaluation functions for the system as default values, overriding internal defaults.
SystemTrajectory
The system trajectory is returned as an object that implements the SystemTrajectory.eval
function, we can be used to compute the value of the state and input and a given time t
.
Set the method used by scipy.optimize.minimize
.
Set the options keyword used by scipy.optimize.minimize
.
Pass additional keywords to scipy.optimize.minimize
.
Notes
Additional keyword parameters can be used to fine tune the behavior of the underlying optimization function. See minimize_*
keywords in control.optimal.OptimalControlProblem
for more information.
The return data structure includes the following additional attributes:
success
: bool indicating whether the optimization succeeded
cost
: computed cost of the returned trajectory
message
: message returned by optimization if success if False
A common failure in solving optimal control problem is that the default initial guess violates the constraints and the optimizer can’t find a feasible solution. Using the initial_guess
parameter can often be used to overcome these errors.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4