24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1958  |  回复: 8
本帖产生 1 个 仿真EPI ,点击这里进行查看
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
caemechanics: 仿真EPI+1, 感谢应助 2012-03-28 21:48:58
bdwhq: 金币+7, ★★★★★最佳答案, 非常感谢dbb627 的热心帮助,谢谢谢谢!!!!!!! 2012-03-29 08:32:26
>> x1=sym('x1(t)');x2=sym('x2(t)');
>> vv=-5*(x2+10*x1+x1*sin(x1))-x1*x2

vv =

- 50*x1(t) - 5*x2(t) - x1(t)*x2(t) - 5*sin(x1(t))*x1(t)
>> syms t
>> dv=diff(vv,t)

dv =

- x1(t)*diff(x2(t), t) - x2(t)*diff(x1(t), t) - 5*sin(x1(t))*diff(x1(t), t) - 50*diff(x1(t), t) - 5*diff(x2(t), t) - 5*cos(x1(t))*x1(t)*diff(x1(t), t)
================================
v‘=-x1*x2'-x2*x1'-5*sin(x1)*x1'-50*x1'-5*x2'-5*cos(x1)*x1*x1'
微分方程组变为
x1=x(1)
x2=x(2)
v=x(3)
w=x(4)
===========
x1’=x2+x1*sin(x1);
x2‘=w+x1*x2;
v‘=-x1*x2'-x2*x1'-5*sin(x1)*x1'-50*x1'-5*x2'-5*cos(x1)*x1*x1'
w'=|v'|*(0.5*v-w)+0.3*v';
matlab 代码
CODE:
odefun=@(t,x,dx)[dx(1)-(x(2)+x(1)*sin(x(1)));
dx(2)-(x(4)+x(1)*x(2));
dx(3)-(-x(1)*dx(2)-x(2)*dx(1)-5*sin(x(1))*dx(1)-50*dx(1)-5*dx(2)-5*cos(x(1))*x(1)*dx(1));
dx(4)-(abs(dx(3))*(0.5*x(3)-x(4))+0.3*dx(3))];
t0=0;
x0=[0.1 0.1 0 0]';
fix_x0=ones(4,1);
dx0=[0 1 1 1]';
fix_dx0=zeros(4,1);
[x02,dx02]=decic(odefun,t0,x0,fix_x0,dx0,fix_dx0);
solution=ode15i(odefun,[0 20],x02,dx02);
t=solution.x;
x=solution.y;
plot(t,x)
legend('x1','x2','v','w')

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
5楼2012-03-28 21:15:34
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 bdwhq 的主题更新
信息提示
请填处理意见