Guide NM
User Manual: Pdf
Open the PDF directly: View PDF .
Page Count: 3
Download | ![]() |
Open PDF In Browser | View PDF |
Matlab interface for HPIPM Nikolce Murgovski The solver HPIPM targets a QP problem in the form min x,u,s s.t. N X 1 (uTn Rn un + xTn Qn xn ) + xTn Sn un + rnT un + qnT xn 2 n=1 N +1 X 1 T T T T + (s Zln sln + sun Zun sun ) + zln sln + zun sun 2 ln n=1 + xTf Qf xf + qfT xf f =N +1 xn+1 = An xn + Bn un + bn un lbn − ≤ ≤ ubn + sln xn sun lbn − ≤ ≤ ubn + sln xn sun n = 1, . . . , N lgn ≤ Cn xn + Dn un ≤ ugn n = 1, . . . , N n = 1, . . . , N n=N +1 lgf ≤ Cf xf ≤ ugf s s = ln ≥ 0 sun f =N +1 n = 1, . . . , N + 1 where x are states, u are control inputs, N is the number of stages, nx is the number of states, nu is the number of control signals and s are slack variables for the soft box constraints on the states. The problem can be solved by running [x,u,lam,lamf,s,lams]=hpipm(N,nx,nu,ng,ngf,x0,A,B,b,Q,Qf,R,S,q,qf,r, lb,ub,C,D,lg,ug,Cf,lgf,ugf,ixb,Zl,Zu,zl,zu,ixs); Output of the function are the states, the control inputs, the lagrange multipliers, lam, the lagrange multipliers in the final stage, lamf, the slack variables and the lagrange multipliers, lams, related to constraints involving the slack variables. The matrices that are input arguments in HPIPM are obtained by horizontal concatenation, e.g., A = A1 , A2 , ..., AN ∈ Rnx ×nx N . Alternatively, if constraints are to be kept hard, i.e. s = 0, then the problem can be solved by running [x,u,lam,lamf]=hpipm(N,nx,nu,ng,ngf,x0,A,B,b,Q,Qf,R,S,q,qf,r, lb,ub,C,D,lg,ug,Cf,lgf,ugf,ixb); The box bounds lb and ub are constructed by assigning the first nu rows for the bounds on u and the last nx rows for the bounds on x. The activation of box constraints in individual stages can be controlled by the logical matrix ixb. In order to reduce computation time, the initial state value is not considered an optimization variable with imposed equality constraint to x0. Instead, the function automatically alters the initial bounds lb0 and ub0 and the vectors b0 and r0 , such that optimization variable for the initial state is not needed. Similarly, the logical matrix ixb is automatically set to false for the state box constraints in the first stage, i.e. the last nx rows. Since final stage cannot have box constraints on the control inputs, ixb is also automatically set to false for the first nu rows in the final stage. The first nx rows in the matrix lam contain the lagrange multipliers for the state dynamics. The next 2(nu + nx ) rows contain the lagrange multipliers for the lower and upper box constraints on the control inputs and the states, respectively. The remaining 2ng rows contain the lagrange multipliers for the lower and upper general constraints. The rows of lamf are composed in a similar way. The first nx rows in lams are the lagrange multipliers for the slack variables of the 1 lower box constraints on the states, while the remaining nx rows are lagrange multipliers for the slack variables of the upper box constraints on the states. The logical matrix ixs is used to indicate which box state constraints are soft. This matrix is automatically altered in accordance to ixb, as soft constraints can only be applied to used box constraints on states. In places where box constraints or slack variables are not used, i.e. where ixb and ixs are false, the function returns not-a-number (NaN) for the lagrange multipliers. 2 Table 1: Arguments in HPIPM. Description Number of stages. Number of states in a stage. Number of control inputs in a stage. Number of general constraints in a stage. Number of general constraints in the final stage. Inputs N nx nu ng ngf Size 1×1 1×1 1×1 1×1 1×1 x0 nx × (N+1) Initial state values. A B b Q Qf R S q qf r lb ub nx × nx·N nx × nu·N nx × N nx × nx·N nx × nx nu × nu·N nx × nu·N nx × N nx × 1 nu × N (nu+nx) × (N+1) (nu+nx) × (N+1) State matrix in linear dynamics. Control matrix in linear dynamics. Disturbance in linear dynamics. Quadratic state penalty. Quadratic state penalty in the final stage. Quadratic penalty for control inputs. Cross-term penalty (typically not used). Linear state penalty. Linear state penalty in the final stage. Linear penalty for control inputs. Lower box constraints on control inputs and states. Upper box constraints on control inputs and states. C D lg ug ng ng ng ng Cf lgf ugf ngf × nx ngf × 1 ngf × 1 State matrix in general constraints in the final stage. Lower bound in general constraints in the final stage. Upper bound in general constraints in the final stage. ixb (nu+nx) × (N+1) Logical matrix indicating which box constraints are active. Zl Zu zl zu nx nx nx nx ixs nx × (N+1) Logical matrix indicating which box state constraints are soft. Outputs x u lam lamf s lams nx × (N+1) nu × N (nx+2(nu+nx)+2ng)×N (nx+2(nu+nx)+2ngf)×1 2 nx × (N+1) 2 nx × (N+1) Optimal state values. Optimal control values. Lagrange multipliers. Lagrange multipliers in the final stage. Slack variables. Lagrange multipliers for the slack variables. × × × × × × × × nx·N nu·N N N nx·(N+1) nx·(N+1) (N+1) (N+1) State matrix in general constraints. Control matrix in general constraints. Lower bound in general constraints. Upper bound in general constraints. Quadratic penalty for the slack variables of the lower box constraints. Quadratic penalty for the slack variables of the upper box constraints. Linear penalty for the slack variables of the lower box constraints. Linear penalty for the slack variables of the upper box constraints. 3
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 3 Producer : MiKTeX pdfTeX-1.40.18 Creator : TeX Create Date : 2018:01:12 18:53:26+01:00 Modify Date : 2018:01:12 18:53:26+01:00 Trapped : False PTEX Fullbanner : This is MiKTeX-pdfTeX 2.9.6499 (1.40.18)EXIF Metadata provided by EXIF.tools