一、关于二阶动力微分方程的求解问题 看到有不少人问过二阶动力微分方程的求解问题, 现举一个简单的例子, 其余的情形希望读者能举一反三, 自己多思考. %%%=========================================%%% clear all n=3; F=[25;24;20]; m1=31.2; m2=31.2; m3=31.2; k1=67.51; k2=67.51; k3=67.51; c1=0.01; c2=0.01; c3=0.01; M=[m1,0,0;0,m2,0;0,0,m3]; B=[c1+c2,-c2,0;-c2,c2+c3,-c3;0,-c3,c3]; K=[k1+k2,-k2,0;-k2,k2+k3,-k3;0,-k3,k3]; DL=inline('[x(n+1:end,1); inv(M)*(F-B*x(1:n,1)-K*x(1:n,1))]',... 't','x','flag','n','M','K','F','B'); options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]); [t,x]=ode45(DL,[0,3],rand(n,1),options,n,M,K,F,B); plot(t,x(:,1:n)) %%%==========================================%%% 讨论、回复专贴: “二阶动力微分方程的求解问题”回复专贴 [ 本帖最后由 eight 于 2007-6-1 00:13 编辑 ] |
GMT+8, 2024-12-5 04:41 , Processed in 0.042388 second(s), 16 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.