声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1334|回复: 1

[线性振动] 使用中心差分法求解振动系统的响应——极易推广到多自由度

[复制链接]
发表于 2011-10-20 08:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
   

% equation m*ddx^2+c*dx+k*x=F
%numerial method have some fundametal characterristic :
%frist:they ara not intended to satisfy the governing differential equation
%all times ,but only at discrete time intervals ht apart
%second:...

% finite difference method
%the main idea in the finite difference method is to use approximations to
%derivatives.have three types of formulas_forward,backward,and central
%difference formulas.
%by using Taylors series we can obtain
%dx(i)= {x(i+1)- x(i-1) }/2h                 (2)
%ddx(i)={x(i+1)-2*x(i)+x(i-1)}/h^2            (3)
%let the duration over which the solution of equation(1),is requried be
%divided into n equal parts of interal h each .howevere wo must note
%that,select a time step h that is smaller than a critial time step
%Hlim.where Hlim=Tn/pi; Tn is the natural period of the system or the small
%such period. or,will cause ununstable,and the the responese worthless
%formulate
%a=1/(M/h^2+C/(2*h) ); b=2*M/h^2-K; c=C/(2*h)-M/h^2;
% xnew=a*(b*xold+c*xmold+Fold) :
%where xmold means be more old than xold or say x(i-1);xnew=x(i+1);
%Fold=F(i);
%from this foumalate we know it permits us to calculate the displacement of
%the mass x(i+1),if we konw the preious history of the displacement ar
%t(i)and t(i-1);as well as the present external force F(i).
%howere we find that wo must x(0) and x(-1) in oder to find the x(1);
% x(-1)=x0-h*dx0+h^2*ddx0/2;
% ddx0=(F(0)-C*dx0-K*x0)/M

%find the response of single degree of freedom system
function numerical_method()
clc
clear all
M=10;K=4000;C=20;Tmax=20;x0=0.04;dx0=0.06;h=0.01;


Hlim=sqrt(K/M)/pi;                 %the maxi step h<Hlim
if nargin<9;h=0.001;end
if h>=0.01*Hlim; error('time step larger than Hlim ');end
ddx0=(f(0)-C*dx0-K*x0)/M; xmold=x0-h*dx0+h^2*ddx0/2; xold=x0;
a=1/(M/h^2+C/(2*h) ); b=2*M/h^2-K; c=C/(2*h)-M/h^2;n=1;
for T=0:h:Tmax
   Fold=f(T);
xnew=a*(b*xold+c*xmold+Fold);
xsave(1,n)=xnew; m(1,n)=T;
xmold=xold;
xold=xnew;
n=n+1;
end
plot(m,xsave,'r');grid on;title('response of single degree of freedom system')
end


function f=f(t)
%should give differnet function
f=100*sin(10*t);
end
































回复
分享到:

使用道具 举报

发表于 2011-10-23 16:29 | 显示全部楼层
原创 or 转贴 !? 个人专业有限, 看似像分享!? 是吗?
若是, 若能稍作简易说明下相关输入/输出/算法, 甚至举例, 或许更适合学习! 个人浅见
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-20 20:24 , Processed in 0.052401 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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