声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1291|回复: 2

[编程技巧] 各位好心的大侠帮忙看下这个warning是什么意思!!谢谢啦!!

[复制链接]
发表于 2012-3-22 17:03 | 显示全部楼层 |阅读模式

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

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

x

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Warning: Failure at t=1.547794e+000.  Unable to meet integration tolerances without reducing the step size below the
smallest value allowed (3.552714e-015) at time t.
> In ode15s at 753
  In modfun1 at 6

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


是什么意思?是我的方程有问题还是程序有问题?各位帮帮忙吧!!
回复
分享到:

使用道具 举报

发表于 2012-3-22 19:52 | 显示全部楼层
积分的步长强制变小了. 应该结果可信,自己再确认一下.
 楼主| 发表于 2012-3-22 20:07 | 显示全部楼层
可是为什么不是我想要的结果!!而且根本不对啊!!下面是我的程序!!帮忙看下哪里有错误!!谢谢了@!



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all
clc
tspan=[0,1000];                                                                        
x0=[1.4*10^-6,1.5*10^-6,0,630,298];                                                            
options=odeset('RelTol',1e-6);                                                        
[t,x]=ode15s(@modfun,tspan,x0,options);
figure;
plot(t,x(:,1),'r-');
hold on;
plot(t,x(:,2),'k:');
hold on;
plot(t,x(:,3),'b:');
hold on;
plot(t,x(:,4),'k-');
hold on;
plot(t,x(:,5),'r:');
set(gca,'Fontsize',12);
xlabel('\itt','Fontsize',16);
legend('x1','x2','x3','x4','x5')


function dx=modfun(t,x)
rc=(0.125-3.78*x(3))^1/3;
d1=1.467*10^-6*x(4)^1.75;
d2=3.828*10^-7*x(4)^1.75;
k1=0.225*exp(-179.14/x(4));
k2=0.650*exp(-342.4324/x(4));
r1=-(4*pi*rc^2*(2.3616*10^-5-x(1)))/(1/k1+rc/d1-4*rc^2/d1);
r2=-(4*pi*rc^2*(1.549*10^-5-x(2)))/(1/k2+rc/d2-4*rc^2/d2);
cpg=(2*(2.3616*10^-5-x(1))*(6.52+7.8*10^-2*x(4)+0.12*10^5*x(4)^-2)+28*(1.549*10^-5-x(2))*(6.79+9.8*10^-2*x(4)-0.12*10^5*x(4)^-2)+18*(2.308*10^+6-x(1))*(7.3+2.46*10^-3*x(4))+44*(1.1027*10^-6+x(2))*(10.57+2.1*10^-3*x(4)-2.06*10^5*x(4)^-2)+16*2.0759*10^-6*(5.65+11.44*10^-3*x(4)-0.46*10^5*x(4)^-2))/(60.4229+16*x(1)+16*x(2));
gms=2533.3*(-4.4864*rc^3+0.0069)/(-0.0342*rc^3+0.0069);
cps=(3.4+0.006*x(5)*rc^3+79.9140*rc^3)/(0.3875-0.3*rc^3);
h1=8921.1-3.79*x(5)+5.466*10^-4*x(5)^2-1.2*10^4*x(5)^-1;
h2=-2472.6-0.79*x(5)+0.266*10^-3*x(5)^2+1.95*10^5*x(5)^-1;
dx=[-0.99/1.98*10^8*r1;...
    -0.99/1.98*10^8*r2;...
    -0.99/4.56*10^4*(r1+r2);...
    0.99*pi*4*10^4*(x(5)-x(4))/(cpg*8.8419*10^3);...
   0.99*(pi*4*10^4*(x(5)-x(4))-h1*r1-h2*r2)/gms/cps];                                                         
dx=dx(:);
return


问题出在哪里!!帮忙看下是不是程序错了!!十分感谢!!

运行后的图片

运行后的图片
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-17 15:42 , Processed in 0.052100 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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