Path: news.mathworks.com!not-for-mail
From: "?nder " <onderbey_@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: ode function problem: Unable to meet integration tolerances and RCOND = NaN
Date: Sat, 7 Nov 2009 07:21:24 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 42
Message-ID: <hd375k$ben$1@fred.mathworks.com>
References: <hcmq23$m6j$1@fred.mathworks.com>
Reply-To: "?nder " <onderbey_@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257578484 11735 172.30.248.37 (7 Nov 2009 07:21:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 7 Nov 2009 07:21:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338038
Xref: news.mathworks.com comp.soft-sys.matlab:583185


     Hi,i have a problem with my ode function, it gives these warnings and gives NaN or no solutions:

...
> Warning: Matrix is singular, close to singular or badly scaled.
>          Results may be inaccurate. RCOND = NaN.
> > In ode15s at 617
> Warning: Matrix is singular, close to singular or badly scaled.
>          Results may be inaccurate. RCOND = NaN.
> > In ode15s at 617
> Warning: Failure at t=0.000000e+000.  Unable to meet integration tolerances without reducing the step size below the smallest value allowed (0.000000e+000) at time t.
> > In ode15s at 686
> Warning: Divide by zero.
> Warning: Divide by zero.


    Although i've tried many things, i couldn't make my programme work. What can i do to solve the problem, anyone has a guess?


     My exact programme is as following:

function dy=odefunBR(t,y)
axt=0;
ayt=0;
g=atan(y(6)/y(5)); %gamma angle

K2=10;  %Choose a proper 'K2' gain such that 'nc' doesn't exceed 200.
Rm=( y(1)^2+y(2)^2 )^(1/2);
Qt=atan(y(4)/y(3)); Qm=atan(y(2)/y(1));
nc=K2*Rm*sin(Qt-Qm);

dy=zeros(8,1); %create a column vector
dy(1)=y(5);
dy(2)=y(6);
dy(3)=y(7);
dy(4)=y(8);
dy(5)=-nc*sin(g);
dy(6)=nc*cos(g);
dy(7)=axt;
dy(8)=ayt;

%solve 'odefunBR' function, at time interval: 0-10sec, for the initials
[T,Y] = ode15s(@odefunBR,[0 10],[0 0 0 4000 0 500 250 0]);