TBE_Legend 发表于 2013-3-26 21:42:20

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

本帖最后由 TBE_Legend 于 2013-3-26 21:59 编辑

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

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

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



feiyuzhen 发表于 2013-3-26 21:42:21

前三个模型的求解代码如下。


restart;
m, l := 1., 1.;
beltv := proc (t) options operator, arrow; .1 end proc;
spring := proc (x) options operator, arrow; 1000.*(l-x) end proc;
sys1 := ;
viscous := proc (v) options operator, arrow; (-1)*30.*(v-beltv(t)) end proc;
friction1 := proc (v) options operator, arrow; viscous(v) end proc;
friction1(v);
sys1;
sol1 := dsolve(sys1, numeric, output = listprocedure, range = 0 .. 2);
plots(sol1, , 0 .. 1, gridlines = true, thickness = 2, refine = 2);
plots(sol1, [, ], 0 .. 1, gridlines = true, thickness = 2, refine = 2);
sys2 := ;
coulomb := proc (v) options operator, arrow; (-1)*25.*signum(v-beltv(t)) end proc;
friction2 := proc (v) options operator, arrow; viscous(v)+coulomb(v) end proc;
friction2(v);
sys2;
sol2 := dsolve(sys2, numeric, method = classical, stepsize = 0.4500000e-4, output = listprocedure);
plots(sol2, , 0 .. 1, gridlines = true, thickness = 2);
plots(sol2, [, ], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500);
sys3 := ;
stribeck := proc (v) options operator, arrow; (-1)*.3*signum(v)*exp(-2*abs(v)) end proc;
friction3 := proc (v) options operator, arrow; viscous(v)+coulomb(v)+stribeck(v) end proc;
friction3(v);
sys3;
sol3 := dsolve(sys3, numeric, method = classical, stepsize = 0.4500000e-4, output = listprocedure);
plots(sol3, , 0 .. 1, gridlines = true, thickness = 2);
plots(sol3, [, ], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500);
plots({plots(sol1, , 0 .. 1, gridlines = true, thickness = 2, refine = 2), plots(sol2, , 0 .. 1, gridlines = true, thickness = 2, color = green), plots(sol3, , 0 .. 1, gridlines = true, thickness = 2, color = blue)}, view = );
plots({plots(sol1, [, ], 0 .. 1, gridlines = true, thickness = 2, refine = 2), plots(sol2, [, ], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500, color = green), plots(sol3, [, ], 0 .. 1, gridlines = true, thickness = 2, numpoints = 500, color = blue)}, view = );

feiyuzhen 发表于 2013-3-29 08:58:57

个人感觉能求,不过对带事件的常微分方程不熟,
第一个方程好算,中间两个也能算,不过初始时间段似乎有点问题。

TBE_Legend 发表于 2013-3-30 11:54:26

本帖最后由 TBE_Legend 于 2013-3-30 12:12 编辑

feiyuzhen 发表于 2013-3-29 08:58 http://forum.simwe.com/static/image/common/back.gif
个人感觉能求,不过对带事件的常微分方程不熟,
第一个方程好算,中间两个也能算,不过初始时间段似乎有点 ...

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

simx 用了 typedesigner。


TBE_Legend 发表于 2013-3-30 12:14:12

mathematica 的确很好用, 但有bug, 你用用就知道了, 不信你把 belt 的速度改为与时间相关的。

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

TBE_Legend 发表于 2013-3-30 12:16:01

本帖最后由 TBE_Legend 于 2013-3-30 12:16 编辑

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

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

TBE_Legend 发表于 2013-4-1 22:02:24

真不错,多谢老兄啊,看来maole是可以的,我回去仔细研究下先。
页: [1]
查看完整版本: maple或maplesim似乎不能求解带有事件的常微分方程?一道小题