找回密码
 注册
Simdroid-非首页
查看: 188|回复: 6

[5.微分方程] maple或maplesim似乎不能求解带有事件的常微分方程?一道小题

[复制链接]
发表于 2013-3-26 21:42:20 | 显示全部楼层 |阅读模式 来自 陕西西安
悬赏50仿真币已解决
本帖最后由 TBE_Legend 于 2013-3-26 21:59 编辑

maple或maplesim似乎不能求解带有事件的常微分方程?

比如: mathematica自带的这个例子, 从静摩擦到动摩擦的模拟:

我个人能力有限,似乎maple或maplesim解不了这个方程。



附件: 您需要 登录 才可以下载或查看,没有账号?注册

最佳答案

查看完整内容

前三个模型的求解代码如下。
发表于 2013-3-26 21:42:21 | 显示全部楼层 来自 吉林长春
Simdroid开发平台
前三个模型的求解代码如下。


  1. restart;
  2. m, l := 1., 1.;
  3. beltv := proc (t) options operator, arrow; .1 end proc;
  4. spring := proc (x) options operator, arrow; 1000.*(l-x) end proc;
  5. sys1 := [m*(diff(x(t), t, t)) = spring(x(t))+friction1(diff(x(t), t)), x(0) = 1, (D(x))(0) = 0];
  6. viscous := proc (v) options operator, arrow; (-1)*30.*(v-beltv(t)) end proc;
  7. friction1 := proc (v) options operator, arrow; viscous(v) end proc;
  8. friction1(v);
  9. sys1;
  10. sol1 := dsolve(sys1, numeric, output = listprocedure, range = 0 .. 2);
  11. plots[odeplot](sol1, [t, x(t)], 0 .. 1, gridlines = true, thickness = 2, refine = 2);
  12. plots[odeplot](sol1, [[t, diff(x(t), t)], [t, beltv(t)]], 0 .. 1, gridlines = true, thickness = 2, refine = 2);
  13. sys2 := [m*(diff(x(t), t, t)) = spring(x(t))+friction2(diff(x(t), t)), x(0) = 1, (D(x))(0) = 0];
  14. coulomb := proc (v) options operator, arrow; (-1)*25.*signum(v-beltv(t)) end proc;
  15. friction2 := proc (v) options operator, arrow; viscous(v)+coulomb(v) end proc;
  16. friction2(v);
  17. sys2;
  18. sol2 := dsolve(sys2, numeric, method = classical[abmoulton], stepsize = 0.4500000e-4, output = listprocedure);
  19. plots[odeplot](sol2, [t, x(t)], 0 .. 1, gridlines = true, thickness = 2);
  20. plots[odeplot](sol2, [[t, diff(x(t), t)], [t, beltv(t)]], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500);
  21. sys3 := [m*(diff(x(t), t, t)) = spring(x(t))+friction3(diff(x(t), t)), x(0) = 1, (D(x))(0) = 0];
  22. stribeck := proc (v) options operator, arrow; (-1)*.3*signum(v)*exp(-2*abs(v)) end proc;
  23. friction3 := proc (v) options operator, arrow; viscous(v)+coulomb(v)+stribeck(v) end proc;
  24. friction3(v);
  25. sys3;
  26. sol3 := dsolve(sys3, numeric, method = classical[abmoulton], stepsize = 0.4500000e-4, output = listprocedure);
  27. plots[odeplot](sol3, [t, x(t)], 0 .. 1, gridlines = true, thickness = 2);
  28. plots[odeplot](sol3, [[t, diff(x(t), t)], [t, beltv(t)]], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500);
  29. plots[display]({plots[odeplot](sol1, [t, x(t)], 0 .. 1, gridlines = true, thickness = 2, refine = 2), plots[odeplot](sol2, [t, x(t)], 0 .. 1, gridlines = true, thickness = 2, color = green), plots[odeplot](sol3, [t, x(t)], 0 .. 1, gridlines = true, thickness = 2, color = blue)}, view = [0 .. 1, 1 .. 1.03]);
  30. plots[display]({plots[odeplot](sol1, [[t, diff(x(t), t)], [t, beltv(t)]], 0 .. 1, gridlines = true, thickness = 2, refine = 2), plots[odeplot](sol2, [[t, diff(x(t), t)], [t, beltv(t)]], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500, color = green), plots[odeplot](sol3, [[t, diff(x(t), t)], [t, beltv(t)]], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500, color = blue)}, view = [0 .. 1, -0.2e-1 .. .13]);
复制代码

回复

使用道具 举报

发表于 2013-3-29 08:58:57 | 显示全部楼层 来自 吉林长春
个人感觉能求,不过对带事件的常微分方程不熟,
第一个方程好算,中间两个也能算,不过初始时间段似乎有点问题。
回复

使用道具 举报

 楼主| 发表于 2013-3-30 11:54:26 | 显示全部楼层 来自 陕西西安
本帖最后由 TBE_Legend 于 2013-3-30 12:12 编辑
feiyuzhen 发表于 2013-3-29 08:58
个人感觉能求,不过对带事件的常微分方程不熟,
第一个方程好算,中间两个也能算,不过初始时间段似乎有点 ...


我试了下 comsol 和 simulationx 都可以解。

simx 用了 typedesigner。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

 楼主| 发表于 2013-3-30 12:14:12 | 显示全部楼层 来自 陕西西安
mathematica 的确很好用, 但有bug, 你用用就知道了, 不信你把 belt 的速度改为与时间相关的。

comsol 也很好,以后可以和pde一起做。
回复

使用道具 举报

 楼主| 发表于 2013-3-30 12:16:01 | 显示全部楼层 来自 陕西西安
本帖最后由 TBE_Legend 于 2013-3-30 12:16 编辑

以上的结果都是 对应于 mathematica 自带例子中 第一个 friction model,就是最简单的那个。

不过希望可以看看maplesim怎么做,正在下载 maplesim v6 中, 有空在研究吧
回复

使用道具 举报

 楼主| 发表于 2013-4-1 22:02:24 | 显示全部楼层 来自 陕西西安
真不错,多谢老兄啊,看来maole是可以的,我回去仔细研究下先。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-16 15:09 , Processed in 0.033878 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表