|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
运动微分方程
function d=fun(t,y,w)
N=length(y);
w=700;
m1=4; m2=32.1;
e=0.00005;
c=0.00011;
k=2.5e7;
delta2=0.4;
c1=1050;
c2=2100;
k1=7.5e7;
k2=2.5e9;
cb1=350;
cb2=500;
ox1=y(1);
oy1=y(2);
odx1=y(5);
ody1=y(6);
ox2=y(3);
oy2=y(4);
odx2=y(7);
ody2=y(8);
if oy1<0
cb=cb2;
kb=k2;
elseif (oy1>=0)&(oy1<=delta2)
cb=0;
kb=0;
else
cb=cb1;
kb=k1;
end
M=[ m1 0 0 0;
0 m1 0 0;
0 0 m2 0;
0 0 0 m2; ];
C=[ c1 0 -c1 0;
0 c1+cb 0 -c1;
-c2 0 c2 0;
0 -c2 0 c2; ];
K=[ k 0 -k 0;
0 k+kb 0 -k;
-k 0 k 0;
0 -k 0 k; ];
fx=oilx( ox1, oy1, odx1, ody1, w);
fy=oily( ox1, oy1, odx1, ody1, w);
F=[ fx;
fy-m1*9.81;
m2*e*w^2*cos(t);
m2*e*w^2*sin(t)-m2*9.81; ];
C=C/w;
K=K/w^2;
F=F/c/w^2;
for i=1:1:N/2
y1(i,1)=y(i);
y2(i,1)=y(i+N/2);
end
yy2=inv(M)*(F-C*y2-K*y1);
for i=1:1:N/2
d(i)=y2(i,1);
d(i+N/2)=yy2(i,1);
end
x方向上油膜力函数
unction oilforce=oilx(x,y,dx,dy,wi)
R=0.025; L=0.012; miu=0.018; dfai=1; dert=0.00011;
e=sqrt(x*x+y*y);
delta=miu*wi*R*L*(R/dert)*(R/dert)*(L/2.0/R)*(L/2.0/R);
ppp1=(y+2.0*dx)/(x-2.0*dy);
sign1=sign(ppp1);
ppp2=y+2.0*dx;
sign2=sign(ppp2);
alpha=atan(ppp1)-pi/2.0*(sign1+sign2);
alphaa=atan((y*cos(alpha)-x*sin(alpha))/sqrt(abs(1.0-abs(x*x)-abs(y*y))));
fg=2.0*(pi/2.0+alphaa)/sqrt(abs(1.0-abs(x*x)-abs(y*y)));
fv=(2.0+(y*cos(alpha)-x*sin(alpha))*fg)/(1.0-abs(x*x)-abs(y*y));
fs=(x*cos(alpha)+y*sin(alpha))/(1.0-abs((x*cos(alpha)+y*sin(alpha))*(x*cos(alpha)+y*sin(alpha))));
f1=sqrt(abs(abs((x-2.0*dy)*(x-2.0*dy))+abs((y+2.0*dx)*(y+2.0*dx))))/(1.0-abs(x*x)-abs(y*y));
fx=-1.0*f1*(3.0*x*fv-sin(alpha)*fg-2.0*cos(alpha)*fs);
fy=-1.0*f1*(3.0*y*fv+cos(alpha)*fg-2.0*sin(alpha)*fs);
oilforce=fx*delta;
y方向上油膜力函数
function oilforce=oily(x,y,dx,dy,wi)
R=0.025; L=0.012; miu=0.018; dfai=1; dert=0.00011;
e=sqrt(x*x+y*y);
delta=miu*wi*R*L*(R/dert)*(R/dert)*(L/2.0/R)*(L/2.0/R);
ppp1=(y+2.0*dx)/(x-2.0*dy);
sign1=sign(ppp1);
ppp2=y+2.0*dx;
sign2=sign(ppp2);
alpha=atan(ppp1)-pi/2.0*(sign1+sign2);
alphaa=atan((y*cos(alpha)-x*sin(alpha))/sqrt(abs(1.0-abs(x*x)-abs(y*y))));
fg=2.0*(pi/2.0+alphaa)/sqrt(abs(1.0-abs(x*x)-abs(y*y)));
fv=(2.0+(y*cos(alpha)-x*sin(alpha))*fg)/(1.0-abs(x*x)-abs(y*y));
fs=(x*cos(alpha)+y*sin(alpha))/(1.0-abs((x*cos(alpha)+y*sin(alpha))*(x*cos(alpha)+y*sin(alpha))));
f1=sqrt(abs(abs((x-2.0*dy)*(x-2.0*dy))+abs((y+2.0*dx)*(y+2.0*dx))))/(1.0-abs(x*x)-abs(y*y));
fx=-1.0*f1*(3.0*x*fv-sin(alpha)*fg-2.0*cos(alpha)*fs);
fy=-1.0*f1*(3.0*y*fv+cos(alpha)*fg-2.0*sin(alpha)*fs);
oilforce=fy*delta;
主程序
%clc
t0=0;
tf=1000
y0=[0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05;]';
[t,y]=ode45(@fun,[t0,tf],y0);
plot(t,y)
fclose('all');
%crack3
我试图用ode45去求解运动微分方程,但运行结果为:
tf =
1000
??? Error using ==> funfun\private\odearguments
FUN must return a column vector.
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...
Error in ==> rub_time at 8
[t,y]=ode45(@fun,[t0,tf],y0);
谁能够帮我修改下主程序 求解微分方程 我对matlab确实不是很了解 但毕业设计时间紧迫 所以求助下l |
|