没有合适的资源?快使用搜索试试~ 我知道了~
首页TOMLAB_PROPT学习笔记.docx
资源详情
资源评论
资源推荐
TOMLAB/PROPT 学习笔记
(---最优控制问题的求解方法 2)
1. PROPT 语法
简介:
包含状态方程、初始或终端条件、代价函数,其他方程和变量
1.1 标准函数、运算符语法:
1. collocate — Expand a propt tomSym to all collocation points on a phase.扩展到全部配置点上
格式:y = collocate(phase, x)
2. dot 微分
格式:dot(p,x)
如果已经调用 setPhase(p),可简化为 dot(x)。适用于其他?y = collocate(phase, x)?
3. final — Evaluate a propt tomSym at the final point of a phase.估算最后点的值
y = final(phase, x)
4. icollocate — Expand a propt tomSym to all interpolation points on a phase 扩展到全部插值点上
与 collocate 类似,除了插值点是用来代替搭配点。 这在构造初始猜测时通常很有用。
5. initial — Evaluate a propt tomSym at the initial point of a phase.计算初值
y = initial(phase, x)
6. integrate — Evaluate the integral of an expression in a phase. 计算积分值
y = integrate(phase, x)
7. mcollocate — Expand to all collocation points, endpoints and midpoints on a phase. 扩展到全部配置点、终点、
中间点上,用于设置涉及状态变量的不等式。应注意确保不与任何初始或最终条件冲突。
y = mcollocate(phase, x)
8. setPhase — Set the active phase when modeling PROPT problem.设置 phase 阶段
格式:setPhase(p)
可以省略 tomState,tomControl,initial,final,integrate 等命令的阶段参数。
9. tomControl — Generate a PROPT symbolic state. 定义控制变量
x = tomControl ,creates a scalar PROPT control with an automatic name.
x = tomControl(phase,label) , creates a scalar control with the provided name.
x = tomControl(phase,label,m,n) ,creates a m-by-n matrix of controls.
x = tomControl(phase,[],m,n) , creates a matrix control with an automatic name.
x = tomControl(phase,label,m,n,’int’) , creates an integer matrix symbol.
x = tomControl(phase,label,m,n,’symmetric’), creates a symmetric matrix symbol.
10. tomControls — Create tomControl objects 定义控制变量
tomControls x y z
等效于:
x = tomControl(’x’);
y = tomControl(’y’);
z = tomControl(’z’);
11. tomPhase — Create a phase struct 产生配置点
phase = tomPhase(label, t, tstart, tdelta, n)
phase = tomPhase(label, t, tstart, tdelta, ipoints, cpoints)
如:p = tomPhase('p', t, 0, tf, 30);0-tf 时间内,划分 30 个点
If n > 128 then Chebyshev points are used instead.)
phase = tomPhase(label, t, tstart, tdelta, n, [], 'cheb')
12. tomState — Generate a PROPT symbolic state ,定义状态变量
x = tomState creates a scalar PROPT state with an automatic name.
x = tomState(phase,label) creates a scalar state with the provided name.
x = tomState(phase,label,m,n) creates a m-by-n matrix state.
x = tomState(phase,[],m,n) creates a matrix state with an automatic name.
x = tomState(phase,label,m,n,’int’) creates an integer matrix symbol.
x = tomState(phase,label,m,n,’symmetric’) creates a symmetric matrix symbol.
13 tomStates — Create tomState objects as toms create tomSym objects ,定义状态变量
如:tomStates x y z
补充:
14. toms 定义时间变量
toms t t_f
15. ezsolve 求解
Solution = ezsolve (objective, constraints)
[solution, result] = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
Ezsolve 调 用 tomDiagnose 来 确 定 问 题 类 型 , 使 用 getSolver 找 到 合 适 的 求 解 器 , 然 后 调 用
sym2prob、tomRun、getSoluton 依次获得解决方案。
1.2 高级函数(运算符)语法
1. atPoints — Expand a propt tomSym to a set of points on a phase.拓展/插值
y = atPoints(phase, t, x)
y =atPoints(phase, t, x, solution)
2. interp1p — Polynomial interpolation.多项式插值
yi = interp1p(x,y,xi),根据(x,y)得到多项式,对 xi 处估算其 yi 值
3. proptGausspoints — Generate a list of gauss points. 生成高斯点列表。
[r, w] = gausspoints(nquad) = proptGausspoints(n)
Input: n - The number of points requested
Output: r - n 阶勒让德多项式的根;w -高斯求积的权重。
4. proptDi Matrix — Di erentiation matrix for interpPoly.ff ff
M = proptDiffMatrix(X,XI,N)
1.3 Screen output 屏幕输出
options . PriLevOpt = 1; % or higher for more output
1.4 结果输出 ,结构体 solution
2 案例
2.1 A Linear Problem with Bang Bang Control
Find u over t in [0; tF] to minimize:
J = tF
subject to:
Problem setup:
Solve the problem:
编程方法总结,步骤:
1.时间变量定义,toms t t_f ,由于 t_f 自由,须定义它
2.配置点定义,
p = tomPhase('p', t, 0, t_f, 30);固定格式
setPhase(p);
3.控制变量和状态变量定义,
tomStates x1 x2
tomControls u
4.初值定义
x0 = {
t_f == 20
icollocate({x1 == 300*t/t_f; x2 == 0}) %在插值点上。 x1 怎么不是 0?
collocate(u==1-2*t/t_f) %在配置点上对 u 设定初值
};
5. Box(?)取值范围约束
cbox = {
10 <= t_f <= 40 %tf 范围?
mcollocate(-2 <= u <= 1) %u 适用于全部点
};
6.边界约束
cbnd = {
initial({x1 == 0; x2 == 0}) %初值
final({x1 == 300; x2 == 0}) %终值
};
7.ODE 方程组
ceq = collocate({dot(x1) == x2; dot(x2) == u});%用 collocate,适用于配置点上?
8.目标函数
剩余20页未读,继续阅读
我是春老师
- 粉丝: 45
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0