| 查看: 2083 | 回复: 11 | |||
wzycrfpxz新虫 (初入文坛)
|
[求助]
有谁用过tomlab,帮我看看下面程序哪里出错了。。。。
|
|
toms t toms t_switch1 toms t_switch2 toms t_f p1 = tomPhase('p1',t,0,t_switch1,4); p2 = tomPhase('p2',t,t_switch1,t_switch2-t_switch1,4); p3 = tomPhase('p3',t,t_switch2,t_f-t_switch2,4); setPhase({p1,p2,p3}); tomStates x1 x2 x3 x4 x5 x6 x7 alpha beita x0 = { t_f == 56 t_switch1 == 16 t_switch2 == 35 icollocate({ x1 == -1900*t/t_f+1900; x2 == 0; x3 == -3100*t/t_f+3100; x4 == -40*t/t_f+40; x5 == -20*t/t_f+20; x6 == 50*t/t_f-50; x7 == -1905*t/t_f+1905; alpha==1.2212*t/t_f-1.2212; beita==0.6981*t/t_f-0.6891}) }; cbox = { 36<=t_f<=66}; cbnd = { initial ({ x1==1900;x2==0;x3==3100;x4==40;x5==20;x6==-50;x7==1905; alpha==-1.2212;beita==-0.6981}) final ({x1==0;x2==0;x3==0;x4==0;x5==0;x6==0;x7==1653.6; alpha==0;beita==0})}; ceq = { collocate(dot(x1)==x4) collocate(dot(x2)==x5) collocate(dot(x3)==x6) collocate(p1,dot(x4)== 11708/x7*sin(alpha)*cos(beita)) collocate(p2,dot(x4)== 4390.5/x7*sin(alpha)*cos(beita)) collocate(p3,dot(x4)== 11708/x7*sin(alpha)*cos(beita)) collocate(p1, dot(x5)== 11708/x7*sin(beita)) collocate(p2,dot(x5)==4390.5/x7*sin(beita)) collocate(p3,dot(x5)==11708/x7*sin(beita)) collocate(p1,dot(x6)==11708/x7*cos(alpha)*cos(beita)-3.7114) collocate(p2,dot(x6)==4390.5/x7*cos(alpha)*cos(beita)-3.7114) collocate(p3,dot(x6)==11708/x7*cos(alpha)*cos(beita)-3.7114) collocate(p1,dot(x7)==-4.6817) collocate(p2,dot(x7)==-1.7556) collocate(p3,cot(x7)==-4.6817)}; cco=continuity ({x1,x2,x3,x4,x5,x6,x7,alpha,beita}); objective=t_f; options=struct; solution=ezsolve(objective,{cbox,cbnd,ceq,cco},x0,options); t_plot = linspace(0,subs(t_f,solution),100); x1_plot = atPoints(t_plot,x1,solution); x2_plot = atPoints(t_plot,x2,solution); x3_plot = atPoints(t_plot,x3,solution); x4_plot = atPoints(t_plot,x4,solution); x5_plot = atPoints(t_plot,x5,solution); x6_plot = atPoints(t_plot,x6,solution); x7_plot = atPoints(t_plot,x7,solution); alpha_plot = atPoints(t_plot,alpha,solution); beita_plot = atPoints(t_plot,beita,solution); clf subplot(2,1,1) plot(t_plot,[x1_plot x2_plot]); legend('x1','x2'); |
» 收录本帖的淘帖专辑推荐
MATLAB |
» 猜你喜欢
垃圾破二本职称评审标准
已经有19人回复
职称评审没过,求安慰
已经有53人回复
毕业后当辅导员了,天天各种学生超烦
已经有5人回复
26申博自荐
已经有3人回复
A期刊撤稿
已经有4人回复
egbert
金虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 713.5
- 散金: 50
- 帖子: 20
- 在线: 24.2小时
- 虫号: 1148483
- 注册: 2010-11-16
- 性别: GG
- 专业: 运筹与管理
2楼2013-10-09 19:39:06
egbert
金虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 713.5
- 散金: 50
- 帖子: 20
- 在线: 24.2小时
- 虫号: 1148483
- 注册: 2010-11-16
- 性别: GG
- 专业: 运筹与管理
3楼2013-10-10 10:08:02
wzycrfpxz
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 1255.8
- 红花: 1
- 帖子: 15
- 在线: 21.6小时
- 虫号: 1947568
- 注册: 2012-08-20
- 专业: 系统科学与系统工程
4楼2013-10-11 12:28:15
egbert
金虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 713.5
- 散金: 50
- 帖子: 20
- 在线: 24.2小时
- 虫号: 1148483
- 注册: 2010-11-16
- 性别: GG
- 专业: 运筹与管理
5楼2013-10-11 14:52:32
han593205250
至尊木虫 (著名写手)
博士
- 应助: 5 (幼儿园)
- 金币: 12989
- 散金: 16
- 红花: 11
- 帖子: 1130
- 在线: 355小时
- 虫号: 1491418
- 注册: 2011-11-14
- 性别: GG
- 专业: 自动化

6楼2015-05-06 19:09:22
7楼2015-06-04 15:58:02
Lucine91
金虫 (小有名气)
- 应助: 2 (幼儿园)
- 金币: 1477.6
- 红花: 1
- 帖子: 62
- 在线: 106.4小时
- 虫号: 1540515
- 注册: 2011-12-17
- 性别: MM
- 专业: 细胞生物学研究中的新方法
8楼2015-06-30 23:28:40

9楼2015-10-23 11:10:33
zhangkai2014
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 37.3
- 散金: 15
- 帖子: 24
- 在线: 16小时
- 虫号: 3004993
- 注册: 2014-02-28
- 性别: GG
- 专业: 化学反应工程
10楼2016-09-13 10:17:27













回复此楼
egbert