Re: recording singularities of NDSolve

• To: mathgroup at smc.vnet.net
• Subject: [mg80511] Re: recording singularities of NDSolve
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Fri, 24 Aug 2007 01:54:12 -0400 (EDT)
• Organization: Uni Leipzig
• References: <fajnb6\$pcs\$1@smc.vnet.net>

```Hi,

you can't use NDSolve[] for singularities, because
the numerical solution uses a polynomial approximation
for the time dependence. A polynom can never approximate
a singularity like 1/t^n and on needs a different solver
tha uses rational function approximations, but it is not mutch
research done on that solvers and Mathematica has none.

Regards
Jens

Judith Bunder wrote:
> Hi,
>
> I have to solve a system of simultaneous equations and I have to solve them
> several times with varying initial conditions. I use something like this:
>
> Do[{c1 = i/imax, c2 = j /jmax,
>     sol[i, j] = First@NDSolve[eqns, coup, {t, 0,
>      100}]}, {j, 1, 5}, {i, 1, 5}]
>
> So, I solve the the problem 25 times with 5 different j values and 5 different
> i values. The variables c1 and c2 are the variable initial conditions. I have
> no problems with this part.
>
> My problem is, sometimes the solution diverges. This is good, I'm looking for
> divergent points. But, I want some method of recording where the solution
> diverges. I get the warning messages:
>
> NDSolve::ndsz At t=18.28484703670573` step size is effectively zero;
> singularity or stiff system suspected.
>
> so I could manually record this value of t. But, this isn't practical as
> several of my 25 solutions are usually divergent (and I also need to record
> the value of i and j). Is there any way to define something like t-div[i,j]
> which will record all these points where my solution diverges?
>