MCPcopy Create free account

hub / github.com/TobiaMarcucci/pympc / functions

Functions198 in github.com/TobiaMarcucci/pympc

↓ 41 callersMethodfrom_bounds
Instantiates a Polyhedron in the form {x | x_min <= x[indices] <= x_max}. If indices is None, the inequality is applied to all the el
pympc/geometry/polyhedron.py:302
↓ 29 callersFunctionsame_rows
Checks if two matrices contain the same rows. The order of the rows can be different. The option normalize, normalizes the rows of A and
pympc/geometry/utils.py:94
↓ 27 callersMethodadd_equality
Adds the equality C x = d to the existing polyhedron. Arguments ---------- C : numpy.ndarray Left-hand s
pympc/geometry/polyhedron.py:102
↓ 27 callersFunctionlinear_program
Calls the desired solver to solve the linear program min_x f^T x s.t. A x <= b, C x = d. Arguments ---------- f : numpy.ndarray
pympc/optimization/programs.py:9
↓ 19 callersMethodcontains
Determines if the given point belongs to the polytope. Arguments ---------- x : numpy.ndarray Point whos
pympc/geometry/polyhedron.py:578
↓ 15 callersMethodis_included_in
Checks if the polyhedron P is a subset of the polyhedron P2 (returns True or False). For each halfspace H descibed a facet of P2, it
pympc/geometry/polyhedron.py:606
↓ 14 callersMethodadd_inequality
Adds the inequality A x[indices] <= b to the existing polyhedron. Arguments ---------- A : numpy.ndarray
pympc/geometry/polyhedron.py:63
↓ 13 callersMethodfrom_continuous
Instantiates a discrete-time linear system starting from its continuous time representation. Arguments ---------- A
pympc/dynamics/discrete_time_systems.py:201
↓ 12 callersMethodadd_upper_bound
Adds the inequality x[indices] <= x_max to the existing polyhedron. If indices is None, the inequality is applied to all the elements
pympc/geometry/polyhedron.py:162
↓ 11 callersMethodremove_redundant_inequalities
Removes the redundant facets of the polyhedron, it modifies the attributes A and b.
pympc/geometry/polyhedron.py:452
↓ 11 callersFunctionsame_vectors
Tests that two lists of array contain the same elements. The order of the elements in the lists can be different. Arguments --------
pympc/geometry/utils.py:133
↓ 8 callersMethodadd_lower_bound
Adds the inequality x[indices] >= x_min to the existing polyhedron. If indices is None, the inequality is applied to all the elements
pympc/geometry/polyhedron.py:141
↓ 8 callersMethodcartesian_product
Returns the Cartesian product between this instance of Polyhedron (P1) and the polyhedron P2. Arguments ---------- P
pympc/geometry/polyhedron.py:665
↓ 8 callersFunctionquadratic_program
Calls the desired solver to solve the strictly convex (H > 0) quadratic program min .5 x' H x + f' x s.t. A x <= b, C x = d. Arguments
pympc/optimization/programs.py:57
↓ 8 callersMethodsolve
Solves the QP at the given point x. Arguments ---------- x : numpy.ndarray Point where we want to get th
pympc/optimization/parametric_programs.py:155
↓ 7 callersFunctionmixed_integer_quadratic_program
Calls the desired solver to solve the strictly convex (H > 0) mixed-integer quadratic program min .5 x' H x + f' x s.t. A x <= b, C x = d. T
pympc/optimization/programs.py:107
↓ 6 callersFunctioncheck_affine_system
Check that the matrices A, B, and c of an affine system have compatible sizes. Arguments ---------- A : numpy.ndarray State
pympc/dynamics/utils.py:4
↓ 6 callersMethodfrom_lower_bound
Instantiates a Polyhedron in the form {x | x[indices] >= x_min}. If indices is None, the inequality is applied to all the elements of
pympc/geometry/polyhedron.py:240
↓ 6 callersFunctionnullspace_basis
Uses SVD to find a basis of the nullsapce of A. Arguments ---------- A : numpy.ndarray Matrix for the nullspace. Return
pympc/geometry/utils.py:4
↓ 6 callersMethodplot
Plots the 2d projection of the polyhedron in the given dimension. It assumes the polyhedron to be bounded and not empty. Arg
pympc/geometry/polyhedron.py:879
↓ 5 callersMethodV
Numeric value of the optimal value function at the point x. Arguments ---------- x : numpy.ndarray Point
pympc/optimization/parametric_programs.py:383
↓ 5 callersMethodsolve_dare
Returns the solution of the Discrete Algebraic Riccati Equation (DARE). Consider the linear quadratic control problem V*(x(0)) = min_
pympc/dynamics/discrete_time_systems.py:94
↓ 4 callersMethod_remove_equalities
For the polyhedron P := {x | A x <= b, C x = d}, returns the change of variables x = [N R] [n' r']' such that P can be expressed only by ineq
pympc/geometry/polyhedron.py:468
↓ 4 callersMethod_same_number_rows
Checks that E and f have the same number of rows. Arguments ---------- E : numpy.ndarray Left-hand side
pympc/geometry/polyhedron.py:363
↓ 4 callersMethod_selection_matrix
Returns a selection matrix S such that S x = x[indices]. Arguments ---------- indices : list of int Set
pympc/geometry/polyhedron.py:213
↓ 4 callersFunctionexplicit_euler
Discretizes the continuous-time affine system dx/dt = A x + B u + c approximating x(t+1) with x(t) + h dx/dt(t). Arguments ----------
pympc/dynamics/discretization_methods.py:8
↓ 4 callersMethodexplicit_solve_given_active_set
Returns the explicit solution of the mpQP for a given active set. The solution turns out to be an affine function of x, i.e. u(x) = u
pympc/optimization/parametric_programs.py:42
↓ 4 callersMethodfeedforward
Given the state x of the system, returns the optimal sequence of N inputs and the related cost. Arguments ----------
pympc/control/controllers.py:76
↓ 4 callersMethodfeedforward
Given the state x of the system, returns the optimal sequence of N inputs and the related cost. Arguments ----------
pympc/control/controllers.py:611
↓ 4 callersMethodfrom_convex_hull
Instantiates the polyhedron given from the conve hull of the given set of points. It assumes the polyhedron to be bounded. A
pympc/geometry/polyhedron.py:857
↓ 4 callersMethodfrom_symbolic
Instantiates a Polyhedron in the form expr(x) <= 0, eq(x) = 0. Arguments ---------- x : sympy matrix filled with sym
pympc/geometry/polyhedron.py:339
↓ 4 callersMethodfrom_symbolic_continuous
Instatiates a LinearSystem starting from the symbolic value of the next state. Arguments ---------- x : sympy matrix
pympc/dynamics/discrete_time_systems.py:258
↓ 4 callersFunctionget_matrices_affine_expression
Extracts from the symbolic affine expression the matrices such that expr(x) = A x - b. Arguments ---------- x : sympy matrix fil
pympc/geometry/polyhedron.py:921
↓ 4 callersFunctionget_state_transition_matrices
Extracts from the symbolic expression of the state at the next time step the matrices A, B, and c. Arguments ---------- x : sympy mat
pympc/dynamics/discrete_time_systems.py:753
↓ 4 callersMethodmcais
Returns the maximal constraint-admissible invariant set O_inf for the closed-loop system X(t+1) = (A + B K) x(t). It holds that x(0)
pympc/dynamics/discrete_time_systems.py:128
↓ 4 callersMethodminimal_facets
Computes the indices of the facets that generate a minimal representation of the polyhedron solving an LP for each facet of the redundant rep
pympc/geometry/polyhedron.py:403
↓ 4 callersMethodnormalize
Normalizes the polyhedron dividing each row of A by its norm and each entry of b by the norm of the corresponding row of A. Argument
pympc/geometry/polyhedron.py:379
↓ 4 callersMethodu
Numeric value of the primal optimizer at the point x. Arguments ---------- x : numpy.ndarray Point where
pympc/optimization/parametric_programs.py:349
↓ 4 callersFunctionzero_order_hold
Assuming piecewise constant inputs, it returns the exact discretization of the affine system dx/dt = A x + B u + c. Math ----------
pympc/dynamics/discretization_methods.py:43
↓ 3 callersMethod_bigM_matrices
Builds a matrix with the form | 0 bigM[1][2] bigM[1][3] ...| |bigM[2][1] 0 bigM[2][3] ...| |bigM[3][
pympc/control/controllers.py:514
↓ 3 callersFunction_build_model
Builds the Gurobi model the LP or the QP. Arguments ---------- H, f, A, b, C, d : numpy.ndarray Matrices of the mathematical
pympc/optimization/solvers/gurobi.py:173
↓ 3 callersFunction_reorganize_solution
Organizes the solution in a dictionary. Arguments ---------- model : instance of gurobipy.Model Model of the mathematical pr
pympc/optimization/solvers/gurobi.py:216
↓ 3 callersMethodadd_bounds
Adds the inequalities x_min <= x[indices] <= x_max to the existing polyhedron. If indices is None, the inequality is applied to all t
pympc/geometry/polyhedron.py:183
↓ 3 callersFunctioncondense_pwa_system
For the PWA system x(t+1) = A_i x(t) + B_i u(t) + c_i if (x(t), u(t)) in D_i, given the mode sequence z = (z(0), ... , z(N-1)), ret
pympc/dynamics/discrete_time_systems.py:676
↓ 3 callersMethodcontains
Checks if the point x is inside the critical region. Arguments ---------- x : numpy.ndarray Point we wan
pympc/optimization/parametric_programs.py:292
↓ 3 callersFunctionconvex_hull_method
Given a bouned polyhedron in the form P := {x | A x <= b}, returns the orthogonal projection to the given dimensions. Dividing the space in t
pympc/geometry/polyhedron.py:941
↓ 3 callersMethodfeedback
Returns the optimal feedback for the given state x. Arguments ---------- x : numpy.ndarray State of the
pympc/control/controllers.py:104
↓ 3 callersMethodget_critical_region
Returns the critical region that covers the given point. Arguments ---------- x : numpy.ndarray Point wh
pympc/optimization/parametric_programs.py:442
↓ 3 callersMethodintersection
Returns the intersection between this instance of Polyhedron (P1) and the polyhedron P2. Arguments ---------- P2 : i
pympc/geometry/polyhedron.py:643
↓ 3 callersFunctionlinear_expression
Generates a list of Gurobi linear expressions A_i x + b_i (one element per row of A). Arguments ---------- A : numpy.ndarray
pympc/optimization/solvers/gurobi.py:260
↓ 3 callersMethodp
Numeric value of the dual optimizer at the point x. Arguments ---------- x : numpy.ndarray Point where w
pympc/optimization/parametric_programs.py:366
↓ 3 callersFunctionplane_through_points
Returns the plane a' x = b passing through the points. It first adds a random offset to be sure that the matrix of the points is invertible (
pympc/geometry/utils.py:54
↓ 3 callersFunctionproductory
Multiplies from lest to right the matrices in the list matrix_list. Arguments ---------- matrix_list : list of numpy.ndarray
pympc/dynamics/discrete_time_systems.py:731
↓ 3 callersMethodsimulate
Simulates the system starting from the state x0 and applying the sequence of controls u. Arguments ---------- x0 : n
pympc/dynamics/discrete_time_systems.py:44
↓ 2 callersMethod_chebyshev
Returns the Chebyshev radius and center of the polyhedron P := {x | A x <= b, C x = d} solving the LP: min_{z, e} e s.t. F z <= g + F_{row_n
pympc/geometry/polyhedron.py:727
↓ 2 callersMethod_delete_attributes
Resets al the attibutes of the class to None.
pympc/geometry/polyhedron.py:201
↓ 2 callersMethodcondense
Constructs the matrices A_bar and B_bar such that x_bar = A_bar x(0) + B_bar u_bar with x_bar = (x(0), ... , x(N)) and u_bar = (u(0), ... , u
pympc/dynamics/discrete_time_systems.py:160
↓ 2 callersFunctioncondense_optimal_control_problem
For a given mode sequences, condenses the optimal control problem for a PWA affine system min_{x(.), u(.)} 1/2 sum_{t=0}^{N-1} (x'(t) Q x(t)
pympc/control/controllers.py:682
↓ 2 callersMethodexplicit_solve
Returns the explicit solution of the mpQP. It assumes that the facet-to-facet property holds (i.e. each facet of a critical region is
pympc/optimization/parametric_programs.py:181
↓ 2 callersMethodexplicit_solve_given_point
Returns the explicit solution of the mpQP at a given point. In case a guess for the active set is provided, it first tries it.
pympc/optimization/parametric_programs.py:118
↓ 2 callersMethodfeedback
Returns the optimal feedback for the given state x. Arguments ---------- x : numpy.ndarray State of the s
pympc/control/controllers.py:648
↓ 2 callersMethodfeedback_explicit
Finds the critical region where the state x is and returns the optimal feedback for the given state x. Arguments ----------
pympc/control/controllers.py:166
↓ 2 callersMethodfeedforward_explicit
Finds the critical region where the state x is and returns the optimal feedforward and the cost to go. Arguments ----------
pympc/control/controllers.py:138
↓ 2 callersMethodfrom_upper_bound
Instantiates a Polyhedron in the form {x | x[indices] <= x_max}. If indices is None, the inequality is applied to all the elements of
pympc/geometry/polyhedron.py:271
↓ 2 callersMethodget_feasible_set
Returns the feasible set of the mqQP, i.e. {x | exists u: Au u + Ax x <= b}. Returns ---------- instance of Polyhedr
pympc/optimization/parametric_programs.py:243
↓ 2 callersMethodget_mode
Given (x,u) returns the i such that (x,u) in D_i. Arguments ---------- x : numpy.ndarray Value for the s
pympc/dynamics/discrete_time_systems.py:533
↓ 2 callersMethodget_mpqp
Returns the optimal control problem in condensed form for the given mode sequence. Arguments ---------- mode_sequence
pympc/control/controllers.py:668
↓ 2 callersMethodis_well_posed
Check if the domains of the pwa system are well posed (i.e. if the intersection of the interior of D_i with the interior of D_j is empty for
pympc/dynamics/discrete_time_systems.py:558
↓ 2 callersFunctionlinearly_independent_rows
uses the QR decomposition to find the indices of a set of linear independent rows of the matrix A. Arguments ---------- A : numpy.nd
pympc/geometry/utils.py:28
↓ 2 callersFunctionmcais
Returns the maximal constraint-admissible (positive) invariant set O_inf for the system x(t+1) = A x(t) subject to the constraint x in X. O_i
pympc/dynamics/discrete_time_systems.py:584
↓ 2 callersMethodproject_to
Returns the orthogonal projection of the polytope. Arguments ---------- residual_dimensions : list of int
pympc/geometry/polyhedron.py:826
↓ 1 callersMethodA
Left hand side of the inequalities describing the critical region. Returns ---------- numpy.ndarray Left
pympc/optimization/parametric_programs.py:403
↓ 1 callersMethod_build_inequalities
Puts equations (1-4) from the documentation of _get_bigM_dynamics(), equation (5) from the documentation of _get_bigM_domains(), and the cond
pympc/control/controllers.py:449
↓ 1 callersMethod_condense_equalities
Puts the equality constraint x(0) = x0, x(t+1) = sum_{i=1}^s z_i(t), t = 0, ..., N-1, in the form x_bar = A_b
pympc/control/controllers.py:585
↓ 1 callersMethod_condense_inequalities
Stacks the inequalities Ex x(t) + Eu u(t) + Ez z(t) + Ed delta(t) <= E0, t = 0, ..., N-1, x(N) in X_N, in the form
pympc/control/controllers.py:540
↓ 1 callersMethod_condense_program
Generates and stores the optimal control problem in condensed form. Returns ---------- instance of MultiParametricQu
pympc/control/controllers.py:58
↓ 1 callersMethod_condense_program
Constructs a multiparametric Mixed Integer Quadratic Program (mpMIQP) in the form |u|' |Huu 0 0 0| |u|
pympc/control/controllers.py:407
↓ 1 callersFunction_expand_simplex
Expands the internal simplex to cover all the projection. Arguments ---------- A : numpy.ndarray Left-hand side of the inequ
pympc/geometry/polyhedron.py:1073
↓ 1 callersMethod_get_bigM_domains
Computes all the bigMs for the domains of the PWA system. Each one of the s domains of the PWA system has the form D_i = {(x,
pympc/control/controllers.py:360
↓ 1 callersMethod_get_bigM_dynamics
Computes all the bigMs for the dynamics of the PWA system. The PWA system has the dynamics x(t+1) = A_i x(t) + B_i u(t) + c_i
pympc/control/controllers.py:289
↓ 1 callersFunction_get_inner_simplex
Constructs a simplex contained in the porjection. Arguments ---------- A : numpy.ndarray Left-hand side of the inequalities
pympc/geometry/polyhedron.py:1035
↓ 1 callersFunction_get_two_vertices
Findes two vertices of the projection. Arguments ---------- A : numpy.ndarray Left-hand side of the inequalities describing
pympc/geometry/polyhedron.py:1002
↓ 1 callersFunction_voronoi_1d
Given a list of 1-dimensional points, returns the Voronoi partition of the space as a list of Polyhedron (pympc class). Arguments ------
examples/pwa_from_urdf/utils.py:66
↓ 1 callersFunction_voronoi_nd
Given a list of n-dimensional points, returns the Voronoi partition of the space as a list of Polyhedron (pympc class). Uses the scipy wrappe
examples/pwa_from_urdf/utils.py:19
↓ 1 callersMethodadd_symbolic_equality
Adds the inequality eq(x) = 0 to the existing polyhedron. Arguments ---------- x : sympy matrix filled with sympy sy
pympc/geometry/polyhedron.py:127
↓ 1 callersMethodadd_symbolic_inequality
Adds the inequality ineq(x) <= 0 to the existing polyhedron. Arguments ---------- x : sympy matrix filled with sympy
pympc/geometry/polyhedron.py:88
↓ 1 callersFunctionbig_m
For the list of Polyhedron P_list in the from Pi = {x | Ai x <= bi} returns a list of lists of numpy arrays, where m[i][j] := max_{x in Pj} Ai x
examples/pwa_from_urdf/utils.py:371
↓ 1 callersMethodbuild_mpmiqp
(self)
examples/pwa_from_urdf/utils.py:254
↓ 1 callersMethodcondense
Constructs the matrices A_bar, B_bar cnd c_bar such that x_bar = A_bar x(0) + B_bar u_bar + c_bar with x_bar = (x(0), ... , x(N)) and u_bar =
pympc/dynamics/discrete_time_systems.py:339
↓ 1 callersMethodcondense
See the documentation of condense_pwa_system().
pympc/dynamics/discrete_time_systems.py:487
↓ 1 callersFunctionconstrained_voronoi
Given a list of n-dimensional points, returns the Voronoi partition of the Polyhedron X as a list of Polyhedron. If X is None, returns the pa
examples/pwa_from_urdf/utils.py:118
↓ 1 callersMethodfacet_center
Returns the Cebyshec center of the i-th facet. Implementation note: it is necessary to add the facet as an equality constraint, other
pympc/optimization/parametric_programs.py:320
↓ 1 callersMethodfeedback
(self, x0)
examples/pwa_from_urdf/utils.py:340
↓ 1 callersMethodfeedforward
(self, x0)
examples/pwa_from_urdf/utils.py:314
↓ 1 callersFunctiongraph_representation
For the PWA system S x+ = Ai x + Bi u + ci if Fi x + Gi u <= hi, returns the graphs of the dynamics (list of Polyhedron) [ Fi Gi 0]
examples/pwa_from_urdf/utils.py:349
↓ 1 callersMethodminimal_facets
Returns the minimal facets of the critical region. Returns ---------- list of int List of indices of the
pympc/optimization/parametric_programs.py:308
↓ 1 callersFunctionpnnls
Solves the Partial Non-Negative Least Squares problem min_{u, v} ||A v + B u - c||_2^2 s.t. v >= 0. (See "Bemporad - A Multiparametric Quadra
pympc/optimization/solvers/pnnls.py:5
↓ 1 callersFunctionquadratic_expression
Generates a Gurobi quadratic expressions x' H x. Arguments ---------- H : numpy.ndarray Hessian of the quadratic expression.
pympc/optimization/solvers/gurobi.py:289
↓ 1 callersMethodset_initial_condition
(self, x0)
examples/pwa_from_urdf/utils.py:309
↓ 1 callersMethodsimulate
Simulates the system starting from the state x0 and applying the sequence of controls u. Arguments ---------- x0 : n
pympc/dynamics/discrete_time_systems.py:315
next →1–100 of 198, ranked by callers