User Interface for Modeling and Control Synthesis for MPT 3.0
=============================================================
The proposed user interface (UI) aims to fix the design flaws of the
old MPT 2.6.x interface. The main points behind the new UI are:
* consistency with respect to working with various prediction models
(LTI, PWA, MLD, compositions of various subsystems)
* consistency of mathematical formulation between on-line and explicit
controllers
* easy extensibility without the need to maintain a single monolithic
implementation
* ability to seamlessly import MPT 2.6.x formulations
* promotion of the "correct" workflow where tuning is done on on-line
controllers first, only converting them to the explicit form when the
tuning is complete (avoiding frequent re-computation of the explicit
solution)
The UI consists of three primary layers, described in more details below.
1) Classes representing prediction models
2) Classes representing controllers
3) Class representing a generic closed-loop system
1. Representation of prediction models
--------------------------------------
The UI allows to define four basic types of prediction models:
1) Linear Time Invariant (LTI) models
2) Piecewise Affine (PWA) models
3) Mixed-Logical Dynamical (MLD) models
4) Compositions consisting of several interconnected LTI/PWA/MLD
models
1.1 LTI models
--------------
LTI models describe linear (in fact, affine) time-invariant systems
of the form
x^+ = A x + B u + f
y = C x + D u + g
Such models, represented by the @LTISystem class, can be constructed
in three ways:
1) By providing the matrices:
lti = LTISystem('A', A, 'B', B, 'C', C, 'D', D, 'f', f, 'g', g)
The 'f' and 'g' parameters can be omitted.
2) By importing from state-space models of the Control Toolbox:
ss = ss(A, B, C, D, Ts)
lti = LTISystem(ss)
Note that only discrete-time state-space objects can be imported.
3) By importing from MPT2 sysStruct:
lti = LTISystem(sysStruct)
The returned object contains:
1) matrices A, B, C, D, f, g of the state-update and output equations
(read-only)
2) dimensions nx, nu, ny (read-only)
3) sampling time Ts (read-only)
4) signals representing states (lti.x), inputs (lti.u) and outputs
(lti.y) of the system (read/write)
5) domain of the system in the state-input space (can be set using the
setDomain method)
Properties of these signals (e.g. constraints and penalties) can be
defined as described in Section 1.4.
The class implements following methods:
* initialize(x0): Sets the current state of the system
* getStates(): Returns the current state of the system
* update(u): Performs the state update using the control action "u"
* output(u): Computes the output (note that providing the control
action is only needed if the system contains direct feed-through)
* setDomain(type, D): sets the domain of the system either in the state
space (type='x'), input space (type='u') or state-input space (type='xu')
* plot(): to visualize the optimized open-loop profiles of states,
inputs and outputs (requires prior call to an optimization routine,
explained in Section 2.x)
The object remembers the value of its state and updates it whenever
update() is called. This means that evolution of the system can be
obtained in the following way:
lti.initialize(x0)
lti.update(u0)
lti.update(u1)
lti.update(u2)
lti.getStates()
See mpt3_lti_demo1.m, mpt3_lti_demo2.m, mpt3_lti_demo3.m,
mpt3_lti_demo4.m, mpt3_lti_demo5.m for examples.
1.2 PWA models
--------------
PWA models encode the PWA dynamics
x^+ = A_i*x + B_i*u + f_i IF [x; u] \in Dom_i
y = C_i*x + D_i*u + g_i IF [x; u] \in Dom_i
PWA models can be created in three ways:
1) By providing an array of LTI systems, each of which represents one mode
of the PWA system:
dyn1 = LTISystem(...)
dyn1.setDomain('x', Polyhedron(...)) % Region of validity
dyn2 = LTISystem(...)
dyn2.setDomain('x', Polyhedron(...)) % Region of validity
pwa = PWASystem([dyn1, dyn2])
2) By converting an MLD description to a PWA form:
mld = MLDSystem(...)
pwa = PWASystem(mld)
3) By importing from MPT2's sysStruct:
opt_sincos
pwa = PWASystem(sysStruct)
Internally, PWA models are represented by the @PWASystem class, which
contains following fields (all read-only):
* A, B, C, D, f, g: cell arrays of matrices
* domain: array of polyhedra denoting region of validity of corresponding
local affine models
* nx, nu, ny, ndyn: number of states, inputs, outputs and dynamics
* Ts: sampling time
* x, u, y, d: signals representing states, inputs, outputs and binary
mode selectors
Properties of signals 'x', 'u', 'y', 'd' (e.g. constraints and penalties)
can be defined as described in Section 1.5.
The class implements the same methods as in the LTI case (Section 1.1).
1.3 MLD models
--------------
MLD models are represented by the @MLDSystem class and can be imported
from a HYSDEL source file by calling
mld = MLDSystem('filename.hys')
If the source file contains symbolic parameters, their values can be
provided as a structure in the second input argument:
mld = MLDSystem('filename.hys', struct('param1', value1))
MLD models can be converted to a PWA form using the toPWA() method:
pwa = mld.toPWA();
The class implements the same methods as in the LTI case (Section 1.1).
1.4 Signals
-----------
As mentioned in Section 1.1-1.3, each prediction model contains
"signals", which represent the state, input and output variables of
the model.
A "signal", represented by the @SystemSignal class, is a basic
primitive which does two things:
1) it represents the prediction of a given quantity over a prediction
horizon as a YALMIP variable
2) allows to define basic properties of the quantity
A "signal" is created by calling the s=SystemSignal(n)
constructor where "n" is the dimension of the signal.
(NOTE: the user never has to create signals manually.)
Once the signal is created, following basic properties can be set by
the user:
* lower bound (s.min = [...])
* upper bound (s.max = [...])
* penalty function (s.penalty = ...)
As a specific example, consider the following LTI model of a double
integrator:
Ts = 1
s = c2d(ss(tf(1, [1 0 0])), Ts)
lti = LTISystem(s)
Then the "lti" object contains following signals:
* lti.x: the 2x1 state vector
* lti.u: the 1x1 input
* lti.y: the 2x1 output vector
To set the lower/upper bound on the input, one would call
lti.u.min = -1;
lti.u.max = 1;
To set a quadratic state penalty of the form x'*Q*x on the state with
Q=eye(2), call
lti.x.penalty = Penalty(eye(2), 2)
NOTE: Definition of penalties is described in Section 1.5.
Besides the minimal set of properties described above, arbitrary
additional properties can be added on-the-fly by the concept of custom
properties, called "filters". Examples include polyhedral constraints, soft
constraints, or move blocking. These custom properties are described by
separate methods of the SystemSignal class, prefixed by "filter_" (see
"methods SystemSignal").
Examples:
* polyhedral set constraint (for states, inputs, outputs):
lti.x.with('setConstraint') % enable the property
lti.x.setConstraint = Polyhedron(...); % specification of the property
* marking variables as binary (for states, inputs, outputs):
lti.u.with('binary')
lti.u.binary = true;
* move-blocking constraint u(1)=u(2)=u(3):
lti.u.with('block')
lti.u.block.from = 1
lti.u.block.to = 3
* soft constraints (for states, inputs, outputs):
lti.x.with('softMin') % soft lower bound
lti.x.with('softMax') % soft upper bound
* penalty on the final predicted state:
lti.x.with('terminalPenalty')
lti.x.terminalPenalty = Penalty(...)
* polyhedral constraints on the final predicted state:
lti.x.with('terminalSet')
lti.x.terminalSet = Polyhedron(...)
* adding a reference trajectory for MPC (for
没有合适的资源?快使用搜索试试~ 我知道了~
matlab的mpt工具箱(含voronoi函数)
共739个文件
m:660个
mdl:8个
_private:4个
5星 · 超过95%的资源 需积分: 43 125 下载量 67 浏览量
2018-06-07
15:06:51
上传
评论 6
收藏 873KB ZIP 举报
温馨提示
matlab的最新mpt工具箱里面含有各种关于画voronoi图等的函数)
资源推荐
资源详情
资源评论
收起资源包目录
matlab的mpt工具箱(含voronoi函数) (739个子文件)
._@AbstractController 239B
._@AbstractSystem 239B
._@AffFunction 239B
._@BinTreePolyUnion 239B
._@ClosedLoop 239B
._@ComponentBehavior 239B
._@ConvexSet 239B
._@ConvexSetInterface 239B
._@EMPCController 239B
._@ExamplePoly 239B
._@FilterBehavior 239B
._@FilterSetup 239B
._@Function 239B
._@InfNormFunction 239B
._@IterableBehavior 239B
._@LQRController 239B
._@LTISystem 239B
._@MLDSystem 239B
._@MPCController 239B
._@mptctrl 239B
._@MPTUIHandle 239B
._@NormFunction 239B
._@OneNormFunction 239B
._@Opt 239B
._@Polyhedron 239B
._@polytope 239B
._@PolyUnion 239B
._@PWASystem 239B
._@QuadFunction 239B
._@SFController 239B
._@SystemSignal 239B
._@ULTISystem 239B
._@Union 239B
._@YSet 239B
._compatibility 239B
._control 239B
._demos 239B
._functions 239B
._geometry 239B
._graphics 239B
._hys2pwa 238B
._hysdel2 239B
._jacobian 239B
._modules 239B
._mpt 239B
._optmerge 239B
._parallel 239B
._private 239B
._private 239B
._private 239B
._private 239B
._sets 239B
._simulink 239B
._solvers 239B
._solvers 239B
._ui 239B
._unions 239B
._utils 239B
._utils 239B
._utils 239B
jacobian 2KB
mpt_ctrl.jpg 28KB
._mpt_ctrl.jpg 239B
._cplex.log 239B
cplex.log 49B
mpt_plcp.m 79KB
mpt_mplp_26.m 65KB
mpt_constructMatrices.m 59KB
mpt_mpqp_26.m 51KB
hys2pwa.m 46KB
Polyhedron.m 45KB
mpt_optMergeDivCon.m 40KB
Opt.m 37KB
mpt_hyparr2.m 35KB
PWASystem.m 31KB
mptopt.m 30KB
BinTreePolyUnion.m 30KB
ULTISystem.m 28KB
mpt_solvers_options.m 28KB
mpt_exHyperAdv.m 27KB
mpt_sys.m 26KB
toC.m 24KB
mpt_verifySysStruct.m 24KB
mpt_solve.m 23KB
qp2lcp.m 22KB
mpt_demo_sets3.m 19KB
mpt_solveLP_26.m 19KB
AbstractController.m 19KB
mpt_solveQP_26.m 18KB
validate.m 18KB
mpt_verifyProbStruct.m 18KB
mpt_optMerge.m 17KB
EMPCController.m 17KB
mpt_call_glpk.m 16KB
mpt_call_lcp.m 16KB
polytope.m 15KB
mpt_hyparr.m 15KB
PolyUnion.m 14KB
LTISystem.m 14KB
eliminateEquations.m 14KB
共 739 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
- yang218cly2019-01-17非常好用,很实用
qq_42113816
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功