qpmpc
Linear time-variant (LTV) model predictive control in Python. Solve a quadratic program of the form:
\[\begin{split}\begin{array}{rl}
\underset{x_k, u_k}{\min} \quad & w_{t} \|x_N - x_{\mathit{goal}}\|_2^2 + w_x \sum_{k=0}^{N-1} \| x_k - x_{\mathit{goal}} \|_2^2 + w_u \sum_{k=0}^{N-1} \| u_k \|^2_2 \\
\mathrm{s.t.} \quad & x_{k+1} = A_k x_k + B_k u_k \\
& C_k x_k + D_k u_k \leq e_k \\
& x_0 = x_{\mathit{init}}
\end{array}\end{split}\]
The library provides a one-stop shop solve_mpc()
function that computes the Solution
corresponding to such a Problem
.
- Installation
- Usage
- Defining an optimal control problem
MPCProblem
MPCProblem.goal_state
MPCProblem.ineq_input_matrix
MPCProblem.ineq_state_matrix
MPCProblem.ineq_vector
MPCProblem.initial_state
MPCProblem.input_dim
MPCProblem.nb_timesteps
MPCProblem.stage_input_cost_weight
MPCProblem.stage_state_cost_weight
MPCProblem.state_dim
MPCProblem.terminal_cost_weight
MPCProblem.transition_input_matrix
MPCProblem.transition_state_matrix
MPCProblem.get_ineq_input_matrix()
MPCProblem.get_ineq_state_matrix()
MPCProblem.get_ineq_vector()
MPCProblem.get_transition_input_matrix()
MPCProblem.get_transition_state_matrix()
MPCProblem.has_stage_state_cost
MPCProblem.has_terminal_cost
MPCProblem.update_goal_state()
MPCProblem.update_initial_state()
MPCProblem.update_target_states()
- Solving the optimal control problem
- Reading the solution
- Defining an optimal control problem
- Examples
- Developer notes